I try to compile a programme using cilk but it don't works
g++ -std=c++11 -fcilkplus -lcilkrts -ldl -O2 src/cpp/* -o bin/exe
src/cpp/sous_monoide.cpp: Dans la fonction
src/cpp/sous_monoide.cpp:269:19: erreur : expected ‘)’ before ‘;’ token
cilk_for (i = 0; i < limite; i++){
^
src/cpp/sous_monoide.cpp:269:36: erreur : expected ‘;’ before ‘)’ token
cilk_for (i = 0; i < limite; i++){
^
src/cpp/sous_monoide.cpp:312:1: erreur : expected ‘}’ at end of input
}
^
src/cpp/sous_monoide.cpp:312:1: erreur : expected ‘}’ at end of input
src/cpp/sous_monoide.cpp:312:1: erreur : expected ‘}’ at end of input
This is the code :
const int limite = n-1;
int i;
cilk_for (i = 0; i < limite; i++){
....
}
Thanks for your help
You need to read the documentation a bit more! If you're compiling C++ and not C, which it looks like you are, the variable for the control variable needs to be defined in the cilk_for statement. So you can't use:
You have to use: