mirror of
https://develop.openfoam.com/Development/ThirdParty-common.git
synced 2025-12-08 06:57:50 +00:00
ENH: makeGcc now uses --disable-multilib by default
Rationale: 32-bit support is not normally needed for OpenFOAM and disabling reduces build issues. Can use the '-multilib' option to enable 32-bit support if required.
This commit is contained in:
32
makeGcc
32
makeGcc
@ -28,14 +28,21 @@
|
|||||||
# Description
|
# Description
|
||||||
# Build script gcc and gmp, mpfr, mpc.
|
# Build script gcc and gmp, mpfr, mpc.
|
||||||
#
|
#
|
||||||
# Normally builds against ThirdParty gmp/mpfr when possible.
|
# To force building against the system gmp/mpfr/mpc libraries,
|
||||||
# To override this behaviour (and use the system gmp/mpfr/mpc),
|
# use a corresponding '*-system' version. For example,
|
||||||
# simply specify a 'system' version. For example,
|
#
|
||||||
# makeGcc gmp-system
|
# makeGcc gmp-system
|
||||||
#
|
#
|
||||||
|
# or use the '-system' options to use system libraries everywhere.
|
||||||
|
#
|
||||||
|
# The WM_COMPILER value can also be used specify a known gcc version.
|
||||||
|
# For example (also compiling against system gmp/mpfr/mpc),
|
||||||
|
#
|
||||||
|
# WM_COMPILER=Gcc51 ./makeGcc -system
|
||||||
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# 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_TYPE=ThirdParty # ensure we get the correct compiler settings
|
||||||
: ${WM_COMPILER:=Gcc} # this will still fail if 'Clang' was set
|
: ${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
|
||||||
@ -65,7 +72,8 @@ usage() {
|
|||||||
|
|
||||||
usage: $Script [OPTION] [gcc-VERSION] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION]
|
usage: $Script [OPTION] [gcc-VERSION] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION]
|
||||||
options:
|
options:
|
||||||
-no-multilib for 64-bit systems without 32-bit support
|
-multilib for 64-bit systems with 32-bit support required
|
||||||
|
-no-multilib for 64-bit systems without 32-bit support (DEFAULT)
|
||||||
-system use system versions for gmp/mpfr/mpc
|
-system use system versions for gmp/mpfr/mpc
|
||||||
-help
|
-help
|
||||||
|
|
||||||
@ -80,7 +88,8 @@ USAGE
|
|||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
unset GCC_BUILD_OPTIONS
|
# build 32-bit libraries on 64-bit systems (normally not needed)
|
||||||
|
optMultilib=disable
|
||||||
|
|
||||||
# Parse options
|
# Parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
@ -89,8 +98,11 @@ do
|
|||||||
-h | -help)
|
-h | -help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
|
-multi*)
|
||||||
|
optMultilib=enable
|
||||||
|
;;
|
||||||
-no-multi*)
|
-no-multi*)
|
||||||
GCC_BUILD_OPTIONS="--disable-multilib"
|
optMultilib=disable
|
||||||
;;
|
;;
|
||||||
-sys*)
|
-sys*)
|
||||||
gmpPACKAGE="gmp-system"
|
gmpPACKAGE="gmp-system"
|
||||||
@ -315,6 +327,10 @@ else
|
|||||||
_foamIsSystem "$MPFR_ARCH_PATH" && MPFR_ARCH_PATH=/usr # revert to system
|
_foamIsSystem "$MPFR_ARCH_PATH" && MPFR_ARCH_PATH=/usr # revert to system
|
||||||
_foamIsSystem "$MPC_ARCH_PATH" && MPC_ARCH_PATH=/usr # revert to system
|
_foamIsSystem "$MPC_ARCH_PATH" && MPC_ARCH_PATH=/usr # revert to system
|
||||||
|
|
||||||
|
unset configOpt
|
||||||
|
# with/without multi-lib (32-bit support on 64-bit systems)
|
||||||
|
[ -n "$optMultilib" ] && configOpt="--${optMultilib}-multilib"
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
$sourceDIR/configure \
|
$sourceDIR/configure \
|
||||||
--prefix=$GCC_ARCH_PATH \
|
--prefix=$GCC_ARCH_PATH \
|
||||||
@ -329,7 +345,7 @@ else
|
|||||||
--enable-__cxa_atexit \
|
--enable-__cxa_atexit \
|
||||||
--enable-libstdcxx-allocator=new \
|
--enable-libstdcxx-allocator=new \
|
||||||
--with-system-zlib \
|
--with-system-zlib \
|
||||||
$GCC_BUILD_OPTIONS \
|
$configOpt \
|
||||||
MAKEINFO=missing \
|
MAKEINFO=missing \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
|
|||||||
Reference in New Issue
Block a user