Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Problem linking with boost libraries #68

Closed
cauthu opened this issue Jun 9, 2014 · 2 comments
Closed

Problem linking with boost libraries #68

cauthu opened this issue Jun 9, 2014 · 2 comments

Comments

@cauthu
Copy link

cauthu commented Jun 9, 2014

I have the following problem when running make (in build directory, according http://esa.github.io/pygmo/install.html without any of the optional libraries like GSL, etc.)

Linking CXX executable main
/usr/bin/cmake -E cmake_link_script CMakeFiles/main.dir/link.txt --verbose=1
/usr/bin/c++    -fmessage-length=0 -Wnon-virtual-dtor -Wno-deprecated -Wno-ignored-qualifiers -fno-strict-aliasing -Wall -Wextra -Wnoexcept -Wdisabled-optimization -std=c++0x -std=c++11 -pthread -DBOOST_THREAD_USE_DLL -DBOOST_SERIALIZATION_DYN_LINK=1 -O3 -DNDEBUG    CMakeFiles/main.dir/main.o  -o main -rdynamic -lm -lboost_system -lboost_thread -lboost_serialization -lpthread src/libpagmo.a 
src/libpagmo.a(archipelago.o): In function `pagmo::archipelago::sync_island_start() const':
archipelago.cpp:(.text+0x1d51): undefined reference to `boost::detail::get_current_thread_data()'
archipelago.cpp:(.text+0x1e0c): undefined reference to `boost::this_thread::interruption_point()'
.
.
.

But it will work fine if I edit ./CMakeFiles/main.dir/link.txt to move the the boost libraries (e.g., -lboost_system) at the end of the line, after everything else.

@pstjohn
Copy link

pstjohn commented Jul 9, 2014

Got this same issue, editing link.txt allowed installation to proceed.
Not a great solution if you're trying to build the example or test directories, as they each have their own link.txt file.

@darioizzo
Copy link
Member

This is a Ubuntu specific problem. Switching the libraries order breaks all other distros (gentoo, archlinux, fedora). Not sure what the solution is here. I will close the ticket for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants