[Cbc] Cbc-2.9.7 doesn't compile with gcc-5
ycollette.nospam at free.fr
ycollette.nospam at free.fr
Mon Feb 15 09:30:19 EST 2016
Smallest test case problem for compilation:
test.cpp:
#include <cilk/cilk.h>
#define CILK_FOR_GRAINSIZE 128
void CoinAbcScatterUpdate(int number)
{
int result = 0;
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
cilk_for(int j=0; j < number; j+=2) {
result+=j;
}
}
compilation:
$ g++ -c -fcilkplus test.cpp -o test.o
test.cpp: Dans la fonction ‘void CoinAbcScatterUpdate(int)’:
test.cpp:9:24: erreur: ‘CILK_FOR_GRAINSIZE’ was not declared in this scope
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
^
test.cpp:9:9: erreur: invalid grainsize for _Cilk_for
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
^
----- Mail original -----
De: "ycollette nospam" <ycollette.nospam at free.fr>
À: "cbc" <cbc at list.coin-or.org>
Envoyé: Lundi 15 Février 2016 15:15:20
Objet: Re: [Cbc] Cbc-2.9.7 doesn't compile with gcc-5
I've made a simple example. Here is the file:
#include <iostream>
#include <cilk/cilk.h>
#include <iostream>
#include <cilk/cilk.h>
#define UNROLL_SCATTER 2
#define INLINE_SCATTER 1
#define CILK_FOR_GRAINSIZE 128
#if INLINE_SCATTER==0
void CoinAbcScatterUpdate(int number);
#else
void CoinAbcScatterUpdate(int number)
{
int result = 0;
#if UNROLL_SCATTER==0
std::cout << "test1" << std::endl;
#elif UNROLL_SCATTER==1
std::cout << "test2" << std::endl;
#elif UNROLL_SCATTER==2
std::cout << "test3" << std::endl;
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
cilk_for(int j=0; j < number; j+=2) {
result+=j;
}
#elif UNROLL_SCATTER==3
std::cout << "test4" << std::endl;
#endif
}
#endif
int main() {
return 0;
}
When I compile this example as an executable, everything is fine.
$ g++ -fcilkplus test.cpp -o test.o
If I compile the file as an object file, I meet the same error message:
$ g++ -c -fcilkplus test.cpp -o test.o
test.cpp: Dans la fonction ‘void CoinAbcScatterUpdate(int)’:
test.cpp:24:24: erreur: ‘CILK_FOR_GRAINSIZE’ was not declared in this scope
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
^
test.cpp:24:9: erreur: invalid grainsize for _Cilk_for
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
^
A gcc bug ?
YC
----- Mail original -----
De: "ycollette nospam" <ycollette.nospam at free.fr>
À: "cbc" <cbc at list.coin-or.org>
Envoyé: Lundi 15 Février 2016 14:55:42
Objet: [Cbc] Cbc-2.9.7 doesn't compile with gcc-5
Hello,
I downloaded Cbc-2.9.7 to compile it on fedora 23 64 bits.
I wanted to compiled Cbc with aboca enabled.
Here is my command line:
./configure --prefix=/opt/cbc-2.9.7 --enable-aboca=4
And some of the errors I've got:
if /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I`echo .` -I/home/admin/tmp/Cbc-2.9.7/CoinUtils/src -DCOIN_HAS_CLP -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCLP_BUILD -MT ClpCholeskyDense.lo -MD -MP -MF ".deps/ClpCholeskyDense.Tpo" -c -o ClpCholeskyDense.lo ClpCholeskyDense.cpp; \
then mv -f ".deps/ClpCholeskyDense.Tpo" ".deps/ClpCholeskyDense.Plo"; else rm -f ".deps/ClpCholeskyDense.Tpo"; exit 1; fi
g++ -DHAVE_CONFIG_H -I. -I. -I/home/admin/tmp/Cbc-2.9.7/CoinUtils/src -DCOIN_HAS_CLP -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCLP_BUILD -MT ClpCholeskyDense.lo -MD -MP -MF .deps/ClpCholeskyDense.Tpo -c ClpCholeskyDense.cpp -fPIC -DPIC -o .libs/ClpCholeskyDense.o
ClpCholeskyDense.cpp: In function 'void ClpCholeskyCtriRec(ClpCholeskyDenseC*, longDouble*, int, longDouble*, longDouble*, longDouble*, int, int, int, int)':
ClpCholeskyDense.cpp:708:21: error: -fcilkplus must be enabled to use '_Cilk_spawn'
cilk_spawn ClpCholeskyCtriRec(thisStruct, aTri, nThis, aUnder, diagonal, work, nLeft2, iBlock, jBlock, numberBlocks);
^
ClpCholeskyDense.cpp:711:3: error: -fcilkplus must be enabled to use '_Cilk_sync'
cilk_sync;
^
ClpCholeskyDense.cpp: In function 'void ClpCholeskyCrecTri(ClpCholeskyDenseC*, longDouble*, int, int, int, int, longDouble*, longDouble*, longDouble*, int)':
ClpCholeskyDense.cpp:757:21: error: -fcilkplus must be enabled to use '_Cilk_spawn'
cilk_spawn ClpCholeskyCrecTri(thisStruct, aUnder, nTri2, nDo, iBlock, jBlock, aTri, diagonal, work, numberBlocks);
^
ClpCholeskyDense.cpp:766:3: error: -fcilkplus must be enabled to use '_Cilk_sync'
cilk_sync;
^
ClpCholeskyDense.cpp: In function 'void ClpCholeskyCrecRec(ClpCholeskyDenseC*, longDouble*, int, int, int, longDouble*, longDouble*, longDouble*, int, int, int)':
ClpCholeskyDense.cpp:786:21: error: -fcilkplus must be enabled to use '_Cilk_spawn'
cilk_spawn ClpCholeskyCrecRec(thisStruct, above, nUnder, nUnder2, nDo, aUnder, aOther, work,
^
ClpCholeskyDense.cpp:790:3: error: -fcilkplus must be enabled to use '_Cilk_sync'
cilk_sync;
^
ClpCholeskyDense.cpp:807:21: error: -fcilkplus must be enabled to use '_Cilk_spawn'
cilk_spawn ClpCholeskyCrecRec(thisStruct, above, nUnder2, nUnderK, nDo, aUnder, aOther, work,
^
ClpCholeskyDense.cpp:813:3: error: -fcilkplus must be enabled to use '_Cilk_sync'
cilk_sync;
Next, I configured cbc with the following command line:
./configure --prefix=/opt/cbc-2.9.7 --enable-aboca=4 CXXFLAGS=-fcilkplus
And now, I meet the following error message:
if /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I`echo .` -I/home/admin/tmp/Cbc-2.9.7/CoinUtils/src -DCOIN_HAS_CLP -fcilkplus -DCLP_BUILD -MT ClpSolve.lo -MD -MP -MF ".deps/ClpSolve.Tpo" -c -o ClpSolve.lo ClpSolve.cpp; \
then mv -f ".deps/ClpSolve.Tpo" ".deps/ClpSolve.Plo"; else rm -f ".deps/ClpSolve.Tpo"; exit 1; fi
g++ -DHAVE_CONFIG_H -I. -I. -I/home/admin/tmp/Cbc-2.9.7/CoinUtils/src -DCOIN_HAS_CLP -fcilkplus -DCLP_BUILD -MT ClpSolve.lo -MD -MP -MF .deps/ClpSolve.Tpo -c ClpSolve.cpp -fPIC -DPIC -o .libs/ClpSolve.o
In file included from CoinAbcBaseFactorization.hpp:19:0,
from CoinAbcFactorization.hpp:18,
from AbcSimplexFactorization.hpp:13,
from ClpSolve.cpp:52:
CoinAbcHelperFunctions.hpp: In function 'void CoinAbcScatterUpdate(int, CoinFactorizationDouble, const CoinFactorizationDouble*, const int*, CoinFactorizationDouble*)':
CoinAbcHelperFunctions.hpp:99:24: error: 'CILK_FOR_GRAINSIZE' was not declared in this scope
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
^
CoinAbcHelperFunctions.hpp:99:9: error: invalid grainsize for _Cilk_for
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
^
In file included from CoinAbcBaseFactorization.hpp:19:0,
from CoinAbcFactorization.hpp:18,
from AbcSimplexFactorization.hpp:13,
from ClpSolve.cpp:52:
CoinAbcHelperFunctions.hpp: In function 'void CoinAbcScatterUpdate(int, CoinFactorizationDouble, const CoinFactorizationDouble*, CoinFactorizationDouble*)':
CoinAbcHelperFunctions.hpp:338:24: error: 'CILK_FOR_GRAINSIZE' was not declared in this scope
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
^
CoinAbcHelperFunctions.hpp:338:9: error: invalid grainsize for _Cilk_for
#pragma cilk grainsize=CILK_FOR_GRAINSIZE
^
Makefile:931: recipe for target 'ClpSolve.lo' failed
make[3]: *** [ClpSolve.lo] Error 1
Best regards,
YC
_______________________________________________
Cbc mailing list
Cbc at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/cbc
_______________________________________________
Cbc mailing list
Cbc at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/cbc
More information about the Cbc
mailing list