You can use it only with lucid.
Set the environment variables for a terminal:
For csh/tcsh:
source
/usr/local/lib/parallel_studio_xe_2011_update1_intel64/bin/compilervars.csh
intel64
Then
Example: file Fib.c below
#include <stdlib.h>
#include <stdio.h>
#include
</usr/local/lib/parallel_studio_xe_2011_update1_intel64/composerxe/include/cilk/cilk.h>
#include
</usr/local/lib/parallel_studio_xe_2011_update1_intel64/composerxe/include/cilk/common.h>
#include
</usr/local/lib/parallel_studio_xe_2011_update1_intel64/composerxe/include/cilk/cilk_stub.h>
#include
</usr/local/lib/parallel_studio_xe_2011_update1_intel64/composerxe/include/cilk/cilk_api.h>
#include
</usr/local/lib/parallel_studio_xe_2011_update1_intel64/composerxe-2011.2.137/compiler/include/cilk/cilk.h>
#include
</usr/local/lib/parallel_studio_xe_2011_update1_intel64/composerxe-2011.2.137/compiler/include/cilk/cilk_stub.h>
#include
</usr/local/lib/parallel_studio_xe_2011_update1_intel64/composerxe-2011.2.137/compiler/include/cilk/common.h>
#include
</usr/local/lib/parallel_studio_xe_2011_update1_intel64/composerxe-2011.2.137/compiler/include/cilk/cilk_api.h>
int fib (int n)
{
if (n < 2) return 1;
else {
int rst = 0;
rst += cilk_spawn fib (n-1);
rst += cilk_spawn fib (n-2);
cilk_sync;
return rst;
}
}
int main (int argc, char *argv[])
{
int n, result;
n = atoi(argv[1]);
result = cilk_spawn fib(n);
cilk_sync;
printf ("Result: %d\n", result);
return 0;
}
The you can compile it:
icc Fib.c
use with eclipse:
==================
use eclipse-cpp