GridOPTICS / GridPACK

https://www.gridpack.org/
47 stars 22 forks source link

install_gridpack.sh: cannot find -lBoost::mpi #201

Closed wperkins closed 4 months ago

wperkins commented 9 months ago

When using the install_gridpack.sh script, these errors occur on various platforms when building the Python interface:

/usr/bin/ld: cannot find -lBoost::mpi: No such file or directory
/usr/bin/ld: cannot find -lBoost::serialization: No such file or directory
/usr/bin/ld: cannot find -lBoost::random: No such file or directory
/usr/bin/ld: cannot find -lBoost::filesystem: No such file or directory
/usr/bin/ld: cannot find -lBoost::system: No such file or directory
wperkins commented 9 months ago

This is because the Python interface configuration includes GridPACK.cmake. The lines that cause the error are here. This is because modern CMake versions by default import Boost as a sub-project or something instead of actually looking for the library files (the old way of doing it).

In order to avoid this, GridPACK needs to be configured with this

-D Boost_NO_BOOST_CMAKE:BOOL=TRUE

and the actual Boost library files will be propagated to GridPACK.cmake and to the Python module configuration.

wperkins commented 9 months ago

install_gridpack.sh should also configure GridPACK with this option

-D Boost_NO_SYSTEM_PATHS:BOOL=TRUE

because, by default, CMake will find a Boost system package before a custom Boost installation.