mirror of
https://develop.openfoam.com/Development/ThirdParty-common.git
synced 2025-12-08 06:57:50 +00:00
ENH: update handling of compiler and flags
- support use of wmake -show-xyz, as well as older WM_CC, WM_CFLAGS etc. - add support for Makefile.inc for scotch - add -toolset= option for making boost and use b2 instead of legacy bjam for configuration
This commit is contained in:
45
Allwmake
45
Allwmake
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -21,9 +21,6 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Dynamic library endings (default is .so)
|
||||
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
|
||||
|
||||
# Run from third-party directory only
|
||||
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
@ -62,6 +59,8 @@ echo
|
||||
echo ========================================
|
||||
echo Start ThirdParty Allwmake
|
||||
echo ========================================
|
||||
echo "using: $CC $CFLAGS"
|
||||
echo "using: $CXX $CXXFLAGS"
|
||||
echo
|
||||
echo ========================================
|
||||
echo Build MPI libraries if required
|
||||
@ -94,14 +93,20 @@ echo " $SCOTCH_ARCH_PATH"
|
||||
SCOTCH_SOURCE_DIR=$sourceBASE/$SCOTCH_VERSION
|
||||
|
||||
# Needs generalizing, but works fairly well
|
||||
scotchMakefile=etc/makeFiles/scotch/Makefile.inc.OpenFOAM-"$(uname -s)".shlib
|
||||
for scotchMakefile in \
|
||||
"OpenFOAM-$(uname -s)-${WM_COMPILER}.shlib" \
|
||||
"OpenFOAM-$(uname -s).shlib" \
|
||||
OpenFOAM-Linux.shlib \
|
||||
;
|
||||
do
|
||||
scotchMakefile="etc/makeFiles/scotch/Makefile.inc.$scotchMakefile"
|
||||
[ -f "$scotchMakefile" ] && break
|
||||
done
|
||||
|
||||
[ -f $scotchMakefile ] || \
|
||||
scotchMakefile=${scotchMakefile%/*}/Makefile.inc.OpenFOAM-Linux.shlib
|
||||
|
||||
if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \
|
||||
-a -r $FOAM_EXT_LIBBIN/libscotch.$SO \
|
||||
-a -r $FOAM_EXT_LIBBIN/libscotcherrexit.$SO ]
|
||||
if [ -f "$SCOTCH_ARCH_PATH/include/scotch.h" ] \
|
||||
&& [ -r "$FOAM_EXT_LIBBIN/libscotch.$SO" ] \
|
||||
&& [ -r "$FOAM_EXT_LIBBIN/libscotcherrexit.$SO" ]
|
||||
then
|
||||
echo " scotch include: $SCOTCH_ARCH_PATH/include"
|
||||
echo " scotch library: $FOAM_EXT_LIBBIN"
|
||||
@ -114,6 +119,11 @@ then
|
||||
echo "*** building scotch in serial ***"
|
||||
echo
|
||||
|
||||
[ -f "$scotchMakefile" ] || {
|
||||
echo " Error: no such makefile: $scotchMakefile"
|
||||
exit 1
|
||||
}
|
||||
|
||||
cd $SCOTCH_SOURCE_DIR/src || exit 1
|
||||
export GIT_DIR=$SCOTCH_SOURCE_DIR/.git # Mask seeing our own git-repo
|
||||
rm -rf $SCOTCH_ARCH_PATH
|
||||
@ -141,11 +151,11 @@ then
|
||||
exit 1
|
||||
}
|
||||
|
||||
export CCS="${CC:-$WM_CC}" # CCS (serial compiler) default=$(CC)
|
||||
export CCP=$(whichMpicc) # CCP (parallel compiler) default=mpicc
|
||||
export CCS="$(whichCC)" # CCS (serial compiler)
|
||||
export CCP="$(whichMpicc)" # CCP (parallel compiler) default=mpicc
|
||||
|
||||
# Consistency for Intel-MPI and non-icc compilers
|
||||
[ -n "$I_MPI_CC" ] || export I_MPI_CC="${CC:-$WM_CC}"
|
||||
[ -n "$I_MPI_CC" ] || export I_MPI_CC="$(whichCC)"
|
||||
|
||||
make realclean 2>/dev/null # Extra safety
|
||||
make -j $WM_NCOMPPROCS scotch \
|
||||
@ -191,6 +201,11 @@ then
|
||||
export WM_NCOMPPROCS=1
|
||||
echo "*** building pt-scotch in serial ***"
|
||||
|
||||
[ -f "$scotchMakefile" ] || {
|
||||
echo " Error: no such makefile: $scotchMakefile"
|
||||
exit 1
|
||||
}
|
||||
|
||||
cd $SCOTCH_SOURCE_DIR/src || exit 1
|
||||
export GIT_DIR=$SCOTCH_SOURCE_DIR/.git # Mask seeing our own git-repo
|
||||
echo
|
||||
@ -213,11 +228,11 @@ then
|
||||
exit 1
|
||||
}
|
||||
|
||||
export CCS="${CC:-$WM_CC}" # CCS (serial compiler) default=$(CC)
|
||||
export CCS="$(whichCC)" # CCS (serial compiler)
|
||||
export CCP=$(whichMpicc) # CCP (parallel compiler) default=mpicc
|
||||
|
||||
# Consistency for Intel-MPI and non-icc compilers
|
||||
[ -n "$I_MPI_CC" ] || export I_MPI_CC="${CC:-$WM_CC}"
|
||||
[ -n "$I_MPI_CC" ] || export I_MPI_CC="$(whichCC)"
|
||||
|
||||
make realclean 2>/dev/null # Extra safety
|
||||
make -j $WM_NCOMPPROCS ptscotch \
|
||||
|
||||
3
BUILD.md
3
BUILD.md
@ -531,6 +531,9 @@ that clang compiler for building the newer llvm/clang version.
|
||||
[repo gperftools]: https://github.com/gperftools/gperftools
|
||||
[link gperftools]: https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz
|
||||
|
||||
[page zlib]: https://www.zlib.net/
|
||||
[link zlib]: https://sourceforge.net/projects/libpng/files/zlib/1.2.11/zlib-1.2.11.tar.xz
|
||||
|
||||
|
||||
<!-- Visualization -->
|
||||
|
||||
|
||||
@ -1,12 +1,23 @@
|
||||
#-------------------------------*- makefile -*---------------------------------
|
||||
# OpenFOAM notes:
|
||||
#
|
||||
# WM_CFLAGS, WM_LDFLAGS contain "-m32 -fPIC" etc
|
||||
# WM_LABEL_SIZE == 64 for 'long' instead of 'int' for OpenFOAM labels
|
||||
# Prior to OpenFOAM-v1906, these were always part of the environment
|
||||
#
|
||||
# - WM_CFLAGS : with -m32 / -m64 and -fPIC
|
||||
# - WM_LDFLAGS : with -m32 / -m64
|
||||
#
|
||||
# With OpenFOAM-v1906 and later
|
||||
#
|
||||
# - wmake -show-cflags : with -m32 / -m64
|
||||
# - wmake -show-cflags-arch : with -m32 / -m64
|
||||
#
|
||||
# Pass these in via the enviroment since using '$(shell ...)' here does not
|
||||
# always work well.
|
||||
#
|
||||
# Notes:
|
||||
# - compiled without pthread
|
||||
#
|
||||
# Normally set CCS, CCP by caller
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
EXE =
|
||||
LIB = .dylib
|
||||
@ -17,7 +28,7 @@ ARFLAGS = $(WM_CFLAGS) -dynamiclib -undefined dynamic_lookup -o
|
||||
CCS ?= $(CC)
|
||||
CCP ?= mpicc
|
||||
CCD = $(CCP)
|
||||
CFLAGS = $(WM_CFLAGS) -O3 \
|
||||
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
|
||||
-DCOMMON_FILE_COMPRESS_GZ \
|
||||
-DCOMMON_RANDOM_FIXED_SEED \
|
||||
-DSCOTCH_DETERMINISTIC \
|
||||
|
||||
59
etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Linux-Mingw.shlib
Normal file
59
etc/makeFiles/scotch/Makefile.inc.OpenFOAM-Linux-Mingw.shlib
Normal file
@ -0,0 +1,59 @@
|
||||
#-------------------------------*- makefile -*---------------------------------
|
||||
#
|
||||
# Prior to OpenFOAM-v1906, these were always part of the environment
|
||||
#
|
||||
# - WM_CFLAGS : with -m32 / -m64 and -fPIC
|
||||
# - WM_LDFLAGS : with -m32 / -m64
|
||||
#
|
||||
# With OpenFOAM-v1906 and later
|
||||
#
|
||||
# - wmake -show-cflags : with -m32 / -m64
|
||||
# - wmake -show-cflags-arch : with -m32 / -m64
|
||||
#
|
||||
# Pass these in via the enviroment since using '$(shell ...)' here does not
|
||||
# always work well.
|
||||
#
|
||||
# Notes:
|
||||
# - compiled without pthread
|
||||
#
|
||||
# Normally set CCS, CCP by caller
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
EXE =
|
||||
LIB = .dll
|
||||
OBJ = .o
|
||||
|
||||
AR = $(CC)
|
||||
ARFLAGS = $(CFLAGS) -shared -Wl,--output-def,libscotch.def,--out-implib,libscotch.a,--enable-auto-import,--strip-all -o
|
||||
CC = x86_64-w64-mingw32-gcc
|
||||
CCS = x86_64-w64-mingw32-gcc
|
||||
CCP = x86_64-w64-mingw32-gcc
|
||||
CCD = gcc
|
||||
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
|
||||
-DCOMMON_WINDOWS -DCOMMON_STUB_FORK -DCOMMON_PTHREAD_FILE \
|
||||
-UCOMMON_FILE_COMPRESS \
|
||||
-DCOMMON_RANDOM_FIXED_SEED \
|
||||
-DSCOTCH_DETERMINISTIC \
|
||||
-DSCOTCH_RENAME \
|
||||
-DSCOTCH_PTHREAD \
|
||||
-Drestrict=__restrict
|
||||
|
||||
# 32-bit vs. 64-bit labels
|
||||
ifeq ($(WM_LABEL_SIZE),64)
|
||||
CFLAGS += -DINTSIZE64
|
||||
endif
|
||||
|
||||
CLIBFLAGS = -shared
|
||||
LDFLAGS =
|
||||
|
||||
MAKE = make
|
||||
CP = cp
|
||||
CAT = cat
|
||||
LN = ln
|
||||
MKDIR = mkdir
|
||||
MV = mv
|
||||
RANLIB = echo
|
||||
LEX = flex -Pscotchyy -olex.yy.c
|
||||
YACC = bison -pscotchyy -y -b y
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -1,12 +1,23 @@
|
||||
#-------------------------------*- makefile -*---------------------------------
|
||||
# OpenFOAM notes:
|
||||
#
|
||||
# WM_CFLAGS, WM_LDFLAGS contain "-m32 -fPIC" etc
|
||||
# WM_LABEL_SIZE == 64 for 'long' instead of 'int' for OpenFOAM labels
|
||||
# Prior to OpenFOAM-v1906, these were always part of the environment
|
||||
#
|
||||
# - WM_CFLAGS : with -m32 / -m64 and -fPIC
|
||||
# - WM_LDFLAGS : with -m32 / -m64
|
||||
#
|
||||
# With OpenFOAM-v1906 and later
|
||||
#
|
||||
# - wmake -show-cflags : with -m32 / -m64
|
||||
# - wmake -show-cflags-arch : with -m32 / -m64
|
||||
#
|
||||
# Pass these in via the enviroment since using '$(shell ...)' here does not
|
||||
# always work well.
|
||||
#
|
||||
# Notes:
|
||||
# - compiled without pthread
|
||||
#
|
||||
# Normally set CCS, CCP by caller
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
EXE =
|
||||
LIB = .so
|
||||
@ -17,7 +28,7 @@ ARFLAGS = $(WM_CFLAGS) -shared -o
|
||||
CCS ?= $(CC)
|
||||
CCP ?= mpicc
|
||||
CCD = $(CCP)
|
||||
CFLAGS = $(WM_CFLAGS) -O3 \
|
||||
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
|
||||
-DCOMMON_FILE_COMPRESS_GZ \
|
||||
-DCOMMON_RANDOM_FIXED_SEED \
|
||||
-DSCOTCH_DETERMINISTIC \
|
||||
|
||||
45
etc/testThirdPartyFunctions
Executable file
45
etc/testThirdPartyFunctions
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# testThirdPartyFunctions
|
||||
#
|
||||
# Description
|
||||
# Simple ad hoc tests of etc/tools/ThirdPartyFunctions
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
echo ========================================
|
||||
echo "Calling environment"
|
||||
echo "CC=$CC"
|
||||
echo "CXX=$CXX"
|
||||
echo
|
||||
echo ========================================
|
||||
|
||||
. "$WM_THIRD_PARTY_DIR/etc/tools/ThirdPartyFunctions"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
echo "CC=$(whichCC)"
|
||||
echo "CXX=$(whichCXX)"
|
||||
echo "mpicc=$(whichMpicc)"
|
||||
echo "mpicxx=$(whichMpicxx)"
|
||||
|
||||
exportCompiler
|
||||
|
||||
echo ========================================
|
||||
echo "using: $CC $CFLAGS"
|
||||
echo "using: $CXX $CXXFLAGS"
|
||||
echo
|
||||
echo ========================================
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -2,7 +2,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -19,6 +19,10 @@
|
||||
#
|
||||
# Define the standard buildBASE and installBASE for the platform
|
||||
# Define WM_NCOMPPROCS always.
|
||||
#
|
||||
# Compiler and flags are managed via the 'wmake -show-c, -show-cflags, ..'
|
||||
# but also with WM_CC, WM_CFLAGS,... env variables
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# The normal locations for source, build and installation (prefix-dir)
|
||||
@ -30,43 +34,86 @@ installBASE="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
|
||||
WM_SIZE_OPTIONS="${WM_PRECISION_OPTION}Int${WM_LABEL_SIZE}"
|
||||
|
||||
# Dynamic library endings (default is .so)
|
||||
[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so
|
||||
SO="$(wmake -show-ext-so 2>/dev/null)"; SO="${SO#.}"
|
||||
if [ -z "$SO" ] && [ "$(uname -s)" = Darwin ]
|
||||
then
|
||||
SO=dylib
|
||||
fi
|
||||
: "${SO:=so}"
|
||||
|
||||
|
||||
# Fallback values, needed for our scotch Makefile which uses
|
||||
# WM_CFLAGS and WM_LDFLAGS for arch information
|
||||
if [ -z "$WM_CFLAGS" ]
|
||||
then
|
||||
export WM_CFLAGS="$(wmake -show-cflags 2>/dev/null)"
|
||||
fi
|
||||
|
||||
if [ -z "$WM_LDFLAGS" ]
|
||||
then
|
||||
export WM_LDFLAGS="$(wmake -show-cflags-arch 2>/dev/null)"
|
||||
fi
|
||||
|
||||
unset BUILD_SUFFIX
|
||||
#------------------------------------------------------------------------------
|
||||
# Export WM compiler settings (and flags) for CMake/configure
|
||||
# $1 = true: export compiler flags too
|
||||
# Export compiler settings (and flags) for CMake/configure
|
||||
# based on the values from wmake -show-compile-*
|
||||
#
|
||||
# Since "wmake -show-XX" is only available after 1904, continue to support
|
||||
# the previous env variables method (WM_CC, WM_CFLAGS, WM_CXX, WM_CXXFLAGS)
|
||||
exportCompiler()
|
||||
{
|
||||
if test -n "$WM_CC" && command -v "$WM_CC" >/dev/null
|
||||
local comp flag
|
||||
|
||||
# C compiler and flags
|
||||
comp="$(wmake -show-c 2>/dev/null)" && \
|
||||
flag="$(wmake -show-cflags 2>/dev/null)" || {
|
||||
comp="$WM_CC"
|
||||
flag="$WM_CFLAGS"
|
||||
}
|
||||
|
||||
if test -n "$comp" && command -v "$comp" >/dev/null
|
||||
then
|
||||
export CC="$WM_CC"
|
||||
if [ "$1" = true -a -n "$WM_CFLAGS" ]
|
||||
export CC="$comp"
|
||||
if [ -n "$flag" ]
|
||||
then
|
||||
export CFLAGS="$WM_CFLAGS"
|
||||
export CFLAGS="$flag"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$WM_CXX" && command -v "$WM_CXX" >/dev/null
|
||||
# C++ compiler and flags
|
||||
comp="$(wmake -show-cxx 2>/dev/null)" && \
|
||||
flag="$(wmake -show-cxxflags 2>/dev/null)" || {
|
||||
comp="$WM_CXX"
|
||||
flag="$WM_CXXFLAGS"
|
||||
}
|
||||
|
||||
if test -n "$comp" && command -v "$comp" >/dev/null
|
||||
then
|
||||
export CXX="$WM_CXX"
|
||||
if [ "$1" = true -a -n "$WM_CXXFLAGS" ]
|
||||
export CXX="$comp"
|
||||
if [ -n "$flag" ]
|
||||
then
|
||||
export CXXFLAGS="$WM_CXXFLAGS"
|
||||
export CXXFLAGS="$flag"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Export WM linker settings for CMake/configure
|
||||
# Export linker settings for CMake/configure
|
||||
exportLinker()
|
||||
{
|
||||
if [ -n "$WM_LDFLAGS" ]
|
||||
local flag
|
||||
|
||||
# Linker flags, actually just the machine arch
|
||||
flag="$(wmake -show-cflags-arch 2>/dev/null)" || flag="$WM_LDFLAGS"
|
||||
|
||||
if test -n "$flag"
|
||||
then
|
||||
export LDFLAGS="$WM_LDFLAGS"
|
||||
export LDFLAGS="$flag"
|
||||
fi
|
||||
}
|
||||
|
||||
# Force use of gcc/g++
|
||||
|
||||
# Force use of gcc/g++, but the values of CFLAGS, CXXFLAGS may be incorrect
|
||||
useGcc()
|
||||
{
|
||||
export CC=gcc
|
||||
@ -86,39 +133,73 @@ useGccFlag()
|
||||
done
|
||||
}
|
||||
|
||||
# Return <mpicc> by default or <mpiicc> if possible for INTELMPI.
|
||||
# Cray doesn't have <mpicc>, but its <cc> manages mpi paths directly.
|
||||
# NOTE: could further refine based on $CC or $WM_CC, but not yet needed
|
||||
whichMpicc()
|
||||
# Return current value of $CC if set or obtain from 'wmake -show-c',
|
||||
# using $WM_CC (older env variable) as the first level fallback.
|
||||
# Final fallback is <gcc>
|
||||
whichCC()
|
||||
{
|
||||
local mpicc=$(command -v mpicc)
|
||||
case "$WM_MPLIB" in
|
||||
(INTELMPI)
|
||||
mpicc=$(command -v mpiicc) # Intel <mpiicc> available?
|
||||
;;
|
||||
(CRAY-MPI*)
|
||||
: ${mpicc:=cc} # Cray <cc> if there is no <mpicc>
|
||||
;;
|
||||
esac
|
||||
echo "${mpicc:-mpicc}"
|
||||
local comp="$CC"
|
||||
|
||||
if [ -z "$comp" ]
|
||||
then
|
||||
comp="$(wmake -show-c 2>/dev/null)" || comp="$WM_CC"
|
||||
test -n "$comp" && command -v "$comp" >/dev/null || unset comp
|
||||
fi
|
||||
|
||||
echo "${comp:-gcc}"
|
||||
}
|
||||
|
||||
|
||||
# Return current value of $CXX if set or obtain from 'wmake -show-cxx',
|
||||
# using $WM_CXX (older env variable) as the first level fallback.
|
||||
# Final fallback is <g++>
|
||||
whichCXX()
|
||||
{
|
||||
local comp="$CXX"
|
||||
|
||||
if [ -z "$comp" ]
|
||||
then
|
||||
comp="$(wmake -show-cxx 2>/dev/null)" || comp="$WM_CXX"
|
||||
test -n "$comp" && command -v "$comp" >/dev/null || unset comp
|
||||
fi
|
||||
|
||||
echo "${comp:-g++}"
|
||||
}
|
||||
|
||||
|
||||
# Return <mpicc> by default or <mpiicc> if possible for INTELMPI.
|
||||
# Cray doesn't have <mpicc>, but its <cc> manages mpi paths directly.
|
||||
# NOTE: could further refine based on $CC or $WM_CC, but not yet needed
|
||||
whichMpicxx()
|
||||
# NOTE: could further refine based on "wmake -show-c", but not yet needed
|
||||
whichMpicc()
|
||||
{
|
||||
local mpicxx=$(command -v mpicxx)
|
||||
local comp="$(command -v mpicc)"
|
||||
case "$WM_MPLIB" in
|
||||
(INTELMPI)
|
||||
mpicxx=$(command -v mpiicpc) # Intel <mpiicpc> available?
|
||||
comp="$(command -v mpiicc)" # Intel <mpiicc> available?
|
||||
;;
|
||||
(CRAY-MPI*)
|
||||
: ${mpicxx:=CC} # Cray <CC> if there is no <mpicc>
|
||||
: "${comp:=cc}" # Cray <cc> if there is no <mpicc>
|
||||
;;
|
||||
esac
|
||||
echo "${mpicxx:-mpicxx}"
|
||||
echo "${comp:-mpicc}"
|
||||
}
|
||||
|
||||
|
||||
# Return <mpicxx> by default or <mpiicpc> if possible for INTELMPI.
|
||||
# Cray doesn't have <mpicxx>, but its <CC> manages mpi paths directly.
|
||||
# NOTE: could further refine based on "wmake -show-cxx", but not yet needed
|
||||
whichMpicxx()
|
||||
{
|
||||
local comp="$(command -v mpicxx)"
|
||||
case "$WM_MPLIB" in
|
||||
(INTELMPI)
|
||||
comp="$(command -v mpiicpc)" # Intel <mpiicpc> available?
|
||||
;;
|
||||
(CRAY-MPI*)
|
||||
: "${comp:=CC}" # Cray <CC> if there is no <mpicc>
|
||||
;;
|
||||
esac
|
||||
echo "${comp:-mpicxx}"
|
||||
}
|
||||
|
||||
# Require wmkdepend etc when building with wmake
|
||||
|
||||
@ -41,8 +41,8 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [adios-VERSION] [-- configure-options]
|
||||
options:
|
||||
-cmake PATH With cmake from the path given
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH With cmake from the given path
|
||||
-help
|
||||
|
||||
* Build ADIOS
|
||||
|
||||
@ -39,8 +39,8 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [adios-VERSION]
|
||||
options:
|
||||
-cmake PATH With cmake from the path given
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH With cmake from the given path
|
||||
-help
|
||||
|
||||
* Build ADIOS2
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -53,7 +53,7 @@ usage()
|
||||
|
||||
Usage: ${0##*/} [OPTION] [lib|libso] [libccmio-VERSION]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* Compile the proprietary libccmio library
|
||||
|
||||
22
makeCGAL
22
makeCGAL
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
@ -85,10 +85,11 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [CGAL-VERSION] [boost-VERSION] [gmp-VERSION] [mpfr-VERSION]
|
||||
options:
|
||||
-cmake PATH with cmake from the path given
|
||||
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
|
||||
-no-lib compile CGAL for use in headers only mode (since CGAL 4.9)
|
||||
-system use system versions for boost/gmp/mpfr
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH Use cmake from the given path
|
||||
-no-lib Compile CGAL for use in headers only mode (since CGAL 4.9)
|
||||
-toolset=NAME Use named toolset in bootstrap
|
||||
-system Use system versions for boost/gmp/mpfr
|
||||
-help
|
||||
|
||||
* build CGAL with
|
||||
@ -110,7 +111,7 @@ USAGE
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
|
||||
unset optHeadersOnly
|
||||
unset optHeadersOnly optToolset
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
@ -124,6 +125,9 @@ do
|
||||
CMAKE_PATH="${2%%/}"
|
||||
shift
|
||||
;;
|
||||
-toolset=*)
|
||||
optToolset="${1*=}"
|
||||
;;
|
||||
-sys*)
|
||||
gmpPACKAGE="gmp-system"
|
||||
mpfrPACKAGE="mpfr-system"
|
||||
@ -234,12 +238,16 @@ else
|
||||
|
||||
rm -rf $BOOST_ARCH_PATH
|
||||
|
||||
# Toolset to use
|
||||
[ -n "$optToolset" ] || optToolset="$(whichCC)"
|
||||
|
||||
./bootstrap.sh \
|
||||
--prefix=$BOOST_ARCH_PATH \
|
||||
--libdir=$boostLib \
|
||||
--with-libraries=thread \
|
||||
--with-libraries=system \
|
||||
&& ./bjam toolset=$WM_CC -j $WM_NCOMPPROCS install \
|
||||
--with-toolset="$optToolset" \
|
||||
&& ./b2 toolset="$optToolset" -j $WM_NCOMPPROCS install \
|
||||
&& echo "Built: boost"
|
||||
) || {
|
||||
echo "Error building: boost"
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# | Copyright (C) 2011 OpenFOAM Foundation
|
||||
@ -44,7 +44,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] cmake-VERSION
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-link Create additional symlink as 'cmake-system'
|
||||
-help
|
||||
|
||||
|
||||
4
makeFFTW
4
makeFFTW
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -59,7 +59,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [fftw-VERSION] [-- configure-options]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* build FFTW with
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# | Copyright (C) 2012 OpenFOAM Foundation
|
||||
@ -43,7 +43,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [gperftools-VERSION]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* build gperftools
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -74,7 +74,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* build HYPRE with
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -75,7 +75,7 @@ usage()
|
||||
|
||||
Usage: ${0##*/} [OPTION] [lib|libso] [kahip-VERSION]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* Compile KaHIP
|
||||
|
||||
6
makeLLVM
6
makeLLVM
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -64,8 +64,8 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [llvm-VERSION]
|
||||
options:
|
||||
-cmake PATH with cmake from the path given
|
||||
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH with cmake from the given path
|
||||
-help
|
||||
|
||||
* build llvm/clang
|
||||
|
||||
@ -74,7 +74,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [lib|libso] [METIS-VERSION]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* build METIS with
|
||||
|
||||
22
makeMGridGen
22
makeMGridGen
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -42,7 +42,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [mgridgen-VERSION]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* Build MGridGen
|
||||
@ -59,12 +59,10 @@ exportCompiler # Compiler info for CMake/configure
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
-gcc)
|
||||
useGcc # Use gcc/g++
|
||||
;;
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-gcc) useGcc ;;
|
||||
|
||||
mgridgen-[1-9]* | MGridGen-[1-9]* | parmgridgen-[1-9]* | ParMGridGen-[1-9]*)
|
||||
mgridgenPACKAGE="${1%%/}"
|
||||
;;
|
||||
@ -147,8 +145,8 @@ else
|
||||
# Remove any existing build folder and recreate
|
||||
rm -rf $MGRIDGEN_ARCH_PATH
|
||||
|
||||
serial="${CC:-$WM_CC}" # CC (serial compiler) default=cc
|
||||
# parallel=$(whichMpicc) # PARCC (parallel compiler) default=mpicc
|
||||
serial="$(whichCC)" # CC (serial compiler) default=gcc
|
||||
# parallel=$(whichMpicc) # PARCC (parallel compiler) default=mpicc
|
||||
# PARCC=$parallel
|
||||
# PARLD=$parallel
|
||||
# PARLIBS="-L../.. -lparmgrid -lmgrid -lm"
|
||||
@ -156,8 +154,8 @@ else
|
||||
make \
|
||||
COPTIONS="-fPIC" \
|
||||
LDOPTIONS="-fPIC" \
|
||||
CC=$serial \
|
||||
LD=$serial \
|
||||
CC="$serial" \
|
||||
LD="$serial" \
|
||||
LIBDIR="-L../.." \
|
||||
LIBS="-L../.. -lmgrid -lm" \
|
||||
make=make \
|
||||
|
||||
@ -70,7 +70,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [mpich-VERSION] [-- configure-options]
|
||||
options:
|
||||
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* build mpich with
|
||||
|
||||
@ -70,7 +70,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [mvapich2-VERSION] [-- configure-options]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* build mvapich2 with
|
||||
|
||||
2
makeMesa
2
makeMesa
@ -49,7 +49,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] mesa-VERSION [-- configure-options]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-llvm VER llvm version (in ThirdParty) or 'system' to use system
|
||||
-help
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -70,7 +70,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [openmpi-VERSION] [-- configure-options]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-memcheck Configure with --enable-memcheck (requires valgrind.h)
|
||||
-threaded Configure with --enable-mpi-thread-multiple
|
||||
-no-threaded Configure with --disable-mpi-thread-multiple
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -74,7 +74,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [lib|libso] [PETSC-VERSION]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* build PETSC with
|
||||
|
||||
10
makeParaView
10
makeParaView
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -72,7 +72,8 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [paraview-VERSION] [CMAKE-OPTION]
|
||||
options:
|
||||
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH with cmake from the given path
|
||||
-rebuild for repeated builds (-make -install) *use with caution*
|
||||
-gl2 with new rendering backend (default: auto)
|
||||
-mesa with mesa
|
||||
@ -85,10 +86,9 @@ options:
|
||||
-python-include DIR
|
||||
location of python headers (current: ${PYTHON_INCLUDE:-none})
|
||||
-python-lib PATH path to python library (current: ${PYTHON_LIBRARY:-none})
|
||||
-cmake PATH with cmake from the path given
|
||||
-qmake PATH with the Qt version corresponding to the qmake path given
|
||||
-qmake PATH with QT version corresponding to the qmake in given path
|
||||
-qt with extra Qt gui support (if not already enabled)
|
||||
-qt-VER with Qt version corresponding to
|
||||
-qt-VER with QT version corresponding to
|
||||
\$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/qt-VER/bin/qmake
|
||||
-verbose verbose output in Makefiles
|
||||
-version VER specify an alternative version (current: $ParaView_VERSION)
|
||||
|
||||
4
makeQt
4
makeQt
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# | Copyright (C) 2011 OpenFOAM Foundation
|
||||
@ -37,7 +37,7 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [qt-VERSION] [-- configure-options]
|
||||
options:
|
||||
-gcc Force gcc/g++ instead of using \$WM_CC, \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
|
||||
* build $qtTYPE, version ${qtVERSION:-undefined}
|
||||
|
||||
6
makeVTK
6
makeVTK
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -63,7 +63,8 @@ usage() {
|
||||
|
||||
usage: ${0##*/} [OPTION] [vtk-VERSION] [CMAKE-OPTION]
|
||||
options:
|
||||
-gcc force g++ instead of the value from \$WM_CXX
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH with cmake from the given path
|
||||
-rebuild for repeated builds (-make -install) *use with caution*
|
||||
-gl2 with new rendering backend (default: auto)
|
||||
-mesa with mesa (if not already enabled)
|
||||
@ -73,7 +74,6 @@ options:
|
||||
-osmesa with off-screen mesa only
|
||||
-mpi with mpi (VTK_Group_MPI=ON)
|
||||
-mpi=N with max 'N' mpi processes. N=0 for no upper-limit.
|
||||
-cmake PATH with cmake from the path given
|
||||
-verbose verbose output in Makefiles
|
||||
-version VER specify an alternative version (current: $VTK_VERSION)
|
||||
-buildType NAME specify the build type (default: Release)
|
||||
|
||||
Reference in New Issue
Block a user