Skip to content
Xiaoguang Dai edited this page Jan 29, 2014 · 1 revision

Environment Setup

HPCLinux On VirtualBox

The suggested way to practice Cilk Plus in this class is trying to use the HPCLinux OVA image on VirtualBox. This is a ready to use environment. To show that, you can try to compile and run some Cilk Plus examples:

$ cp -r /opt/intel/composer_xe_2013_sp1.0.080/Samples/en_US/C++/cilk_samples/ .

$ make -C cilk_samples/

$ cilk_samples/qsort

Standalone installation

As Cilk Plus is a C/C++ language extension, you need a compiler which support it. There are two options here:

  1. Intel C/C++ Compiler (icc/icpc): This is a commercial product, but you can download a free 30-day evaluation version (TODO: can't open the Intel download page, chrome complains "Invalid Server Certificate")

  2. GCC Cilk Plus compiler: This is the GCC development branch with Cilk Plus extension. A binary build by Intel can be downloaded.

$ wget https://www.cilkplus.org/sites/default/files/cilk-gcc-compiler/cilkplus-4_8-install.tar_0.bz2

$ tar jxf cilkplus-4_8-install.tar_0.bz2

$ export LD_LIBRARY_PATH=$(pwd)/cilkplus-4_8-install/lib:$(pwd)/cilkplus-4_8-install/lib64:$LD_LIBRARY_PATH

$ cilkplus-4_8-install/bin/g++ -fcilkplus -lcilkrts <cilk-demo.cpp>

$ ./a.out