I am trying to compile some software that contains a compile.sh shell script. When I run the script, the software fails to compile due to what it reports as a broken C compiler.
I have tried reinstalling C compilers, both within and outside of conda, to no avail.
Below, please find the output of running the compile shell script
(base) userA#server:~/SPAdes-3.13.0-dev$ ./spades_compile.sh
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc
-- Check for working C compiler: /home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -- broken
CMake Error at /home/userA/anaconda3/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_708f4/fast
/usr/bin/make -f CMakeFiles/cmTC_708f4.dir/build.make CMakeFiles/cmTC_708f4.dir/build
make[1]: Entering directory '/home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_708f4.dir/testCCompiler.c.o
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -o CMakeFiles/cmTC_708f4.dir/testCCompiler.c.o -c /home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_708f4
/home/userA/anaconda3/bin/cmake -E cmake_link_script CMakeFiles/cmTC_708f4.dir/link.txt --verbose=1
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -rdynamic CMakeFiles/cmTC_708f4.dir/testCCompiler.c.o -o cmTC_708f4
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find crtbeginS.o: No such file or directory
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find -lgcc
/home/userA/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_708f4.dir/build.make:86: recipe for target 'cmTC_708f4' failed
make[1]: *** [cmTC_708f4] Error 1
make[1]: Leaving directory '/home/userA/SPAdes-3.13.0-dev/build_spades/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_708f4/fast' failed
make: *** [cmTC_708f4/fast] Error 2
CMake will not be able to correctly generate this project.
Expected result: properly compiled software
Actual result: report of a broken C compiler
Related
I'm required to install the Dune library for my "Partial Differential Equation" lecture and am stuck. I'm on a MacBook and we received an installation script (for Linux), but I always get an error that my Gfortran and g++ compiler is not compatible.
I've researched similar errors and some could be fixed by deleting the CMake cache, but I'm not sure and don't want to screw up the folder structure.
The error code looks like this:
matthias#MacBookPro ~/Documents/studium_matthias/semester_7/num_2/dune$ ./buildmodules.sh
build common
----- using default flags $CMAKE_FLAGS from /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release.opts -----
--- going to build dune-common ---
--- calling all for dune-common ---
--- calling vcsetup for dune-common ---
--- calling configure for dune-common ---
cmake -DDUNE_BUILD_DIRECTORY_ROOT_PATH='/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build' -DCMAKE_C_COMPILER='/usr/bin/gcc' -DCMAKE_CXX_COMPILER='/usr/bin/g++' -DCMAKE_Fortran_COMPILER='/usr/local/bin/gfortran' -DCMAKE_CXX_FLAGS_RELEASE='-O3 -DNDEBUG -g0 -funroll-loops -ftemplate-depth=5120 -march=native -Wa,-q' -DHDF5_ROOT=/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/external/hdf5 -DFFTW3_ROOT_DIR=/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/external/fftw3 -DCMAKE_BUILD_TYPE=Release -DDUNE_SYMLINK_TO_SOURCE_TREE=1 "/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/dune-common"
CMake Error at /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface.cmake:383 (message):
The Fortran compiler:
/usr/local/bin/gfortran
and the CXX compiler:
/usr/bin/g++
failed to compile a simple test project using both languages. The output
was:
Change Dir: /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX
Run Build Command(s):/usr/bin/make VerifyFortranC && /usr/local/Cellar/cmake/3.15.5/bin/cmake -S/usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify -B/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX --check-build-system CMakeFiles/Makefile.cmake 0
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/Makefile2 VerifyFortranC
/usr/local/Cellar/cmake/3.15.5/bin/cmake -S/usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify -B/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/Cellar/cmake/3.15.5/bin/cmake -E cmake_progress_start /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX/CMakeFiles 6
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/Makefile2 CMakeFiles/VerifyFortranC.dir/all
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/VerifyFortran.dir/build.make CMakeFiles/VerifyFortran.dir/depend
cd /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX && /usr/local/Cellar/cmake/3.15.5/bin/cmake -E cmake_depends "Unix Makefiles" /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX/CMakeFiles/VerifyFortran.dir/DependInfo.cmake
Scanning dependencies of target VerifyFortran
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/VerifyFortran.dir/build.make CMakeFiles/VerifyFortran.dir/build
[ 16%] Building Fortran object CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
/usr/local/bin/gfortran -DVERIFY_CXX -I/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX -O3 -DNDEBUG -O3 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -c /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify/VerifyFortran.f -o CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
[ 33%] Linking Fortran static library libVerifyFortran.a
/usr/local/Cellar/cmake/3.15.5/bin/cmake -P CMakeFiles/VerifyFortran.dir/cmake_clean_target.cmake
/usr/local/Cellar/cmake/3.15.5/bin/cmake -E cmake_link_script CMakeFiles/VerifyFortran.dir/link.txt --verbose=1
/usr/bin/ar qc libVerifyFortran.a CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
/usr/bin/ranlib libVerifyFortran.a
[ 33%] Built target VerifyFortran
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/VerifyFortranC.dir/build.make CMakeFiles/VerifyFortranC.dir/depend
cd /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX && /usr/local/Cellar/cmake/3.15.5/bin/cmake -E cmake_depends "Unix Makefiles" /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX /Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX/CMakeFiles/VerifyFortranC.dir/DependInfo.cmake
Scanning dependencies of target VerifyFortranC
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/VerifyFortranC.dir/build.make CMakeFiles/VerifyFortranC.dir/build
[ 50%] Building C object CMakeFiles/VerifyFortranC.dir/main.c.o
/usr/bin/gcc -DVERIFY_CXX -I/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/VerifyFortranC.dir/main.c.o -c /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify/main.c
[ 66%] Building C object CMakeFiles/VerifyFortranC.dir/VerifyC.c.o
/usr/bin/gcc -DVERIFY_CXX -I/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/VerifyFortranC.dir/VerifyC.c.o -c /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify/VerifyC.c
[ 83%] Building CXX object CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o
/usr/bin/g++ -DVERIFY_CXX -I/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/FortranCInterface/VerifyCXX -std=c++17 -O3 -DNDEBUG -g0 -funroll-loops -ftemplate-depth=5120 -march=native -Wa,-q -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o -c /usr/local/Cellar/cmake/3.15.5/share/cmake/Modules/FortranCInterface/Verify/VerifyCXX.cxx
clang: error: unsupported argument '-q' to option 'Wa,'
make[3]: *** [CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o] Error 1
make[2]: *** [CMakeFiles/VerifyFortranC.dir/all] Error 2
make[1]: *** [CMakeFiles/VerifyFortranC.dir/rule] Error 2
make: *** [VerifyFortranC] Error 2
Call Stack (most recent call first):
cmake/modules/DuneMacros.cmake:710 (FortranCInterface_VERIFY)
CMakeLists.txt:17 (dune_project)
-- Configuring incomplete, errors occurred!
See also "/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/CMakeOutput.log".
See also "/Users/matthias/Documents/studium_matthias/semester_7/num_2/dune/release-build/dune-common/CMakeFiles/CMakeError.log".
--- Failed to build dune-common ---
Terminating dunecontrol due to previous errors!
How can I approach this?
As #squareskittles pointed out in the comments, the error arised from the unsupported argument -q to Wa,. This tells the compiler (gcc!) to pass the option -q to the assembler.
This option is not supported by clang. which gcc told me gcc was installed and located at /usr/bin/gcc but further inspection showed that it was just a symlink to clang - even though I had gcc installed via homebrew (located at /usr/local/bin/gcc-9).
In the installation file I was able to change the path of used compiler to the gcc installation (g++ was linked to clang, and I replaced it as well). From that point on the -q argument to Wa was valid the installation process went without further errors.
it will fine install dune core modules using homebrew package manager for your system. From now is available 2.7.1. https://github.com/dune-copasi/homebrew-tap
I am trying to install OpenMP enabled xgboost on my mac. I installed gcc with no problem:
brew install gcc --without-multilib
then cloned git repository:
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/config.mk ./config.mk
but I get an error when I do
make -j4
Here is the error I get. I'd appreciate if you can help fixing this problem:
c++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -o xgboost build/cli_main.o build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm -fopenmp
c++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -shared -o lib/libxgboost.so build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm -fopenmp
clangclang: : warningwarning: : argument unused during compilation: '-pthread'argument unused during compilation: '-pthread'
ld: library not found for -lgomp
ld: library not found for -lgomp
clang: error: clanglinker command failed with exit code 1 (use -v to see invocation):
error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libxgboost.so] Error 1
make: *** Waiting for unfinished jobs....
make: *** [xgboost] Error 1
I have the same issue and solved it by:
brew install clang-omp
export CC=clang-omp
export CXX=clang-omp++
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/config.mk ./config.mk; make -j4
cd python-package
sudo python setup.py install
If you used pip to install xgboost before, then delete the previous installed xgboost from your project. Then use
pip install xgboost
to install it again.
A new versions of OSX has a Clang as a default c\c++ compiler. Therefore your c++ command refers to clang++.
You should define a CC\CXX environmental variables for your make command like this CC=gcc CXX=g++ make -j
Also you can build an OpenMP for clang OpenMPrt and customise your shell environment (I didn't try this by own)
(I have no mac at this moment to check this solution; just linux)
I am trying to compile luabind which I got from this link. After I do
mkdir build
cmake ..
make VERBOSE=1
"cmake .." produces these lines,
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-4.7
-- Check for working CXX compiler: /usr/bin/g++-4.7 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.53.0
-- Found Lua52: /usr/lib/i386-linux-gnu/liblua5.2.so;/usr/lib/i386-linux-gnu/libm.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mwh/Desktop/Downloads/luabind-master/build
"make VERBOSE=1" produces following errors.
/usr/bin/cmake -H/home/mwh/Desktop/Downloads/luabind-master -B/home/mwh/Desktop/Downloads/luabind-master/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/mwh/Desktop/Downloads/luabind-master/build/CMakeFiles /home/mwh/Desktop/Downloads/luabind-master/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/mwh/Desktop/Downloads/luabind-master/build'
make -f src/CMakeFiles/luabind.dir/build.make src/CMakeFiles/luabind.dir/depend
make[2]: Entering directory `/home/mwh/Desktop/Downloads/luabind-master/build'
cd /home/mwh/Desktop/Downloads/luabind-master/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/mwh/Desktop/Downloads/luabind-master /home/mwh/Desktop/Downloads/luabind-master/src /home/mwh/Desktop/Downloads/luabind-master/build /home/mwh/Desktop/Downloads/luabind-master/build/src /home/mwh/Desktop/Downloads/luabind-master/build/src/CMakeFiles/luabind.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/mwh/Desktop/Downloads/luabind-master/build'
make -f src/CMakeFiles/luabind.dir/build.make src/CMakeFiles/luabind.dir/build
make[2]: Entering directory `/home/mwh/Desktop/Downloads/luabind-master/build'
/usr/bin/cmake -E cmake_progress_report /home/mwh/Desktop/Downloads/luabind-master/build/CMakeFiles 2
[ 1%] Building CXX object src/CMakeFiles/luabind.dir/class.cpp.o
cd /home/mwh/Desktop/Downloads/luabind-master/build/src && /usr/bin/g++-4.7 -I/usr/local/include -I/usr/include/lua5.2 -I/home/mwh/Desktop/Downloads/luabind-master -o CMakeFiles/luabind.dir/class.cpp.o -c /home/mwh/Desktop/Downloads/luabind-master/src/class.cpp
In file included from /home/mwh/Desktop/Downloads/luabind-master/luabind/object.hpp:38:0,
from /home/mwh/Desktop/Downloads/luabind-master/luabind/scope.hpp:28,
from /home/mwh/Desktop/Downloads/luabind-master/luabind/class.hpp:92,
from /home/mwh/Desktop/Downloads/luabind-master/src/class.cpp:30:
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp: In member function ‘T luabind::detail::enum_converter::apply(lua_State*, luabind::detail::by_value<T>, int)’:
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:498:21: error: ‘underlying_type’ in namespace ‘std’ does not name a type
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:47: error: expected type-specifier before ‘integral_t’
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:47: error: expected ‘>’ before ‘integral_t’
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:47: error: expected ‘(’ before ‘integral_t’
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:47: error: ‘integral_t’ was not declared in this scope
/home/mwh/Desktop/Downloads/luabind-master/luabind/detail/policy.hpp:499:83: error: expected ‘)’ before ‘;’ token
make[2]: *** [src/CMakeFiles/luabind.dir/class.cpp.o] Error 1
make[2]: Leaving directory `/home/mwh/Desktop/Downloads/luabind-master/build'
make[1]: *** [src/CMakeFiles/luabind.dir/all] Error 2
make[1]: Leaving directory `/home/mwh/Desktop/Downloads/luabind-master/build'
make: *** [all] Error 2
What shall I do to correct this problem? I am using gcc 4.7.3, boost 1.53, Lua 5.2 in Ubuntu 12.04. Please help.
I just checked out the project at revision 05c84a034e and built it on Mac OS X. Here's what CMake told me at configure time:
-- The CXX compiler identification is GNU 4.7.3
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /opt/local/bin/g++ -- works
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.53.0
-- Found Lua52: /opt/local/lib/liblua.dylib;
So I have GCC 4.7.3, Boost 1.53, and Lua 5.2. I see you have GCC 4.7.3 also, but what about Boost and Lua?
Edit: Here's my compilation line from make VERBOSE=1 for the first file:
g++ -Wall -std=c++11 -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wno-deprecated-declarations -o CMakeFiles/luabind.dir/class.cpp.o -c class.cpp
You on the other hand show this:
g++-4.7 -o CMakeFiles/luabind.dir/class.cpp.o -c class.cpp
So the question is, where did all your compiler flags go? The top-level CMakeLists.txt should contain this:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
And a bunch more. Since you aren't getting those flags set, you need to figure out why. You might try adding some message("I am here") debug statements in your CMakeLists.txt and running cmake again from scratch to see if the expected parts of the configuration are being executed at all. The key thing here is that your compilation line lacks -std=c++11--that's why you get the error you have.
I am having trouble installing pyipopt on ubuntu 12.04. During linking, I receive the error:
/usr/bin/ld: cannot find -lcoinhsl
Even though I know that this library is installed and the .so and .la files are available in /home/mostafa/MyBuilds/CoinIpopt/build/lib/
does anyone have a solution for this?
below is the complete return of running setup.py build:
root#ubuntu:~/MyBuilds/pyipopt# sudo python setup.py build
running build
running build_ext
building 'pyipopt' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/callback.c -o build/temp.linux-x86_64-2.7/src/callback.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/pyipopt.c -o build/temp.linux-x86_64-2.7/src/pyipopt.o
src/pyipopt.c: In function ‘set_intermediate_callback’:
src/pyipopt.c:452:15: warning: variable ‘myowndata’ set but not used [-Wunused-but-set-variable]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relrobuild/temp.linux-x86_64-2.7/src/callback.o build/temp.linux-x86_64-2.7/src/pyipopt.o -L/home/mostafa/MyBuilds/CoinIpopt/build/lib/ -lipopt -lblas -lcoinhsl -lcoinmetis -llapack -ldl -lm -o build/lib.linux-x86_64-2.7/pyipopt.so -Wl,--rpath -Wl,/home/mostafa/MyBuilds/CoinIpopt/build/lib/
/usr/bin/ld: cannot find -lcoinhsl
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
-Ldir
Add directory dir to the list of directories to be searched for -l.
You may install your coinhsl library in one of your standard libraries directories and run 'ldconfig` before doing your ppyipopt install
I had a similar problem with another library and the reason why it didn't found it, was that I didn't run the make install (after running ./configure and make) for that library. The make install may require root privileges (in this case use: sudo make install). After running the make install you should have the so files in the correct folder, i.e. here /usr/local/lib and not in the folder mentioned by you.
you can add the Path to coinhsl lib to LD_LIBRARY_PATH variable. May be that will help.
export LD_LIBRARY_PATH=/xx/yy/zz:$LD_LIBRARY_PATH
where /xx/yy/zz represent the path to coinhsl lib.
I'm trying to install gcc 4.6.2 with ppl and cloog in 64 bit ubuntu 10.10. I get the following error when I do make.
make[3]: Entering directory `/home/praveen/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc'
/home/praveen/gcc-4.6.2/host-x86_64-unknown-linux-gnu/prev-gcc/xgcc -B/home/praveen/gcc-4.6.2/host-x86_64-unknown-linux-gnu/prev-gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -g -O2 -gtoggle -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -o cc1 c-lang.o c-family/stub-objc.o attribs.o c-errors.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-objc-common.o c-parser.o tree-mudflap.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o i386-c.o \
cc1-checksum.o main.o libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lcloog -lppl_c -lppl -lpwl -lgmpxx -lmpc -lmpfr -lgmp -rdynamic -ldl -L../zlib -lz
libbackend.a(graphite-ppl.o): In function `ppl_powerset_is_empty':
graphite-ppl.c:(.text+0xd5d): undefined reference to `ppl_new_PIP_Problem_from_constraints'
graphite-ppl.c:(.text+0xd66): undefined reference to `ppl_PIP_Problem_is_satisfiable'
graphite-ppl.c:(.text+0xd71): undefined reference to `ppl_delete_PIP_Problem'
collect2: ld returned 1 exit status
make[3]: *** [cc1] Error 1
make[3]: Leaving directory `/home/praveen/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/home/praveen/gcc-4.6.2'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/home/praveen/gcc-4.6.2'
make: *** [all] Error 2
Can some one help me out on this ?
I faced the same problem a while ago on my gentoo installation. The workarround was to build gcc without graphite option then to rebuild ppl and cloog-ppl libraries with a new version of gcc. Only after that gcc was successfully built with graphite.
The problem, I believe, is that the ppl library libppl_c.so.4 is reported by make to be non-existent during the linking process -- even if the library has been installed to the standard /usr/local/lib directory successfully. Try reconfiguring with the flag --with-ppl-lib. I also included the flag --with-ppl-include and the corresponding cloog flags too (just to pre-empt any possible corresponding problems with cloog) because I didn't want to have to keep recompiling to discover exactly which flags I needed, so I played it cautiously and included all of these; maybe you also need them too, but probably not. Whilst you should be able to just use the flag --with-ppl, that will not work.
# I installed ppl and cloog to the standard subdirectories of /usr/local
# but you can amend the flag inputs as necessary
tar xjf gcc-x.tar.bz2
mkdir build && cd build
../gcc-x/configure --with-ppl-lib=/usr/local/lib \
--with-ppl-include=/usr/local/include \
--with-cloog-lib=/usr/local/lib \
--with-cloog-include=/usr/local/include
Again, the issue is probably that the non-existence of the --with-ppl-lib flag is setting some internal configure variable incorrectly rather than there being a general linking issue with the library.