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)
|
$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL)
|
||||||
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
|
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
cgalPACKAGE=${cgal_version:-CGAL-4.8}
|
|
||||||
boostPACKAGE=${boost_version:-boost-system}
|
boostPACKAGE=${boost_version:-boost-system}
|
||||||
gmpPACKAGE=${gmp_version:-gmp-system}
|
gmpPACKAGE=${gmp_version:-gmp-system}
|
||||||
mpfrPACKAGE=${mpfr_version:-mpfr-system}
|
mpfrPACKAGE=${mpfr_version:-mpfr-system}
|
||||||
|
cgalPACKAGE=$cgal_version
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
# Run from third-party directory only
|
||||||
@ -88,7 +86,7 @@ Note: mixing system and ThirdParty for gmp/mpfr is not supported.
|
|||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Ensure CMake gets the correct C++ compiler
|
# Ensure CMake gets the correct C++ compiler
|
||||||
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
|
||||||
@ -101,6 +99,9 @@ do
|
|||||||
-h | -help)
|
-h | -help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
|
'')
|
||||||
|
# discard empty arguments
|
||||||
|
;;
|
||||||
-gcc)
|
-gcc)
|
||||||
export CXX=g++ # use g++
|
export CXX=g++ # use g++
|
||||||
shift
|
shift
|
||||||
@ -127,9 +128,12 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -z "$cgalPACKAGE" ]
|
||||||
|
then
|
||||||
|
usage "The cgal-VERSION was not specified"
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build Boost
|
# Build Boost
|
||||||
#
|
#
|
||||||
@ -176,6 +180,13 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# nothing left to build
|
||||||
|
if [ "$cgal_version" = "cgal-system" ]
|
||||||
|
then
|
||||||
|
echo "Using system installation of CGAL"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Retrieve boost version:
|
# Retrieve boost version:
|
||||||
if [ -f "$boostInc/boost/version.hpp" ]
|
if [ -f "$boostInc/boost/version.hpp" ]
|
||||||
@ -187,12 +198,19 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
# Build CGAL
|
||||||
#
|
#
|
||||||
|
|||||||
46
makeGcc
46
makeGcc
@ -26,20 +26,22 @@
|
|||||||
# makeGcc
|
# makeGcc
|
||||||
#
|
#
|
||||||
# Description
|
# 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
|
# 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
|
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||||
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
|
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
|
||||||
|
|
||||||
gmpPACKAGE=${gmp_version:-gmp-5.1.2}
|
gmpPACKAGE=${gmp_version:-gmp-system}
|
||||||
mpfrPACKAGE=${mpfr_version:-mpfr-3.1.2}
|
mpfrPACKAGE=${mpfr_version:-mpfr-system}
|
||||||
mpcPACKAGE=${mpc_version:-mpc-1.0.1}
|
mpcPACKAGE=${mpc_version:-mpc-system}
|
||||||
gccPACKAGE=$gcc_version
|
gccPACKAGE=$gcc_version
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
# Run from third-party directory only
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
|
||||||
@ -50,15 +52,16 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
|
|||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
. etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
Script=${0##*/}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
exec 1>&2
|
exec 1>&2
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
cat<<USAGE
|
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:
|
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
|
-help
|
||||||
|
|
||||||
* build combinations of gmp, mpfr, mpc and gcc
|
* build combinations of gmp, mpfr, mpc and gcc
|
||||||
@ -70,8 +73,9 @@ options:
|
|||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
GCC_BUILD_OPTIONS=""
|
unset GCC_BUILD_OPTIONS
|
||||||
|
|
||||||
# Parse options
|
# Parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
@ -80,7 +84,7 @@ do
|
|||||||
-h | -help)
|
-h | -help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
-no-multilib)
|
-no-multi*)
|
||||||
GCC_BUILD_OPTIONS="--disable-multilib"
|
GCC_BUILD_OPTIONS="--disable-multilib"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -134,9 +138,9 @@ GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
|
|||||||
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
|
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
|
||||||
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
|
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
|
||||||
|
|
||||||
#
|
# ================
|
||||||
# Build GMP
|
# Build GMP
|
||||||
#
|
# ================
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d $GMP_ARCH_PATH ]
|
if [ -d $GMP_ARCH_PATH ]
|
||||||
then
|
then
|
||||||
@ -171,9 +175,9 @@ fi
|
|||||||
|
|
||||||
export LD_LIBRARY_PATH="$GMP_ARCH_PATH/lib:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$GMP_ARCH_PATH/lib:$LD_LIBRARY_PATH"
|
||||||
|
|
||||||
#
|
# ================
|
||||||
# Build MPFR
|
# Build MPFR
|
||||||
#
|
# ================
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d $MPFR_ARCH_PATH ]
|
if [ -d $MPFR_ARCH_PATH ]
|
||||||
then
|
then
|
||||||
@ -209,9 +213,10 @@ fi
|
|||||||
|
|
||||||
export LD_LIBRARY_PATH="$MPFR_ARCH_PATH/lib:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$MPFR_ARCH_PATH/lib:$LD_LIBRARY_PATH"
|
||||||
|
|
||||||
#
|
|
||||||
# Build mpc
|
# ================
|
||||||
#
|
# Build MPC
|
||||||
|
# ================
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d $MPC_ARCH_PATH ]
|
if [ -d $MPC_ARCH_PATH ]
|
||||||
then
|
then
|
||||||
@ -247,17 +252,18 @@ else
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -d "$MPC_ARCH_PATH" ]
|
if [ -d "$MPC_ARCH_PATH" ]
|
||||||
then
|
then
|
||||||
export LD_LIBRARY_PATH="$MPC_ARCH_PATH/lib:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$MPC_ARCH_PATH/lib:$LD_LIBRARY_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#
|
# ================
|
||||||
# Build GCC
|
# 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
|
# E.g. on ubuntu install g++-multilib
|
||||||
|
# or specify -no-multilib on the command-line
|
||||||
#
|
#
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d $GCC_ARCH_PATH ]
|
if [ -d $GCC_ARCH_PATH ]
|
||||||
|
|||||||
19
makeLLVM
19
makeLLVM
@ -37,12 +37,14 @@
|
|||||||
# cd -
|
# 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
|
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||||
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
|
_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
|
# run from third-party directory only
|
||||||
@ -54,13 +56,16 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
|
|||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
. etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
Script=${0##*/}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
exec 1>&2
|
exec 1>&2
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [llvm-VERSION]
|
usage: $Script [OPTION] [llvm-VERSION]
|
||||||
|
options:
|
||||||
|
-help
|
||||||
|
|
||||||
* build llvm/clang
|
* build llvm/clang
|
||||||
$llvmPACKAGE
|
$llvmPACKAGE
|
||||||
@ -69,6 +74,8 @@ USAGE
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
# parse options
|
# parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
@ -87,6 +94,12 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -z "$llvmPACKAGE" ]
|
||||||
|
then
|
||||||
|
die "The llvm-VERSION was not specified"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# build/install without compiler name
|
# build/install without compiler name
|
||||||
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
|
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
|
||||||
|
|||||||
Reference in New Issue
Block a user