seqan / flexbar

flexible barcode and adapter removal
BSD 3-Clause "New" or "Revised" License
76 stars 29 forks source link

cmake / compilation problems (wrong compiler used) #8

Closed fthommen closed 7 years ago

fthommen commented 7 years ago

Trying to compile flexbar I am consistently running into compilation issues. I'm using -DCMAKE_CXX_FLAGS to point to the location of our TBB installation and to add the -std=c++14 to the compiler. However the compilation consistently fails and the problem seems to be, that the wrong compiler is uses:

$  which gcc
/ibios/tbi_cluster/13.1/x86_64/gcc/gcc-6.x/bin/gcc
$ which c++
/ibios/tbi_cluster/13.1/x86_64/gcc/gcc-6.x/bin/c++
$

but

$ cmake -DCMAKE_PREFIX_PATH=/tmp/flexbar-test -DCMAKE_CXX_FLAGS="-I/ibios/tbi_cluster/13.1/x86_64/tbb/tbb-2017.1/include" DCMAKE_C_COMPILER=`which gcc` .
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Flexbar 64 bit architecture
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8") 
-- Found BZip2: /usr/lib64/libbz2.so (found version "1.0.6") 
-- Looking for BZ2_bzCompressInit in /usr/lib64/libbz2.so
-- Looking for BZ2_bzCompressInit in /usr/lib64/libbz2.so - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/thommen/projects/flexbar/flexbar-2.7.0
$

Note the wrong - because too old - compiler selected by cmake (/usr/bin/cc, /usr/bin/c++). How can this be fixed?

frank

mmokrejs commented 7 years ago

Note the wrong - because too old - compiler selected by cmake (/usr/bin/cc, /usr/bin/c++). How can this > be fixed?

Maybe try this one?

CC=/ibios/tbi_cluster/13.1/x86_64/gcc/gcc-6.x/bin/gcc CXX=/ibios/tbi_cluster/13.1/x86_64/gcc/gcc-6.x/bin/c++ cmake -DCMAKE_PREFIX_PATH=/tmp/flexbar-test -DCMAKE_CXX_FLAGS="-I/ibios/tbi_cluster/13.1/x86_64/tbb/tbb-2017.1/include" -DCMAKE_C_COMPILER=`which gcc`

Yes, I also see:

cd /tmp/flexbar-2.7.0_build/src && /usr/bin/x86_64-pc-linux-gnu-g++  -DSEQAN_HAS_BZIP2=1 -DSEQAN_HAS_ZLIB=1 -I/tmp/flexbar-2.7.0/include   -I/usr/include/seqan-2.2 -DNDEBUG -O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native -std=c++11   -o CMakeFiles/flexbar.dir/Flexbar.cpp.o -c /tmp/flexbar-2.7.0/src/Flexbar.cpp
In file included from /usr/include/seqan-2.2/seqan/basic.h:42:0,
                 from /tmp/flexbar-2.7.0/src/Flexbar.h:17,
                 from /tmp/flexbar-2.7.0/src/Flexbar.cpp:22:
/usr/include/seqan-2.2/seqan/platform.h:155:6: error: #error SeqAn requires C++14! You must compile your application with -std=c++14, -std=gnu++14 or -std=c++1y.
     #error SeqAn requires C++14! You must compile your application with -std=c++14, -std=gnu++14 or -std=c++1y.

but adding -std=c++14 does not help because cmake anyway adds afterwards its own -std=c++11

jtroehr commented 7 years ago

Is this issue still prevalent, also with version 3.0 of Flexbar?