Closed geoffreygarrett closed 5 years ago
Update (Further attempt, no success): I attempted to manually define the paths to the boost_unittest_framework
, boost_log
, and tudat_environment_setup
in hopes that it was a problem linking to the libraries. I still received the same error regarding the _ZTVN5boost9unit_test15unit_test_log_tE
which is part of the Header <boost/test/unit_test_log.hpp>
(source: Boost.Test).
set(Boost_UNITTEST_LIBRARY /home/ggarrett/Repositories/WORK/tudatBundle/boost/stage/lib/libboost_unit_test_framework-mt.a)
set(Boost_LOG_LIBRARY /home/ggarrett/Repositories/WORK/tudatBundle/boost/stage/lib/libboost_log-mt.a)
set(Boost_LOGSETUP_LIBRARY /home/ggarrett/Repositories/WORK/tudatBundle/boost/stage/lib/libboost_log_setup-mt.a)
set(tudat_environment_setup /home/ggarrett/Repositories/WORK/tudatBundle/tudat/lib/libtudat_environment_setup.a)
message("CIAO ${Boost_LOG_LIBRARY}")
message("CIAO ${Boost_LOGSETUP_LIBRARY}")
message("CIAO ${Boost_UNITTEST_LIBRARY}")
message("CIAO ${Boost_SYSTEM_LIBRARY}")
link_libraries(
${Boost_LIBRARIES}
${Boost_LOG_LIBRARY}
${Boost_UNITTEST_LIBRARY}
${Boost_LOGSETUP_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${PYTHON_LIBRARIES}
${tudat_basic_mathematics}
${TUDAT_PROPAGATION_LIBRARIES}
${tudat_environment_setup}
# ${boost_numpy_eigen}
${LIBROOT}/libboost_numpy_eigen.so) # Deprecated but so convenient!
I do not understand why it is not correctly linking to the Boost.Test library, or why it is even required to compile a usable reference to the function createBodies
.
Reproduction of error:
Clone forked tudatBundle and build: Some changes will need to be made to the tudatBundle. I have made modifications on my fork of the repository below. Be sure to checkout the feature/tudatpy branch. Repository: https://github.com/ggarrett13/tudatBundle.git Branch: feature/tudatpy
Check 2/3 tests pass:
cd tudatpy && make test
Invoke python unittest framework for verbose output:
python3 -m unittest -v test/test_environment_setup.py
(Note: This may fail if missing a python dependency, as I have not included a setup.py file as of yet. If so, install manually with pip3).This issue occurs during the invocation of the
tudat::simulation_setup::createBodies()
function. Line 54-56 oftudatpy/tudatpy/simulation/environment/_environment.cpp
.Commenting out line 54-56 of
tudatpy/tudatpy/simulation/environment/_environment.cpp
and commenting out lines [2, 45, 46, 47] in test/test_environment_setup.py results in the following when running:make -j$(nproc) && python3 -m unittest -v test/test_environment_setup.py
in tudatBundle/build/tudatpy.Okay so at this point we know what is causing the error, but why, I do not know. Here are a few thoughts that I have from the work experience so far and from what I've been reading online.
1) The issue at hand is a failure to link the relevant libraries in boost to the target of _environment.cpp. The linking is done on lines 246 - 256 of the CMakelist.txt under tudatpy using the deprecated
link_libraries
command (This will be replaced later with target_link_libraries so as to only include the needed libraries per target).I had a similar linking issue with an undefined symbol with a name indicating it was from from
Boost_SYSTEM_LIBRARY
, including this in the linking resolved that issue. I therefore attempted to explicitly linkBoost_LOG_LIBRARY
andBoost_TEST_LIBRARY
based on the name of the undefined symbol:_ZTVN5boost9unit_test15unit_test_log_tE
. This did not work.2) https://www.boost.org/doc/libs/1_54_0/libs/log/doc/html/log/rationale/namespace_mangling.html
3) I attempted the following at the top of the _environment.cpp file which dealt with undefined reference errors that others encountered. (Changed nothing)
In conclusion I'll see if I can use some duct tape and get the library to the unittest linked somehow, but I'd appreciate a hand @DominicDirkx.