If Boost is specified with a relative directory in the boost_inc_dir option, SCons adjusts the include path to be relative to the build and src directories when writing command lines for compiling. For example:
cl /Fobuild\src\base\AnyMap.obj /c src\base\AnyMap.cpp /TP /EHsc /std:c++17 /utf-8 /MD /nologo /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /O2 /Zi /Fdbuild\src\base\AnyMap.obj.pdb /W3 /DNDEBUG /Iinclude\cantera\ext /Iinclude /Ibuild\src /Ibuild\src\boost.1.85.0\lib\native\include /Isrc\boost.1.85.0\lib\native\include
AnyMap.cpp
C:\Users\Quickemu\Documents\cantera\src\base\application.h(12): fatal error C1083: Cannot open include file: 'boost/algorithm/string/join.hpp': No such file or directory
scons: *** [build\src\base\AnyMap.obj] Error 2
Note the /Ibuild\src\boost.1.85.0\lib\native\include. In cantera.conf, I set boost_inc_dir = 'boost.1.85.0/lib/native/include' and SCons added the build\src prefix. This seems to only happen on Windows, Linux seems to use a relative path to the cantera.conf file, as expected.
fixes the issue and doesn't seem to break anything on Linux. This change should also be made to other include and library config options for consistency.
I think a better solution here might be to use the SCons Dir() object and prepend a # to the string if it isn't absolute. That way, SCons will interpret it as relative to the source root.
Problem description
If Boost is specified with a relative directory in the
boost_inc_dir
option, SCons adjusts the include path to be relative to thebuild
andsrc
directories when writing command lines for compiling. For example:Note the
/Ibuild\src\boost.1.85.0\lib\native\include
. Incantera.conf
, I setboost_inc_dir = 'boost.1.85.0/lib/native/include'
and SCons added thebuild\src
prefix. This seems to only happen on Windows, Linux seems to use a relative path to thecantera.conf
file, as expected.Changing
to
fixes the issue and doesn't seem to break anything on Linux. This change should also be made to other include and library config options for consistency.