You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Ubuntu 20.04, if boost is installed via apt, but we set USE_SYSTEM_BOOST=OFF, CMake (in dependent projects such as ISMRMD) finds the system boost anyway. This is despite us passing BOOST_ROOT etc
I think what's going on is that Ubuntu 20.04 uses Boost 1.71.0 which comes with BoostConfig.cmake. (We currently build Boost 1.65.0 which doesn't install BoostConfig.cmake). Presumably FindBoost.cmake tries to find a "config" version first before even looking at BOOST_ROOT.
The result is that some compilations could use our installed boost include files, while the linking will happen against the system version. This leads to linking problems like this
/usr/bin/ld: CMakeFiles/test_ismrmrd.dir/test_acquisitions.cpp.o: in function `__static_initialization_and_destruction_0(int, int) [clone .constprop.141]':
test_acquisitions.cpp:(.text.startup+0xa1): undefined reference to `boost::unit_test::ut_detail::auto_test_unit_registrar::auto_test_unit_registrar(boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long, boost::unit_test::decorator::collector&)'
however, CMake allows another variable BOOSTROOT for the same purpose, as well as Boost_DIR to find a "config" version. We should therefore set those as well.
The text was updated successfully, but these errors were encountered:
- when USE_SYSTEM_BOOST=OFF, set Boost_NO_SYSTEM_PATHS=ON to increase our chances
of finding our own version
- when USE_SYSTEM_BOOST=OFF, pass BOOSTROOT and Boost_DIR to projects (when set)
FixesSyneRBI#627
- when USE_SYSTEM_BOOST=OFF, set Boost_NO_SYSTEM_PATHS=ON to increase our chances
of finding our own version
- when USE_SYSTEM_BOOST=OFF, pass BOOSTROOT and Boost_DIR to projects (when set)
FixesSyneRBI#627
- when USE_SYSTEM_BOOST=OFF, set Boost_NO_SYSTEM_PATHS=ON to increase our chances
of finding our own version
- when USE_SYSTEM_BOOST=OFF, pass BOOSTROOT and Boost_DIR to projects (when set)
Fixes#627
USE_SYSTEM_BOOST=OFF
On Ubuntu 20.04, if boost is installed via
apt
, but we setUSE_SYSTEM_BOOST=OFF
, CMake (in dependent projects such as ISMRMD) finds the system boost anyway. This is despite us passingBOOST_ROOT
etcSIRF-SuperBuild/SuperBuild/External_Boost.cmake
Lines 80 to 84 in 4483562
I think what's going on is that Ubuntu 20.04 uses Boost 1.71.0 which comes with
BoostConfig.cmake
. (We currently build Boost 1.65.0 which doesn't installBoostConfig.cmake
). PresumablyFindBoost.cmake
tries to find a "config" version first before even looking atBOOST_ROOT
.The result is that some compilations could use our installed
boost
include files, while the linking will happen against the system version. This leads to linking problems like thisor run-time crashes.
This was first observed by @NicoleJurjew.
USE_SYSTEM_BOOST=ON
In this case we want to pass the location on, and do
SIRF-SuperBuild/SuperBuild/External_Boost.cmake
Lines 94 to 96 in 4483562
however, CMake allows another variable
BOOSTROOT
for the same purpose, as well asBoost_DIR
to find a "config" version. We should therefore set those as well.The text was updated successfully, but these errors were encountered: