You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I have multiple compilers, the make step fails.
It seems that cmake finds the compiler in /usr/bin
I configured my computer to have /usr/local/bin before /usr/bin in the PATH environment variable.
[~/Downloads/bamtools-master/build]$ cmake ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- 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
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zhouke/Downloads/bamtools-master/build
But the make process is using the newer version of gcc 4.8.1 and is having trouble.
[~/Downloads/bamtools-master/build]$ make
Scanning dependencies of target SharedHeaders
[ 1%] Exporting SharedHeaders
[ 1%] Built target SharedHeaders
Scanning dependencies of target APIHeaders
[ 2%] Exporting APIHeaders
[ 2%] Built target APIHeaders
Scanning dependencies of target AlgorithmsHeaders
[ 3%] Exporting AlgorithmsHeaders
[ 3%] Built target AlgorithmsHeaders
Scanning dependencies of target BamTools
[ 4%] Building CXX object src/api/CMakeFiles/BamTools.dir/BamAlignment.cpp.o
In file included from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/cstring:71: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/cstring:71: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from /usr/local/include/c++/4.8.1/bits/stringfwd.h:40,
from /usr/local/include/c++/4.8.1/iosfwd:39,
from /usr/local/include/c++/4.8.1/ios:38,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/bits/memoryfwd.h:50: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/bits/memoryfwd.h:50: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from /usr/local/include/c++/4.8.1/iosfwd:39,
from /usr/local/include/c++/4.8.1/ios:38,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/bits/stringfwd.h:42: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/bits/stringfwd.h:42: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from /usr/local/include/c++/4.8.1/bits/postypes.h:40,
from /usr/local/include/c++/4.8.1/iosfwd:40,
from /usr/local/include/c++/4.8.1/ios:38,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/cwchar:64: error: ‘::mbstate_t’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:135: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/cwchar:135: error: expected constructor, destructor, or type conversion before ‘(’ token
/usr/local/include/c++/4.8.1/cwchar:248: error: ‘::wcstold’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:257: error: ‘::wcstoll’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:258: error: ‘::wcstoull’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:264: error: ‘::__gnu_cxx’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:265: error: ‘::__gnu_cxx’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:266: error: ‘::__gnu_cxx’ has not been declared
In file included from /usr/local/include/c++/4.8.1/iosfwd:40,
from /usr/local/include/c++/4.8.1/ios:38,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/bits/postypes.h:68: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/bits/postypes.h:68: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from /usr/local/include/c++/4.8.1/ios:39,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected declaration before end of line
make[2]: *** [src/api/CMakeFiles/BamTools.dir/BamAlignment.cpp.o] Error 1
make[1]: *** [src/api/CMakeFiles/BamTools.dir/all] Error 2
make: *** [all] Error 2
I am not sure these errors are caused by the source code of bamtools not compatible with the newer versions of GCC or what. I am not an expert in cmake. Any one can help here?
The text was updated successfully, but these errors were encountered:
CMake defaults to using the compiler at /usr/bin/c++. To select a different compiler, you'll want to set environment variables when calling CMake. Something like this should work:
Substitute in the path for the compiler you want to actually use. The CC variable specifies the C compiler, while the CXX variable specifies the C++ compiler.
Multi compiler does pose a big problem. This is not particular to bamtools. It is related to cmake. I had a situation when bamtools is made with compiler GCC 4.8. when I compile and link with GCC 5.2 I got linking errors:
-L/usr/local/lib/bamtools -lbamtools The LDFLAGS are set properly, and this used to work fine.
So the above posting is very useful to relieve this problem.
When I have multiple compilers, the make step fails.
It seems that cmake finds the compiler in /usr/bin
I configured my computer to have /usr/local/bin before /usr/bin in the PATH environment variable.
[~/Downloads/bamtools-master/build]$ cmake ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- 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
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zhouke/Downloads/bamtools-master/build
But the make process is using the newer version of gcc 4.8.1 and is having trouble.
[~/Downloads/bamtools-master/build]$ make
Scanning dependencies of target SharedHeaders
[ 1%] Exporting SharedHeaders
[ 1%] Built target SharedHeaders
Scanning dependencies of target APIHeaders
[ 2%] Exporting APIHeaders
[ 2%] Built target APIHeaders
Scanning dependencies of target AlgorithmsHeaders
[ 3%] Exporting AlgorithmsHeaders
[ 3%] Built target AlgorithmsHeaders
Scanning dependencies of target BamTools
[ 4%] Building CXX object src/api/CMakeFiles/BamTools.dir/BamAlignment.cpp.o
In file included from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/cstring:71: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/cstring:71: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from /usr/local/include/c++/4.8.1/bits/stringfwd.h:40,
from /usr/local/include/c++/4.8.1/iosfwd:39,
from /usr/local/include/c++/4.8.1/ios:38,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/bits/memoryfwd.h:50: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/bits/memoryfwd.h:50: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from /usr/local/include/c++/4.8.1/iosfwd:39,
from /usr/local/include/c++/4.8.1/ios:38,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/bits/stringfwd.h:42: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/bits/stringfwd.h:42: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from /usr/local/include/c++/4.8.1/bits/postypes.h:40,
from /usr/local/include/c++/4.8.1/iosfwd:40,
from /usr/local/include/c++/4.8.1/ios:38,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/cwchar:64: error: ‘::mbstate_t’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:135: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/cwchar:135: error: expected constructor, destructor, or type conversion before ‘(’ token
/usr/local/include/c++/4.8.1/cwchar:248: error: ‘::wcstold’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:257: error: ‘::wcstoll’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:258: error: ‘::wcstoull’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:264: error: ‘::__gnu_cxx’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:265: error: ‘::__gnu_cxx’ has not been declared
/usr/local/include/c++/4.8.1/cwchar:266: error: ‘::__gnu_cxx’ has not been declared
In file included from /usr/local/include/c++/4.8.1/iosfwd:40,
from /usr/local/include/c++/4.8.1/ios:38,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/bits/postypes.h:68: error: expected ‘{’ before ‘_GLIBCXX_VISIBILITY’
/usr/local/include/c++/4.8.1/bits/postypes.h:68: error: expected constructor, destructor, or type conversion before ‘(’ token
In file included from /usr/local/include/c++/4.8.1/ios:39,
from /usr/local/include/c++/4.8.1/istream:38,
from /usr/local/include/c++/4.8.1/fstream:38,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAux.h:15,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.h:14,
from /home/zhouke/Downloads/bamtools-master/src/api/BamAlignment.cpp:10:
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected ‘}’ before end of line
/usr/local/include/c++/4.8.1/exception:35: error: expected declaration before end of line
make[2]: *** [src/api/CMakeFiles/BamTools.dir/BamAlignment.cpp.o] Error 1
make[1]: *** [src/api/CMakeFiles/BamTools.dir/all] Error 2
make: *** [all] Error 2
I am not sure these errors are caused by the source code of bamtools not compatible with the newer versions of GCC or what. I am not an expert in cmake. Any one can help here?
The text was updated successfully, but these errors were encountered: