mirror of
https://develop.openfoam.com/Development/ThirdParty-common.git
synced 2025-12-08 06:57:50 +00:00
BUG: inconsistent gcc libraries between makeGcc and OpenFOAM
- explicitly define WM_COMPILER_TYPE=ThirdParty before sourcing the OpenFOAM settings. Provide system equivalents as fallbacks so that it is apparent what is happening. Make the same adjustment to makeLLVM. BUG: inconsistent CGAL version between makeCGAL and OpenFOAM
This commit is contained in:
38
makeCGAL
38
makeCGAL
@ -44,12 +44,10 @@ _foamEval SOURCE_CGAL_VERSIONS_ONLY=yes \
|
||||
$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL)
|
||||
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
|
||||
|
||||
set -x
|
||||
|
||||
cgalPACKAGE=${cgal_version:-CGAL-4.8}
|
||||
boostPACKAGE=${boost_version:-boost-system}
|
||||
gmpPACKAGE=${gmp_version:-gmp-system}
|
||||
mpfrPACKAGE=${mpfr_version:-mpfr-system}
|
||||
cgalPACKAGE=$cgal_version
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
@ -88,7 +86,7 @@ Note: mixing system and ThirdParty for gmp/mpfr is not supported.
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Ensure CMake gets the correct C++ compiler
|
||||
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
||||
@ -101,6 +99,9 @@ do
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
'')
|
||||
# discard empty arguments
|
||||
;;
|
||||
-gcc)
|
||||
export CXX=g++ # use g++
|
||||
shift
|
||||
@ -127,9 +128,12 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$cgalPACKAGE" ]
|
||||
then
|
||||
usage "The cgal-VERSION was not specified"
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Build Boost
|
||||
#
|
||||
@ -176,6 +180,13 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# nothing left to build
|
||||
if [ "$cgal_version" = "cgal-system" ]
|
||||
then
|
||||
echo "Using system installation of CGAL"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
# Retrieve boost version:
|
||||
if [ -f "$boostInc/boost/version.hpp" ]
|
||||
@ -187,12 +198,19 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$cgal_version" = "cgal-system" ]
|
||||
then
|
||||
echo "Using system installation of CGAL"
|
||||
exit 0
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cat<<SUMMARY
|
||||
CGAL configuration
|
||||
------------------
|
||||
CGAL = $cgalPACKAGE
|
||||
BOOST = $boostPACKAGE
|
||||
GMP = $gmpPACKAGE
|
||||
MPFR = $mpfrPACKAGE
|
||||
------------------
|
||||
SUMMARY
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build CGAL
|
||||
#
|
||||
|
||||
46
makeGcc
46
makeGcc
@ -26,20 +26,22 @@
|
||||
# makeGcc
|
||||
#
|
||||
# Description
|
||||
# Build script for gmp, mpfr and gcc-[4-9].?.?
|
||||
# Build script gcc and gmp, mpfr, mpc.
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# get default GCC, mpfr, gmp and mpc versions
|
||||
WM_COMPILER_TYPE="ThirdParty" # ensure we get the correct compiler settings
|
||||
: ${WM_COMPILER:=Gcc} # this will still fail if 'Clang' was set
|
||||
|
||||
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
|
||||
|
||||
gmpPACKAGE=${gmp_version:-gmp-5.1.2}
|
||||
mpfrPACKAGE=${mpfr_version:-mpfr-3.1.2}
|
||||
mpcPACKAGE=${mpc_version:-mpc-1.0.1}
|
||||
gmpPACKAGE=${gmp_version:-gmp-system}
|
||||
mpfrPACKAGE=${mpfr_version:-mpfr-system}
|
||||
mpcPACKAGE=${mpc_version:-mpc-system}
|
||||
gccPACKAGE=$gcc_version
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
|
||||
@ -50,15 +52,16 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
Script=${0##*/}
|
||||
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [option] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION] <gcc-VERSION>
|
||||
usage: $Script [OPTION] [gcc-VERSION] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION]
|
||||
options:
|
||||
-no-multilib for 64-bit systems that don't have 32-bit support
|
||||
-no-multilib for 64-bit systems without 32-bit support
|
||||
-help
|
||||
|
||||
* build combinations of gmp, mpfr, mpc and gcc
|
||||
@ -70,8 +73,9 @@ options:
|
||||
USAGE
|
||||
exit 1
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
GCC_BUILD_OPTIONS=""
|
||||
unset GCC_BUILD_OPTIONS
|
||||
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
@ -80,7 +84,7 @@ do
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
-no-multilib)
|
||||
-no-multi*)
|
||||
GCC_BUILD_OPTIONS="--disable-multilib"
|
||||
shift
|
||||
;;
|
||||
@ -134,9 +138,9 @@ GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
|
||||
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
|
||||
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
|
||||
|
||||
#
|
||||
# ================
|
||||
# Build GMP
|
||||
#
|
||||
# ================
|
||||
echo "---------------"
|
||||
if [ -d $GMP_ARCH_PATH ]
|
||||
then
|
||||
@ -171,9 +175,9 @@ fi
|
||||
|
||||
export LD_LIBRARY_PATH="$GMP_ARCH_PATH/lib:$LD_LIBRARY_PATH"
|
||||
|
||||
#
|
||||
# ================
|
||||
# Build MPFR
|
||||
#
|
||||
# ================
|
||||
echo "---------------"
|
||||
if [ -d $MPFR_ARCH_PATH ]
|
||||
then
|
||||
@ -209,9 +213,10 @@ fi
|
||||
|
||||
export LD_LIBRARY_PATH="$MPFR_ARCH_PATH/lib:$LD_LIBRARY_PATH"
|
||||
|
||||
#
|
||||
# Build mpc
|
||||
#
|
||||
|
||||
# ================
|
||||
# Build MPC
|
||||
# ================
|
||||
echo "---------------"
|
||||
if [ -d $MPC_ARCH_PATH ]
|
||||
then
|
||||
@ -247,17 +252,18 @@ else
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
if [ -d "$MPC_ARCH_PATH" ]
|
||||
then
|
||||
export LD_LIBRARY_PATH="$MPC_ARCH_PATH/lib:$LD_LIBRARY_PATH"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# ================
|
||||
# Build GCC
|
||||
# might need 32-bit glibc-devel headers to compile
|
||||
# ================
|
||||
# may need 32-bit glibc-devel headers to compile
|
||||
# E.g. on ubuntu install g++-multilib
|
||||
# or specify -no-multilib on the command-line
|
||||
#
|
||||
echo "---------------"
|
||||
if [ -d $GCC_ARCH_PATH ]
|
||||
|
||||
19
makeLLVM
19
makeLLVM
@ -37,12 +37,14 @@
|
||||
# cd -
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
# get default llvm/clang version
|
||||
WM_COMPILER_TYPE="ThirdParty" # ensure we get the correct compiler settings
|
||||
WM_COMPILER=Clang # force values for 'clang'
|
||||
|
||||
# get default llvm version
|
||||
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
|
||||
|
||||
llvmPACKAGE=${clang_version:-llvm-3.7.0}
|
||||
llvmPACKAGE=$clang_version
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# run from third-party directory only
|
||||
@ -54,13 +56,16 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
Script=${0##*/}
|
||||
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [llvm-VERSION]
|
||||
usage: $Script [OPTION] [llvm-VERSION]
|
||||
options:
|
||||
-help
|
||||
|
||||
* build llvm/clang
|
||||
$llvmPACKAGE
|
||||
@ -69,6 +74,8 @@ USAGE
|
||||
exit 1
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
# parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
@ -87,6 +94,12 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$llvmPACKAGE" ]
|
||||
then
|
||||
die "The llvm-VERSION was not specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# build/install without compiler name
|
||||
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
|
||||
|
||||
Reference in New Issue
Block a user