CONFIG: adjust boost toolset for intel compiler (#62)

- improve handling of different gcc/clang versions

- support -toolset=none to bypass all internal logic and let boost do
  everything.
This commit is contained in:
Mark Olesen
2021-12-09 17:39:20 +01:00
parent 0d0f439dde
commit 1054dd83cf

View File

@ -130,6 +130,7 @@ options:
-no-lib Configure CGAL for headers-only mode (default OpenFOAM >= 2006) -no-lib Configure CGAL for headers-only mode (default OpenFOAM >= 2006)
-with-lib Configure CGAL with library -with-lib Configure CGAL with library
-toolset=NAME Use named toolset in bootstrap -toolset=NAME Use named toolset in bootstrap
(use 'none' to let boost determine everything).
-system Use system versions for boost/gmp/mpfr -system Use system versions for boost/gmp/mpfr
-list List available unpacked source versions -list List available unpacked source versions
-help Display usage help -help Display usage help
@ -322,44 +323,69 @@ else
# Configuration options: # Configuration options:
unset buildOpt unset buildOpt
if [ "$optToolset" = none ]
then
# Let boost determine everything
unset optToolset
elif [ -n "$optToolset" ]
then
# Assume same toolset for bootstrap and build
buildOpt="toolset=$optToolset"
else
# No toolset specified, attempt some guesses
c_compiler="$(whichCC)"
# Compiler-specific adjustments # Compiler-specific adjustments
case "$WM_COMPILER" in case "$WM_COMPILER" in
(Arm*) (Arm*)
# Toolset for bootstrap optToolset=gcc # For boostrap
optToolset="gcc"
echo "using clang : arm : $(whichCC) ;" > user-config.jam # For build
echo "using clang : arm : ${c_compiler} ;" > user-config.jam
echo "using mpi ;" >> user-config.jam echo "using mpi ;" >> user-config.jam
# Toolset for build
buildOpt="--user-config=user-config.jam toolset=clang" buildOpt="--user-config=user-config.jam toolset=clang"
;; ;;
(Mingw*) (Mingw*)
# Toolset for bootstrap optToolset=gcc # For boostrap
optToolset="gcc"
echo "using gcc : mingw : $(whichCC) ;" > user-config.jam # For build
echo "using gcc : mingw : ${c_compiler} ;" > user-config.jam
# Toolset for build
buildOpt="--user-config=user-config.jam toolset=gcc" buildOpt="--user-config=user-config.jam toolset=gcc"
buildOpt="$buildOpt target-os=windows release" buildOpt="$buildOpt target-os=windows release"
;; ;;
(*) (*)
# Toolset for bootstrap and build # For gcc-8, clang-9 etc.
if [ -z "$optToolset" ]
then case "${c_compiler}" in
optToolset="$(whichCC)" (clang*)
# Base names for gcc-8, clang-9 etc. optToolset=clang # For boostrap
case "$optToolset" in
(clang*) optToolset=clang;; # For build
(gcc*) optToolset=gcc;; echo "using clang : : ${c_compiler} ;" > user-config.jam
esac buildOpt="--user-config=user-config.jam toolset=clang"
fi ;;
buildOpt="toolset=$optToolset" (gcc* | g++*)
optToolset=gcc # For boostrap
# For build
echo "using gcc : : ${c_compiler} ;" > user-config.jam
buildOpt="--user-config=user-config.jam toolset=gcc"
;;
(ic[cx]* | icp[cx]*) # intel
optToolset=gcc # For boostrap
# For build
echo "using intel : : ${c_compiler} ;" > user-config.jam
buildOpt="--user-config=user-config.jam toolset=intel"
;; ;;
esac esac
;;
esac
fi
# End of configuration options # End of configuration options
# ---------------------------- # ----------------------------
@ -371,7 +397,7 @@ else
--libdir="$boostLib" \ --libdir="$boostLib" \
--with-libraries=thread \ --with-libraries=thread \
--with-libraries=system \ --with-libraries=system \
--with-toolset="$optToolset" \ ${optToolset:+--with-toolset="$optToolset"} \
&& ./b2 $buildOpt -j $WM_NCOMPPROCS install \ && ./b2 $buildOpt -j $WM_NCOMPPROCS install \
&& echo "Built: $BOOST_PACKAGE" && echo "Built: $BOOST_PACKAGE"
) || { ) || {