-
Notifications
You must be signed in to change notification settings - Fork 87
Linking issue with Boost #174
Comments
I would need more info to help. Its seems in your system the serialization library from boost is not found by the linker. It may be related to this: If not, I need to know the output from your cmake, your system, etc. etc. |
Hi, I realized that if I changed the ccmake options to not build main, and build pyGMO only, I faced no issues during installation.
On Running Make:
In conclusion, the instructions work when you are not building main, but fail if you also want to build main. Thanks Akshay |
Did you also invert the order of the linked libraries when building main? It seems not. And if you build PyGMO you need to do it there too .... |
This is what I did for the CMakeList.txt for pagmo:
For The CMakeLists.txt within PyGMO:
I still get the same error:
Is there anything I am missing? |
Try to build only main.cpp and swap the order of linking. Does this work? |
Hi Dario,
Then I ran the following:
This results in:
This is the only change and corresponding error I get while compiling pagmo_static I do not know what else to change, or why this is happening. Do I need to change anything else? I am running this on a ubuntu 14.04 machine with boost 1.61 and gcc 4.8.4. |
can you run make verbose=5 or make -n and post the output |
Hi Dario, Here is the pastebin for both of those commands: the make verbose=5 seemed to do nothing different. |
Maybe this may be more useful: usr/bin/c++ -Wall -Wno-deprecated -Wextra -Wnoexcept -Wdisabled-optimization -ffast-math -std=c++11 -pthread -DBOOST_THREAD_USE_DLL -DBOOST_SERIALIZATION_DYN_LINK=1 -O3 -DNDEBUG CMakeFiles/main.dir/main.cpp.o -o main -rdynamic |
I am not sure what is happening in your system. Clearly somehow the serialization library is not linked in correctly when building main.cpp. I am trying to reproduce your problem but it seems I cannot, so I do not really know how to help much. Did you try to do everything from scratch? Like clean the build directory, run ccmake ../ select only build main and make? Another thing to try is to manually run the g++ command swapping the library order at the end .... |
Hi Dario, yes, I did everything from scratch. But it still did not work. In any case, I will continue looking into this myself, and see if I can fix it. If I do fix it, I will let you know how I did so. Sincerely, |
fyi this is the output of our CI system https://travis-ci.org/esa/pagmo pagmo build also in our osx machine and archlinux. Let me know |
I haven't been following the project for a long time (disclaimer), but I might have something worthwhile: I've previously had trouble with building PaGMO and friends with the Boost libraries installed with boost.org's source install scripts. That trouble, as I remember, manifests as linking difficulties with Boost (after flipping the link order in PaGMO+ as required). Unfortunately, I do not know why that happens. CMake appears happy; I'm not very familiar with make and the linking after that. I've found that the sure-fire way to install PaGMO+ on Ubuntu 14.04 without issues is to rely on apt-get to install Boost, instead of the manual source installer from boost.org. If I recall, the catch-all package is libboost-all-dev. The packaged Boost might be an older version, though. I don't know why the package installation tends to work while the source installation fails. But hopefully that can at least solve the build issue. |
I got it working with OSX in a different machine. As long as I have one instance, I am fine. I will try the boost installation again if I really need it. Thanks for all the tips. Sincerely, |
Fixes esa#174. The old link order resulted in a long series of unresolved symbol errors. Since the linker looks for unresolved symbols from left to right, we link the static library before the shared ones. Tested on docker images ubuntu:16.04 and base/archlinux:latest
Fixes esa#174. The old link order resulted in a long series of unresolved symbol errors on some platforms. Since the linker looks for unresolved symbols from left to right, we link the static library before the shared ones. Tested on the following docker images ubuntu:16.04, base/archlinux:latest, fedora:latest.
Hi all, |
You can issue a pull request. If it builds on our CI system I will also give it a try |
Can we not do away with this |
Hi,
When trying to compile the source code, I get the following errors:
I tried reinstalling boost to the latest version, and even that did not seem to work.
I performed the default:
.```
/bootstrap.sh
./b2
sudo ./b2 install
The text was updated successfully, but these errors were encountered: