-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when building PaGMO #90
Comments
Hi Michael, For now, comment out the Pagmo includes in the top-level CMakeLists, and continue compiling. I'll get back to you on fixing this, Dominic |
Hi Dominic, I'm trying to build and run the main.cpp file in tudatExampleApplications/libraryExamples/PaGMOEx but I get a few thousands of 'undefined reference to ... boost ...' errors at Linking CXX executables .../pagmo/bin/main.exe I'm using BoostVersion 1.53.0. Thanks, Michael |
Hi Michael, How exactly did you change the linking order in the CMakeLists? Could you show a 'before' and 'after'? Another issues might be that your pagmo-boost is compiled differently from your tudat boost. Can you have CMake print the location of the boost libraries (in the pagmo cmake list) and check if it is the same as the Tudat one? Dominic |
Hi Dominic, In tudatExampleApplications/PaGMOEx/CMakeLists.txt I changed the following last 4 lines from:
into
and
For the location of the boost libraries in pagmo/CMakeLists.txt I got: optimizedC:/tudatBundle_mvdb/boost/stage/lib/libboost_system-mt.dlldebugC:/tudatBundle_mvdb/boost/stage/lib/libboost_system-mt.aoptimizedC:/tudatBundle_mvdb/boost/stage/lib/libboost_serialization-mt.dlldebugC:/tudatBundle_mvdb/boost/stage/lib/libboost_serialization-mt.aoptimizedC:/tudatBundle_mvdb/boost/stage/lib/libboost_thread-mt.dlldebugC:/tudatBundle_mvdb/boost/stage/lib/libboost_thread-mt.a For the locatio of the boost libraries in tudatExampleApplications/libraryExamples/PaGMOEx/CMakeLists.txt I got: C:/tudatBundle_mvdb/boost/stage/lib/libboost_thread-mt.aC:/tudatBundle_mvdb/boost/stage/lib/libboost_date_time-mt.aC:/tudatBundle_mvdb/boost/stage/lib/libboost_system-mt.aC:/tudatBundle_mvdb/boost/stage/lib/libboost_serialization-mt.aC:/tudatBundle_mvdb/boost/stage/lib/libboost_filesystem-mt.aC:/tudatBundle_mvdb/boost/stage/lib/libboost_regex-mt.a Thanks, Michael ` |
Hi Michael, I think the problem is that you are changing the wrong CMakeLists. Since the issue is in the linking of the .../pagmo/bin/main.exe executable, you need to change the link order of this executable in: This is the CMakeLists of pagmo itself, so tudatBundle/pagmo/CMakeLists.txt Way at the end of the file (line 397 for me) it says: TARGET_LINK_LIBRARIES(main ${MANDATORY_LIBRARIES} pagmo_static) Change it to TARGET_LINK_LIBRARIES(main pagmo_static ${MANDATORY_LIBRARIES}) And with any luck this should fix the issue |
I made the changes you proposed in tudatBundle/pagmo/CMakeLists.txt and also changed the link order in the tudatBundle/pagmo/examples/CMakeLists.txt and tudatBundle/pagmo/tests/CMakeLists.txt. I did a clean rebuild and ran CMake. Unfortunately it didn't solve the problem, I'm still getting 72k issues of which 1880 are errors of the kind 'undefined reference to ... boost ... '. Apparently the warning suppression didn't work either. I have one more question though. What is the best directory to put the main.cpp file of my personal pagmo optimization? Should I put in tudatBundle/Thesis or tudatBundle/tudatExampleApplications/libraryExamples/PaGMOEx? Thanks, Michael |
Hmmm, could you post some of the full errors in the boost linking? |
Here are some full errors that occur after
The last part of the compile output is:
Here is the entire compile output in case you need it: Thanks, Michael |
Hi Michael, It seems that all the linking errors are in the serialization library, which is not needed by Tudat, but is used by pagmo. Could you check if this library is in the the boost/stage/lib folder? If it is not, you will need to run CMake again, making sure that the code in add_boost.cmake is not commented out (I think we commented yours out at some point?). If you're not sure about this, just copy the add_boost.cmake (Tudat/External/CMake) from the Tudat repository into your files. Make sure to save the old one just to make sure Dominic |
Hi Dominic, After implementing your feedback and commenting out the applications of which the filenames are too long for Windows, it finally builds! Thank you for all your help! Michael |
Great! |
Hi Dominic, My problems seems to be similar. I get thousands of build errors whenever I try to build any of the applications in the tudatBundle/pagmo folder. (The applications 'my_pagmo_problems' and 'pagmo_static' do build). The errors all have some reference to the serialization library as far as I understand. See for the compile output: However, in my boost/stage/lib folder I do see the following folder: 'libboost_serialization-mt.a'. Furthermore nothing seems to be commented in the the code in add_boost.cmake. Any idea how to solve this? Jesper |
Hi Jesper, Did you try to apply the changes that seemed to work above for Michael. Changing the order of the pagmo link libraries may resolve the issue. If it doesn't, please attach the location of the boost libraries that are being used in the Pagmo CMakeLists, Dominic |
Hi Dominic, All changes combined, including swapping the Eigen folder discussed in #99 have eventually fixed all errors. Thanks for the help! Jesper |
Great! |
Hi Dominic, I've got similar problems. The application in the pagmo folder are working but when I try to build the examples in libraryExamples/PaGMOEx/ i get nearly 1000 errors which all seems to do with serialization. I already did the following in the PaGMOEx folder:
Boost libraries used by CMake inside the PaGMOEx folder: Boost libraries used by CMake inside the pagmo folder: The CMakeList file: CMakeLists.txt |
Can you try building the pagmo example? Not the Tudat one, but the main in the Pagmo folder. Does this go correctly? |
That one builts correctly. However, it does not run. |
The same holds for the examples in the pagmo folder, they do build but I can't run them because of missing dll files. |
After I did a 'Build->Clean All' in Qt Creator, I'm getting the following two errors when rebuilding the TudatBundle:
"Unable to locate a c++11 compatible compiler pagmo/CMakeLists.txt:35 (INCLUDE)
C:\tudatBundle_mvdb\pagmo\cmake_scripts\set_compiler_flags.cmake"
and
"[cmake_check_build_system] Error 1"
The error is present even when option(USE_PAGMO ... ) is set to 'OFF' in TudatBundle\CMakeLists.txt.
I heard that it can be caused by a difference in the boost library version between tudat and pagmo. Is there an easy fix to this?
Thanks,
Michael
The text was updated successfully, but these errors were encountered: