mirror of
https://develop.openfoam.com/Development/ThirdParty-common.git
synced 2025-12-08 06:57:50 +00:00
ENH: improve flexibility of make scripts
- the various make scripts now also search hierarchical sources,
which makes it easier to organize sources. The secondary
sub-directory is the lower-case value of the package stripped of
trailing non-alphabet characters.
For example, searching for ParaView-v5.9.1
sources/
|-- adios
| |-- ...
| |-- ADIOS2-2.7.1
| \-- adios-1.13.1
|-- cgal
| |-- CGAL-4.12.2
| \-- CGAL-4.14.2
| ...
|-- openmpi
| |-- openmpi-4.0.3
| \-- openmpi-4.1.1
|-- paraview
| |-- ParaView-v5.6.1
| \-- ParaView-v5.9.1
\-- scotch
...
- additional out-of-source build options
FOAM_THIRD_PARTY_BUILDROOT :
Replace WM_THIRD_PARTY_DIR as the root for build/ and platforms/
FOAM_THIRD_PARTY_SOURCES :
Alternative to WM_THIRD_PARTY_DIR/sources/
- rationalise internal package variable names for easier maintenance
This commit is contained in:
195
Allclean
195
Allclean
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011 OpenFOAM Foundation
|
# Copyright (C) 2011 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -28,93 +28,172 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
|||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
# . etc/tools/ThirdPartyFunctions
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printHelp() {
|
||||||
exec 1>&2
|
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
Usage: ${0##*/} [OPTION] [platform [ ... platformN]]
|
Usage: ${0##*/} [OPTION]
|
||||||
options:
|
options:
|
||||||
-all remove all platforms directories
|
-build Remove all 'build' directories
|
||||||
-current clean the current platform ($WM_OPTIONS)
|
-current Clean the current platform ($WM_OPTIONS)
|
||||||
-help print the usage
|
-platform=NAME Clean the named platform
|
||||||
|
-src | -sources Clean sources (eg, with make distclean)
|
||||||
|
-full Same as -build -src -current
|
||||||
|
-n | -dry-run Do not perform actions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
Cleanup intermediate build directories.
|
Cleanup intermediate build directories.
|
||||||
Optionally remove specified platform(s) from the ThirdParty platforms
|
Optionally remove specified platform(s) from the ThirdParty platforms
|
||||||
directory $WM_THIRD_PARTY_DIR/platforms
|
directory \$WM_THIRD_PARTY_DIR/platforms
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print help message
|
#------------------------------------------------------------------------------
|
||||||
|
unset optDryRun optCleanType optPlatformName
|
||||||
|
|
||||||
|
# Parse options
|
||||||
|
while [ "$#" -gt 0 ]
|
||||||
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
(-h | -help*)
|
'') ;; # Ignore empty
|
||||||
usage
|
--) shift; break;; # End option processing
|
||||||
|
(-h | -help*) printHelp ;;
|
||||||
|
(-n | -dry-run) optDryRun="(dry-run) " ;;
|
||||||
|
|
||||||
|
(-build)
|
||||||
|
optCleanType="${optCleanType}:build"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(-src | -source*)
|
||||||
|
optCleanType="${optCleanType}:sources"
|
||||||
|
;;
|
||||||
|
|
||||||
|
(-full)
|
||||||
|
optCleanType="full"
|
||||||
|
;;
|
||||||
|
|
||||||
|
(-current)
|
||||||
|
optCleanType="${optCleanType}:current"
|
||||||
|
;;
|
||||||
|
|
||||||
|
(-platform=*)
|
||||||
|
optCleanType="${optCleanType}:platform"
|
||||||
|
optPlatformName="${1#*=}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*) echo "Ignore unknown option/argument" 1>&2 ;;
|
||||||
esac
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
[ -n "$optCleanType" ] || die "No clean operation specified"
|
||||||
|
|
||||||
|
# sources
|
||||||
|
case "$optCleanType" in (*full* | *source*)
|
||||||
|
|
||||||
# Clean various packages via 'distclean'
|
# Clean various packages via 'distclean'
|
||||||
for i in \
|
for dir in \
|
||||||
openmpi-* metis-* adios-* ADIOS-* gperftools-* qt-* \
|
$(etc/list-available -dirs \
|
||||||
gmp-* mpfr-* mpc-* gcc-* llvm-* \
|
gcc \
|
||||||
;
|
gmp \
|
||||||
|
gperftools \
|
||||||
|
llvm \
|
||||||
|
metis \
|
||||||
|
mpc \
|
||||||
|
mpfr \
|
||||||
|
openmpi \
|
||||||
|
qt \
|
||||||
|
)
|
||||||
do
|
do
|
||||||
if [ -d "$i" ]
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
echo "$dir : ${optDryRun}make distclean"
|
||||||
|
elif [ -d "$dir" ]
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
|
cd "$dir" 2>/dev/null || exit
|
||||||
echo
|
echo
|
||||||
echo "${i%/*}"
|
echo "$dir : make distclean"
|
||||||
echo " make distclean"
|
|
||||||
echo
|
echo
|
||||||
cd $i && make distclean
|
make distclean || true
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Clean scotch (src) with 'realclean'
|
||||||
# Clean various packages via 'realclean'
|
for dir in $(etc/list-available -dirs scotch)
|
||||||
for i in scotch*/src
|
|
||||||
do
|
do
|
||||||
if [ -d "$i" ]
|
dir="$dir/src" # Within the src directory!
|
||||||
|
|
||||||
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
echo "$dir : ${optDryRun}make realclean"
|
||||||
|
elif [ -d "$dir" ]
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
|
cd "$dir" 2>/dev/null || exit
|
||||||
echo
|
echo
|
||||||
echo "${i%/*}"
|
echo "$dir : make realclean"
|
||||||
echo " make realclean"
|
|
||||||
echo
|
echo
|
||||||
cd $i && make realclean
|
make realclean || true
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Clean various packages via 'wclean'
|
# Clean various packages via 'wclean'
|
||||||
for i in libccmio*/Make kahip*/lib/Make
|
for dir in $(etc/list-available -dirs ccmio libccmio)
|
||||||
do
|
do
|
||||||
if [ -d "$i" ]
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
echo "$dir : ${optDryRun}wclean"
|
||||||
|
elif [ -f "$dir/Make/files" ]
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
|
cd "$dir" 2>/dev/null || exit
|
||||||
echo
|
echo
|
||||||
echo "${i%/Make}"
|
echo "${dir}: wclean"
|
||||||
echo " wclean"
|
|
||||||
echo
|
echo
|
||||||
cd ${i%/Make} && wclean
|
wclean || true
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Clean various packages via 'wclean'
|
||||||
|
for dir in $(etc/list-available -dirs kahip)
|
||||||
|
do
|
||||||
|
dir="$dir/lib"
|
||||||
|
if [ -n "$optDryRun" ]
|
||||||
|
then
|
||||||
|
echo "$dir : ${optDryRun}wclean"
|
||||||
|
elif [ -f "$dir/Make/files" ]
|
||||||
|
then
|
||||||
|
(
|
||||||
|
cd "$dir" 2>/dev/null || exit
|
||||||
|
echo
|
||||||
|
echo "${dir}: wclean"
|
||||||
|
echo
|
||||||
|
wclean || true
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
esac
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# build
|
||||||
|
case "$optCleanType" in (*full* | *build*)
|
||||||
# Clean out-of-source build directories
|
# Clean out-of-source build directories
|
||||||
if [ -d build ]
|
if [ -d build ]
|
||||||
then
|
then
|
||||||
echo
|
echo
|
||||||
echo "Clean build/ directory"
|
echo "${optDryRun}Remove build/ directory contents"
|
||||||
rm -rf build/*
|
[ -z "$optDryRun" ] && rm -rf build/*
|
||||||
fi
|
fi
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -127,42 +206,28 @@ removePlatform()
|
|||||||
if [ -n "$platform" ] && [ -d "platforms/$platform" ]
|
if [ -n "$platform" ] && [ -d "platforms/$platform" ]
|
||||||
then
|
then
|
||||||
echo
|
echo
|
||||||
echo "Cleaning platform '$platform'"
|
echo "${optDryRun}Cleaning platform '$platform'"
|
||||||
rm -rf "platforms/$platform"
|
[ -z "$optDryRun" ] && "platforms/$platform"
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo "Platform '$platform' not built"
|
echo "${optDryRun}Platform '$platform' not built"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$#" -ge 1 ]
|
|
||||||
then
|
|
||||||
echo
|
|
||||||
echo "Clean platforms/sub-directories"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Optionally cleanup platforms specified from the arguments
|
# -----------------------------------------------------------------------------
|
||||||
while [ "$#" -ge 1 ]
|
|
||||||
do
|
|
||||||
case "$1" in
|
|
||||||
-all)
|
|
||||||
echo
|
|
||||||
echo "Removing all platforms/sub-directories"
|
|
||||||
echo
|
|
||||||
rm -rf platforms/*
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
|
|
||||||
-current)
|
# current platform
|
||||||
echo "Current platform '$WM_OPTIONS'"
|
case "$optCleanType" in (*full* | *current*)
|
||||||
|
echo "${optDryRun}Remove current platform: '$WM_OPTIONS'"
|
||||||
removePlatform "$WM_OPTIONS"
|
removePlatform "$WM_OPTIONS"
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
removePlatform "$1"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
# named platform
|
||||||
|
case "$optCleanType" in (*platform*)
|
||||||
|
echo "${optDryRun}Remove platform: '$optPlatformName'"
|
||||||
|
removePlatform "$optPlatformName"
|
||||||
|
esac
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
2
Allwmake
2
Allwmake
@ -28,7 +28,7 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
|||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler true # Compiler info + flags for CMake/configure
|
exportCompiler true # Compiler info + flags for CMake/configure
|
||||||
exportLinker # Linker flags for CMake/configure
|
exportLinker # Linker flags for CMake/configure
|
||||||
|
|||||||
77
Environ.md
Normal file
77
Environ.md
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
## OpenFOAM® ThirdParty Environment Variables
|
||||||
|
|
||||||
|
When using these scripts for building third-party libraries
|
||||||
|
various environment variables are required or expected.
|
||||||
|
|
||||||
|
### Mandatory
|
||||||
|
|
||||||
|
- **WM_THIRD_PARTY_DIR** : Location of third-party library sources etc
|
||||||
|
- **WM_PROJECT_DIR** : The OpenFOAM project directory. <br>
|
||||||
|
Used for `wmake` information, config files, etc
|
||||||
|
- **WM_ARCH** : The target architecture (eg, Linux64)
|
||||||
|
- **WM_OSTYPE** : The operating system type (eg, POSIX, MSwindows) <br>
|
||||||
|
Used as fallback for determining the ending for dynamic libraries.
|
||||||
|
Used for Windows-specific handling in scotch builds.
|
||||||
|
- **WM_COMPILER** : The compiler name (eg, Gcc, Clang)
|
||||||
|
- **WM_COMPILER_LIB_ARCH** : The target library ending (eg, 64). <br>
|
||||||
|
Typically used as `lib$WM_COMPILER_LIB_ARCH` to generate the name
|
||||||
|
`lib64`, for example.
|
||||||
|
- **WM_LABEL_SIZE** : The OpenFOAM size for `label` (eg, 32 for int32)
|
||||||
|
- **WM_PRECISION_OPTION** : The OpenFOAM representation for `scalar`
|
||||||
|
(eg, DP for double-precision)
|
||||||
|
- **FOAM_EXT_LIBBIN** : Common _pool_ for the library targets.
|
||||||
|
|
||||||
|
|
||||||
|
### MPI-related
|
||||||
|
|
||||||
|
- **FOAM_MPI** : The OpenFOAM MPI sub-directory name (eg, sys-openmpi)
|
||||||
|
- **WM_MPLIB** : The canonical OpenFOAM MPI name (eg, SYSTEMOPENMPI)
|
||||||
|
- **MPI_ARCH_PATH** : Location of the current MPI implementation.
|
||||||
|
Used for additional linkage, but primarily to set MPI_ROOT
|
||||||
|
for a cmake hint.
|
||||||
|
|
||||||
|
|
||||||
|
### Other
|
||||||
|
|
||||||
|
- **WM_CONTINUE_ON_ERROR** : Ignore build errors.
|
||||||
|
Mostly set internally from `wmake -k`.
|
||||||
|
- **WM_NCOMPPROCS** : The number of build processes to launch.
|
||||||
|
Often set internally from `wmake -j`.
|
||||||
|
- **WM_COMPILER_TYPE** : Used internally for a few build scripts.
|
||||||
|
Has values of `system` or `ThirdParty`.
|
||||||
|
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
Similar to OpenFOAM itself, the build and final output are separated
|
||||||
|
into different directories that contain a non-colliding hierarchy of
|
||||||
|
target names. However, in contrast to the OpenFOAM target names,
|
||||||
|
there are several different types of output targets:
|
||||||
|
|
||||||
|
- *ARCH* : (eg, `linux64`) <br>
|
||||||
|
Base infrastructure such as compiler and base libraries.
|
||||||
|
- *ARCH+COMPILER* : (eg, `linux64Gcc`) <br>
|
||||||
|
Compiler-specific libraries and applications.
|
||||||
|
- *ARCH+COMPILER+SIZING* : (eg, `linux64GccDPInt32`) <br>
|
||||||
|
Libraries and applications specific to a particular combination
|
||||||
|
of OpenFOAM scalar/label sizes. This is the same as the
|
||||||
|
***WM_OPTIONS*** value.
|
||||||
|
|
||||||
|
By default, the locations of the build and final targets are hard-coded
|
||||||
|
relative to the WM_THIRD_PARTY_DIR:
|
||||||
|
|
||||||
|
- WM_THIRD_PARTY_DIR<b>/build/</b> : intermediate build artifacts
|
||||||
|
- WM_THIRD_PARTY_DIR<b>/platforms/</b> : installation root
|
||||||
|
|
||||||
|
The expert user or sys-admin can influence these locations with the
|
||||||
|
following environment variables
|
||||||
|
|
||||||
|
- **FOAM_THIRD_PARTY_BUILDROOT** :
|
||||||
|
Replaces WM_THIRD_PARTY_DIR as the root for build/ and platforms/.<br>
|
||||||
|
***!! The specified build-root directory must exist !!***
|
||||||
|
|
||||||
|
- **FOAM_THIRD_PARTY_SOURCES** :
|
||||||
|
Provide alternative location to WM_THIRD_PARTY_DIR/sources
|
||||||
|
for finding source bundles.<br>
|
||||||
|
|
||||||
|
---
|
||||||
@ -1,4 +1,6 @@
|
|||||||
/* NOTE: make any changes to this file in etc/makeFiles/ */
|
/*
|
||||||
|
* NOTE: make any changes to this file in ThirdParty etc/makeFiles/
|
||||||
|
*/
|
||||||
|
|
||||||
libadf/ADF_interface.c
|
libadf/ADF_interface.c
|
||||||
libadf/ADF_internals.c
|
libadf/ADF_internals.c
|
||||||
@ -19,4 +21,4 @@ libccmio/ccmioversion.c
|
|||||||
libcgns/cgnslib.c
|
libcgns/cgnslib.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LIB = $(FOAM_EXT_LIBBIN)/libccmio
|
LIB = $(CCMIO_LIB_DIR)/libccmio
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
/* NOTE: make any changes to this file in etc/makeFiles/ */
|
/* NOTE: make any changes to this file in ThirdParty etc/wmakeFiles/ */
|
||||||
|
|
||||||
EXE_INC = -I.
|
EXE_INC = -I.
|
||||||
LIB_LIBS =
|
LIB_LIBS =
|
||||||
PROJECT_LIBS =
|
PROJECT_LIBS =
|
||||||
|
|
||||||
|
/* failsafe location */
|
||||||
|
ifeq (,$(strip $(CCMIO_LIB_DIR)))
|
||||||
|
CCMIO_LIB_DIR = $(FOAM_EXT_LIBBIN)
|
||||||
|
endif
|
||||||
|
|||||||
@ -38,6 +38,85 @@ installBASE="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
|
|||||||
# Synthetic value combining precision and label size (Eg, DPInt32)
|
# Synthetic value combining precision and label size (Eg, DPInt32)
|
||||||
WM_SIZE_OPTIONS="${WM_PRECISION_OPTION}Int${WM_LABEL_SIZE}"
|
WM_SIZE_OPTIONS="${WM_PRECISION_OPTION}Int${WM_LABEL_SIZE}"
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Make adjustments for non-standard build locations
|
||||||
|
|
||||||
|
# Specified a build-root
|
||||||
|
if [ -n "$FOAM_THIRD_PARTY_BUILDROOT" ]
|
||||||
|
then
|
||||||
|
if [ ! -d "$FOAM_THIRD_PARTY_BUILDROOT" ]
|
||||||
|
then
|
||||||
|
dir="$(dirname "$FOAM_THIRD_PARTY_BUILDROOT")"
|
||||||
|
if [ -d "$dir" ] && [ -w "$dir" ]
|
||||||
|
then
|
||||||
|
mkdir -m 0755 -p "$FOAM_THIRD_PARTY_BUILDROOT"
|
||||||
|
fi
|
||||||
|
# Also checks for failure of previous mkdir
|
||||||
|
if [ ! -d "$FOAM_THIRD_PARTY_BUILDROOT" ]
|
||||||
|
then
|
||||||
|
echo "Build-root: $FOAM_THIRD_PARTY_BUILDROOT" 1>&2
|
||||||
|
echo "Has invalid parent: $dir" 1>&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "Using build-root: $FOAM_THIRD_PARTY_BUILDROOT" 1>&2
|
||||||
|
|
||||||
|
# build/
|
||||||
|
_buildDir="${FOAM_THIRD_PARTY_BUILDROOT}/build"
|
||||||
|
mkdir -m 0755 -p "$_buildDir"
|
||||||
|
|
||||||
|
# Fully resolved
|
||||||
|
dir="$(cd "$_buildDir" 2>/dev/null && pwd -L)"
|
||||||
|
if [ -n "$dir" ]
|
||||||
|
then
|
||||||
|
buildBASE="$dir/$WM_ARCH$WM_COMPILER"
|
||||||
|
echo "Using build-dir: $dir" 1>&2
|
||||||
|
else
|
||||||
|
echo "Invalid build-dir: $_buildDir" 1>&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# platforms/
|
||||||
|
_platformsDir="${FOAM_THIRD_PARTY_BUILDROOT}/platforms"
|
||||||
|
mkdir -m 0755 -p "$_platformsDir"
|
||||||
|
|
||||||
|
# Fully resolved
|
||||||
|
dir="$(cd "$_platformsDir" 2>/dev/null && pwd -L)"
|
||||||
|
if [ -n "$dir" ]
|
||||||
|
then
|
||||||
|
installBASE="$dir/$WM_ARCH$WM_COMPILER"
|
||||||
|
echo "Using platforms-dir: $dir" 1>&2
|
||||||
|
else
|
||||||
|
echo "Invalid platforms-dir: $_platformsDir" 1>&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Installation with non-standard platforms location
|
||||||
|
nonStandardPlatforms() { true; }
|
||||||
|
else
|
||||||
|
# Installation with standard platforms location
|
||||||
|
nonStandardPlatforms() { false; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# sources/
|
||||||
|
if [ -n "$FOAM_THIRD_PARTY_SOURCES" ]
|
||||||
|
then
|
||||||
|
# Fully resolved
|
||||||
|
dir="$(cd "$FOAM_THIRD_PARTY_SOURCES" 2>/dev/null && pwd -L)"
|
||||||
|
if [ -n "$dir" ]
|
||||||
|
then
|
||||||
|
sourceBASE="$dir"
|
||||||
|
echo "Using sources-dir: $dir" 1>&2
|
||||||
|
else
|
||||||
|
echo "Invalid sources-dir: $FOAM_THIRD_PARTY_SOURCES" 1>&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Dynamic library ending (default is .so)
|
# Dynamic library ending (default is .so)
|
||||||
EXT_SO="$(wmake -show-ext-so 2>/dev/null)"
|
EXT_SO="$(wmake -show-ext-so 2>/dev/null)"
|
||||||
if [ -z "$EXT_SO" ]
|
if [ -z "$EXT_SO" ]
|
||||||
@ -53,6 +132,13 @@ then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# True if OS is <darwin>.
|
||||||
|
# Test EXT_SO for ".dylib" - avoid repeated uname system call
|
||||||
|
isDarwin()
|
||||||
|
{
|
||||||
|
[ "$EXT_SO" = .dylib ]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Fallback values, needed for our scotch Makefile which uses
|
# Fallback values, needed for our scotch Makefile which uses
|
||||||
# WM_CFLAGS and WM_LDFLAGS for arch information
|
# WM_CFLAGS and WM_LDFLAGS for arch information
|
||||||
@ -68,6 +154,7 @@ fi
|
|||||||
|
|
||||||
unset BUILD_SUFFIX
|
unset BUILD_SUFFIX
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Check for existence of shared library (without .so extension)
|
# Check for existence of shared library (without .so extension)
|
||||||
#
|
#
|
||||||
@ -237,15 +324,29 @@ useGccFlag()
|
|||||||
# Final fallback is <gcc>
|
# Final fallback is <gcc>
|
||||||
whichCC()
|
whichCC()
|
||||||
{
|
{
|
||||||
|
local fallback='gcc'
|
||||||
local comp="$CC"
|
local comp="$CC"
|
||||||
|
local warn
|
||||||
|
|
||||||
if [ -z "$comp" ]
|
if [ -z "$comp" ]
|
||||||
then
|
then
|
||||||
comp="$(wmake -show-c 2>/dev/null)" || comp="$WM_CC"
|
comp="$(wmake -show-c 2>/dev/null)" || comp="$WM_CC"
|
||||||
test -n "$comp" && command -v "$comp" >/dev/null || unset comp
|
if [ -n "$comp" ]
|
||||||
|
then
|
||||||
|
if ! command -v "$comp" >/dev/null
|
||||||
|
then
|
||||||
|
warn="C compiler '$comp' not found in path."
|
||||||
|
unset comp
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
echo "${comp:-gcc}"
|
warn="No C compiler found via wmake."
|
||||||
|
fi
|
||||||
|
if [ -n "$warn" ]
|
||||||
|
then
|
||||||
|
echo "${warn} Defaulting to '${fallback}'" 1>&2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "${comp:-$fallback}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -254,15 +355,29 @@ whichCC()
|
|||||||
# Final fallback is <g++>
|
# Final fallback is <g++>
|
||||||
whichCXX()
|
whichCXX()
|
||||||
{
|
{
|
||||||
|
local fallback='g++'
|
||||||
local comp="$CXX"
|
local comp="$CXX"
|
||||||
|
local warn
|
||||||
|
|
||||||
if [ -z "$comp" ]
|
if [ -z "$comp" ]
|
||||||
then
|
then
|
||||||
comp="$(wmake -show-cxx 2>/dev/null)" || comp="$WM_CXX"
|
comp="$(wmake -show-cxx 2>/dev/null)" || comp="$WM_CXX"
|
||||||
test -n "$comp" && command -v "$comp" >/dev/null || unset comp
|
if [ -n "$comp" ]
|
||||||
|
then
|
||||||
|
if ! command -v "$comp" >/dev/null
|
||||||
|
then
|
||||||
|
warn="CXX compiler '$comp' not found in path."
|
||||||
|
unset comp
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
echo "${comp:-g++}"
|
warn="No CXX compiler found via wmake."
|
||||||
|
fi
|
||||||
|
if [ -n "$warn" ]
|
||||||
|
then
|
||||||
|
echo "${warn} Defaulting to '${fallback}'" 1>&2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "${comp:-$fallback}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -275,7 +390,8 @@ whichCXX()
|
|||||||
# NOTE: could further refine based on "wmake -show-c", but not yet needed
|
# NOTE: could further refine based on "wmake -show-c", but not yet needed
|
||||||
whichMpicc()
|
whichMpicc()
|
||||||
{
|
{
|
||||||
local comp="$(command -v mpicc)"
|
local fallback='mpicc'
|
||||||
|
local comp="$(command -v $fallback)"
|
||||||
case "$WM_MPLIB" in
|
case "$WM_MPLIB" in
|
||||||
(FJMPI)
|
(FJMPI)
|
||||||
comp="$(command -v mpifcc)" # Fujitsu <mpifcc> available?
|
comp="$(command -v mpifcc)" # Fujitsu <mpifcc> available?
|
||||||
@ -287,7 +403,7 @@ whichMpicc()
|
|||||||
: "${comp:=cc}" # Cray <cc> if there is no <mpicc>
|
: "${comp:=cc}" # Cray <cc> if there is no <mpicc>
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo "${comp:-mpicc}"
|
echo "${comp:-$fallback}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -300,7 +416,8 @@ whichMpicc()
|
|||||||
# NOTE: could further refine based on "wmake -show-cxx", but not yet needed
|
# NOTE: could further refine based on "wmake -show-cxx", but not yet needed
|
||||||
whichMpicxx()
|
whichMpicxx()
|
||||||
{
|
{
|
||||||
local comp="$(command -v mpicxx)"
|
local fallback='mpicxx'
|
||||||
|
local comp="$(command -v $fallback)"
|
||||||
case "$WM_MPLIB" in
|
case "$WM_MPLIB" in
|
||||||
(FJMPI)
|
(FJMPI)
|
||||||
comp="$(command -v mpiFCC)" # Fujitsu <mpiFCC> available?
|
comp="$(command -v mpiFCC)" # Fujitsu <mpiFCC> available?
|
||||||
@ -309,10 +426,10 @@ whichMpicxx()
|
|||||||
comp="$(command -v mpiicpc)" # Intel <mpiicpc> available?
|
comp="$(command -v mpiicpc)" # Intel <mpiicpc> available?
|
||||||
;;
|
;;
|
||||||
(CRAY-MPI*)
|
(CRAY-MPI*)
|
||||||
: "${comp:=CC}" # Cray <CC> if there is no <mpicc>
|
: "${comp:=CC}" # Cray <CC> if there is no <mpicxx>
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo "${comp:-mpicxx}"
|
echo "${comp:-$fallback}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Require wmkdepend etc when building with wmake
|
# Require wmkdepend etc when building with wmake
|
||||||
@ -426,6 +543,7 @@ findSourceDir()
|
|||||||
|
|
||||||
for check in \
|
for check in \
|
||||||
"$package" \
|
"$package" \
|
||||||
|
"$subdir/$package" \
|
||||||
"sources/$package" \
|
"sources/$package" \
|
||||||
"sources/$subdir/$package" \
|
"sources/$subdir/$package" \
|
||||||
;
|
;
|
||||||
@ -501,7 +619,7 @@ listPackageVersions()
|
|||||||
|
|
||||||
[ -n "$package" ] || continue
|
[ -n "$package" ] || continue
|
||||||
|
|
||||||
for dir in . sources sources/"$package"
|
for dir in . ./"$package" sources sources/"$package"
|
||||||
do
|
do
|
||||||
# Find package-version (ie, when it has separators)
|
# Find package-version (ie, when it has separators)
|
||||||
find "$dir" -maxdepth 1 \
|
find "$dir" -maxdepth 1 \
|
||||||
|
|||||||
98
makeAdios2
98
makeAdios2
@ -5,7 +5,7 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2018-2020 OpenCFD Ltd.
|
# Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -49,19 +49,21 @@ then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# ADIOS2 version from OpenFOAM etc/config.sh file:
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
_foamConfig adios2
|
_foamConfig adios2
|
||||||
|
|
||||||
adiosPACKAGE=${adios2_version:-adios-none}
|
PACKAGE="${adios2_version:-none}"
|
||||||
|
|
||||||
# Hint for cmake findMPI
|
# Hint for cmake findMPI
|
||||||
if [ -d "$MPI_ARCH_PATH" ]
|
if [ -d "$MPI_ARCH_PATH" ]
|
||||||
@ -70,25 +72,25 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions adios; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [adios-VERSION]
|
Usage: ${0##*/} [OPTION] [adios-VERSION]
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if include/library already exists
|
-force Force compilation, even if include/library already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-cmake PATH With cmake from the given path
|
-cmake PATH With cmake from the given path
|
||||||
-mpi-home PATH With hint for MPI_HOME
|
-mpi-home PATH With hint for MPI_HOME
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* Build ADIOS2
|
* Build ADIOS2
|
||||||
$adiosPACKAGE
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint ADIOS2
|
showDownloadHint adios2
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler minimal # Minimal compiler info for CMake/configure
|
exportCompiler minimal # Minimal compiler info for CMake/configure
|
||||||
@ -100,7 +102,8 @@ while [ "$#" -gt 0 ]
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
|
|
||||||
@ -115,9 +118,11 @@ do
|
|||||||
case "${MPI_HOME:-none}" in (false|none) unset MPI_HOME;; esac
|
case "${MPI_HOME:-none}" in (false|none) unset MPI_HOME;; esac
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
adios/* | sources/ADIOS* | sources/adios* | \
|
||||||
ADIOS2-[0-9]* | ADIOS2-git* | ADIOS-[0-9]* | ADIOS-git* | \
|
ADIOS2-[0-9]* | ADIOS2-git* | ADIOS-[0-9]* | ADIOS-git* | \
|
||||||
adios2-[0-9]* | adios2-git* | adios-[0-9]* | adios-git*)
|
adios2-[0-9]* | adios2-git* | adios-[0-9]* | adios-git*)
|
||||||
adiosPACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unknown option/argument: '$1'"
|
die "unknown option/argument: '$1'"
|
||||||
@ -126,16 +131,12 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$adiosPACKAGE" ] || die "The adios2-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
# nothing to build
|
|
||||||
if _foamIsNone "$adiosPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using adios-none (skip ThirdParty build of ADIOS)"
|
die "The ADIOS package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem "$adiosPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using adios-system"
|
echo "Using none/system (skip ThirdParty build of ADIOS)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -155,44 +156,46 @@ esac
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build ADIOS
|
# Build ADIOS
|
||||||
# ADIOS2_SOURCE_DIR : location of the original sources
|
# *PACKAGE : name-version of the package
|
||||||
# ADIOS2_ARCH_PATH : installation directory
|
# *SOURCE : location of original sources
|
||||||
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
ADIOS2_SOURCE_DIR=$sourceBASE/$adiosPACKAGE
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
ADIOS2_ARCH_PATH=$installBASE/$adiosPACKAGE
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
: ${FOAM_MPI:=dummy}
|
: "${FOAM_MPI:=dummy}"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo ========================================
|
echo ========================================
|
||||||
echo "Build adios library $adiosPACKAGE for $FOAM_MPI"
|
echo "Build adios library $PACKAGE for $FOAM_MPI"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Needs future adjustment
|
# Needs future adjustment
|
||||||
# - for mpi-specific library locations
|
# - for mpi-specific library locations
|
||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& [ -f "$ADIOS2_ARCH_PATH/include/adios2.h" ] \
|
&& [ -f "$PKG_PREFIX/include/adios2.h" ] \
|
||||||
&& {
|
&& {
|
||||||
[ -r "$ADIOS2_ARCH_PATH/lib/libadios2$EXT_SO" ] \
|
[ -r "$PKG_PREFIX/lib/libadios2$EXT_SO" ] \
|
||||||
|| [ -r "$ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
|
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
|
||||||
}
|
}
|
||||||
then
|
then
|
||||||
echo " ADIOS2 already built : $ADIOS2_ARCH_PATH"
|
echo " ADIOS2 already built : $PKG_PREFIX"
|
||||||
else
|
else
|
||||||
# CMake options often lag the configure ones
|
# CMake options often lag the configure ones
|
||||||
echo "Starting build: $adiosPACKAGE (using cmake)"
|
echo "Starting build: $PACKAGE (using cmake)"
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
buildDIR=$buildBASE/$adiosPACKAGE
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
cd "$ADIOS2_SOURCE_DIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
|
|
||||||
applyPatch $adiosPACKAGE $ADIOS2_SOURCE_DIR
|
applyPatch "$PACKAGE" "$PKG_SOURCE"
|
||||||
|
|
||||||
# Remove any existing build folder and recreate
|
# Remove any existing build folder and recreate
|
||||||
rm -rf $ADIOS2_ARCH_DIR
|
rm -rf "$PKG_PREFIX"
|
||||||
rm -rf $buildDIR 2>/dev/null
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
|
|
||||||
# May not work properly with FOAM_MPI = dummy
|
# May not work properly with FOAM_MPI = dummy
|
||||||
if [ "$FOAM_MPI" != dummy ]
|
if [ "$FOAM_MPI" != dummy ]
|
||||||
@ -203,19 +206,20 @@ else
|
|||||||
|
|
||||||
cmake=$(findCMake)
|
cmake=$(findCMake)
|
||||||
|
|
||||||
# Install into lib64/
|
# Installs into lib64/
|
||||||
cd $buildDIR && $cmake \
|
cd "$PKG_BUILD" && set -x && \
|
||||||
-DCMAKE_INSTALL_PREFIX=$ADIOS2_ARCH_PATH \
|
${cmake:?} \
|
||||||
|
-DCMAKE_INSTALL_PREFIX="$PKG_PREFIX" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DADIOS2_USE_Fortran=FALSE \
|
-DADIOS2_USE_Fortran=FALSE \
|
||||||
-DADIOS2_BUILD_EXAMPLES=FALSE \
|
-DADIOS2_BUILD_EXAMPLES=FALSE \
|
||||||
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
||||||
$ADIOS2_SOURCE_DIR \
|
"$PKG_SOURCE" \
|
||||||
&& make -j $WM_NCOMPPROCS all \
|
&& make -j $WM_NCOMPPROCS all \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $adiosPACKAGE"
|
&& echo "Built: $PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $adiosPACKAGE"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|||||||
95
makeCCMIO
95
makeCCMIO
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -21,49 +21,51 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# libccmio version from OpenFOAM etc/config.sh file:
|
# libccmio version from OpenFOAM etc/config.sh file:
|
||||||
_foamConfig ccmio
|
_foamConfig ccmio
|
||||||
|
|
||||||
ccmioPACKAGE=${ccmio_version:-libccmio-2.6.1}
|
PACKAGE="${ccmio_version:-libccmio-2.6.1}"
|
||||||
targetType=lib # Default is static linkage
|
targetType=lib # Default is static linkage
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage()
|
printVersions() { listPackageVersions ccmio libccmio; exit 0; }
|
||||||
{
|
printHelp() {
|
||||||
exec 1>&2
|
cat<<USAGE
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
/bin/cat<<USAGE
|
|
||||||
|
|
||||||
Usage: ${0##*/} [OPTION] [lib|libso] [libccmio-VERSION]
|
Usage: ${0##*/} [OPTION] [lib|libso] [libccmio-VERSION]
|
||||||
options:
|
options:
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* Compile the proprietary libccmio library
|
* Compile the proprietary libccmio library
|
||||||
$ccmioPACKAGE
|
$PACKAGE
|
||||||
|
|
||||||
Users wishing to obtain the library should contact Siemens PLM (cd-adapco)
|
Users wishing to obtain the library should contact Siemens PLM (cd-adapco)
|
||||||
for terms of use.
|
for terms of use.
|
||||||
|
|
||||||
After obtaining the $ccmioPACKAGE library, place in folder
|
After obtaining the $PACKAGE library, place in folder
|
||||||
|
|
||||||
$WM_THIRD_PARTY_DIR/$ccmioPACKAGE/
|
$sourceBASE/$PACKAGE/
|
||||||
|
or $sourceBASE/sources/$PACKAGE/
|
||||||
|
|
||||||
prior to running this script.
|
prior to running this script.
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint CCMIO
|
showDownloadHint ccmio
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -72,14 +74,17 @@ while [ "$#" -gt 0 ]
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGccWmake ;;
|
-gcc) useGccWmake ;;
|
||||||
|
|
||||||
lib|libso)
|
lib|libso)
|
||||||
targetType="$1"
|
targetType="$1"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
libccmio/* | sources/libccmio* | \
|
||||||
libccmio-[0-9]*)
|
libccmio-[0-9]*)
|
||||||
ccmioPACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unknown option/argument: '$1'"
|
die "unknown option/argument: '$1'"
|
||||||
@ -94,54 +99,62 @@ requireExtLibBin
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build LIBCCMIO
|
# Build LIBCCMIO
|
||||||
#
|
# *PACKAGE : name-version of the package
|
||||||
CCMIO_SOURCE_DIR=$sourceBASE/$ccmioPACKAGE
|
# *SOURCE : location of original sources
|
||||||
CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
# Sources must be available
|
# Sources must be available
|
||||||
[ -d "$CCMIO_SOURCE_DIR" ] || die "Missing sources: '$ccmioPACKAGE'"
|
[ -d "$PKG_SOURCE" ] || die "Missing sources: '$PACKAGE'"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Manual installation
|
# Manual installation
|
||||||
#
|
#
|
||||||
install()
|
install()
|
||||||
{
|
{
|
||||||
# Ensure a clean build next time
|
local incdir="$PKG_PREFIX"/include/libccmio
|
||||||
|
|
||||||
|
# Remove build artifacts from the source directory
|
||||||
|
# (for a clean build next time)
|
||||||
wclean
|
wclean
|
||||||
|
|
||||||
local incdir=$CCMIO_ARCH_PATH/include/libccmio
|
echo
|
||||||
|
echo "Adjusting installation"
|
||||||
|
echo "Installing headers: $incdir"
|
||||||
|
|
||||||
# Make headers available:
|
# Make headers available
|
||||||
mkdir -m 0755 -p $incdir
|
mkdir -m 0755 -p "$incdir"
|
||||||
|
/bin/cp -pv "$PKG_SOURCE"/libccmio/ccmio*.h "$incdir"
|
||||||
/bin/cp -pv libccmio/ccmio*.h $incdir
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Starting build: $ccmioPACKAGE ($targetType)"
|
echo "Starting build: $PACKAGE ($targetType)"
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
cd "$CCMIO_SOURCE_DIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
rm -rf "$PKG_PREFIX"
|
||||||
|
rm -f "$FOAM_EXT_LIBBIN/libccmio$EXT_SO"
|
||||||
rm -rf $CCMIO_ARCH_PATH
|
|
||||||
rm -f $FOAM_EXT_LIBBIN/libccmio$EXT_SO
|
|
||||||
|
|
||||||
libdir=$CCMIO_ARCH_PATH/lib
|
|
||||||
|
|
||||||
cpMakeFiles libccmio 2>/dev/null
|
cpMakeFiles libccmio 2>/dev/null
|
||||||
|
|
||||||
# Place static libraries in sub-directory:
|
# Static libraries in sub-directory
|
||||||
if [ "$targetType" = lib ]
|
export CCMIO_LIB_DIR="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||||
|
|
||||||
|
# Dynamic libraries directly into FOAM_EXT_LIBBIN
|
||||||
|
if [ "$targetType" = libso ]
|
||||||
then
|
then
|
||||||
mkdir -m 0755 -p $libdir 2>/dev/null
|
CCMIO_LIB_DIR="$FOAM_EXT_LIBBIN"
|
||||||
export FOAM_EXT_LIBBIN=$libdir
|
|
||||||
fi
|
fi
|
||||||
|
mkdir -m 0755 -p "$CCMIO_LIB_DIR" 2>/dev/null
|
||||||
|
|
||||||
wmake -j $WM_NCOMPPROCS -s $targetType \
|
wmake -j $WM_NCOMPPROCS -s $targetType \
|
||||||
&& echo "Built: ccmio" \
|
&& echo "Built: $PACKAGE" \
|
||||||
&& install
|
&& install
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: ccmio"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
264
makeCGAL
264
makeCGAL
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2012-2016 OpenFOAM Foundation
|
# Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -60,34 +60,41 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
unset BOOST_ARCH_PATH CGAL_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH # Purge old
|
unset BOOST_ARCH_PATH CGAL_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH # Purge old
|
||||||
|
unset GMP_DIR MPFR_DIR # Purge hints used by CGAL cmake
|
||||||
|
|
||||||
# CGAL, boost and gmp/mpfr versions from OpenFOAM etc/config.sh files.
|
# CGAL, boost and gmp/mpfr versions from OpenFOAM etc/config.sh files.
|
||||||
# Get compiler first and let CGAL config override GMP and MPFR
|
# Get compiler first and let CGAL config override GMP and MPFR
|
||||||
_foamConfig compiler
|
_foamConfig compiler
|
||||||
_foamConfig CGAL
|
_foamConfig CGAL
|
||||||
|
|
||||||
boostPACKAGE=${boost_version:-boost-system}
|
BOOST_PACKAGE="${boost_version:-boost-system}"
|
||||||
gmpPACKAGE=${gmp_version:-gmp-system}
|
GMP_PACKAGE="${gmp_version:-gmp-system}"
|
||||||
mpfrPACKAGE=${mpfr_version:-mpfr-system}
|
MPFR_PACKAGE="${mpfr_version:-mpfr-system}"
|
||||||
cgalPACKAGE=$cgal_version
|
CGAL_PACKAGE="$cgal_version"
|
||||||
|
|
||||||
|
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||||
|
then
|
||||||
|
unset BOOST_ARCH_PATH CGAL_ARCH_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions boost cgal; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [CGAL-VERSION] [boost-VERSION] [gmp-VERSION] [mpfr-VERSION]
|
Usage: ${0##*/} [OPTION] [CGAL-VERSION] [boost-VERSION] [gmp-VERSION] [mpfr-VERSION]
|
||||||
options:
|
options:
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-cmake PATH Use cmake from the given path
|
-cmake PATH Use cmake from the given path
|
||||||
@ -95,13 +102,14 @@ options:
|
|||||||
-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
|
||||||
-system Use system versions for boost/gmp/mpfr
|
-system Use system versions for boost/gmp/mpfr
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build CGAL with
|
* build CGAL with
|
||||||
${cgalPACKAGE:-'unspecified CGAL version'}
|
${CGAL_PACKAGE:-[cgal unspecified]}
|
||||||
$boostPACKAGE
|
${BOOST_PACKAGE:-[boost unspecified]}
|
||||||
$gmpPACKAGE
|
${GMP_PACKAGE:-[gmp unspecified]}
|
||||||
$mpfrPACKAGE
|
${MPFR_PACKAGE:-[mpfr unspecified]}
|
||||||
|
|
||||||
Normally builds against ThirdParty boost and gmp/mpfr when possible.
|
Normally builds against ThirdParty boost and gmp/mpfr when possible.
|
||||||
To override this behaviour (and use the system boost and/or gmp/mpfr),
|
To override this behaviour (and use the system boost and/or gmp/mpfr),
|
||||||
@ -111,9 +119,9 @@ simply specify a 'system' version. For example,
|
|||||||
Use gmp-none to disable use of gmp/mpfr (eg, not available)
|
Use gmp-none to disable use of gmp/mpfr (eg, not available)
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint BOOST
|
showDownloadHint boost
|
||||||
showDownloadHint CGAL
|
showDownloadHint cgal
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -125,7 +133,8 @@ while [ "$#" -gt 0 ]
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
|
|
||||||
@ -138,9 +147,9 @@ do
|
|||||||
optToolset="${1#*=}"
|
optToolset="${1#*=}"
|
||||||
;;
|
;;
|
||||||
-sys*)
|
-sys*)
|
||||||
gmpPACKAGE="gmp-system"
|
GMP_PACKAGE="gmp-system"
|
||||||
mpfrPACKAGE="mpfr-system"
|
MPFR_PACKAGE="mpfr-system"
|
||||||
boostPACKAGE="boost-system"
|
BOOST_PACKAGE="boost-system"
|
||||||
unset BOOST_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH
|
unset BOOST_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
-no-lib)
|
-no-lib)
|
||||||
@ -150,19 +159,23 @@ do
|
|||||||
optHeadersOnly=false
|
optHeadersOnly=false
|
||||||
;;
|
;;
|
||||||
gmp-[0-9]* | gmp-system | gmp-none)
|
gmp-[0-9]* | gmp-system | gmp-none)
|
||||||
gmpPACKAGE="${1%%/}"
|
GMP_PACKAGE="${1%%/}"
|
||||||
unset GMP_ARCH_PATH
|
unset GMP_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
mpfr-[0-9]* | mpfr-system | mpfr-none)
|
mpfr-[0-9]* | mpfr-system | mpfr-none)
|
||||||
mpfrPACKAGE="${1%%/}"
|
MPFR_PACKAGE="${1%%/}"
|
||||||
unset MPFR_ARCH_PATH
|
unset MPFR_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
boost/* | sources/boost* | \
|
||||||
boost-[0-9]* | boost_[0-9]* | boost-system )
|
boost-[0-9]* | boost_[0-9]* | boost-system )
|
||||||
boostPACKAGE="${1%%/}"
|
BOOST_PACKAGE="${1%%/}"
|
||||||
unset BOOST_ARCH_PATH
|
unset BOOST_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
cgal/* | sources/cgal* | \
|
||||||
CGAL-[0-9]*)
|
CGAL-[0-9]*)
|
||||||
cgalPACKAGE="${1%%/}"
|
CGAL_PACKAGE="${1%%/}"
|
||||||
unset CGAL_ARCH_PATH
|
unset CGAL_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -172,15 +185,15 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$cgalPACKAGE" ] || die "The cgal-VERSION was not specified"
|
[ -n "$CGAL_PACKAGE" ] || die "The cgal-VERSION was not specified"
|
||||||
|
|
||||||
# Nothing to build
|
# Nothing to build
|
||||||
if _foamIsNone "$boostPACKAGE"
|
if _foamIsNone "$BOOST_PACKAGE"
|
||||||
then
|
then
|
||||||
echo "Using boost-none (skip ThirdParty build of BOOST/CGAL)"
|
echo "Using boost-none (skip ThirdParty build of BOOST/CGAL)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if _foamIsNone "$cgalPACKAGE"
|
if _foamIsNone "$CGAL_PACKAGE"
|
||||||
then
|
then
|
||||||
echo "Using cgal-none (skip ThirdParty build of CGAL)"
|
echo "Using cgal-none (skip ThirdParty build of CGAL)"
|
||||||
exit 0
|
exit 0
|
||||||
@ -200,29 +213,36 @@ fi
|
|||||||
# Headers-only - might be able to avoid gmp/mpfr?
|
# Headers-only - might be able to avoid gmp/mpfr?
|
||||||
## if [ "${optHeadersOnly:-false}" = true ]
|
## if [ "${optHeadersOnly:-false}" = true ]
|
||||||
## then
|
## then
|
||||||
## gmpPACKAGE=none
|
## GMP_PACKAGE=none
|
||||||
## mpfrPACKAGE=none
|
## MPFR_PACKAGE=none
|
||||||
## unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
## unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||||
## fi
|
## fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build Boost
|
# Build Boost
|
||||||
|
# BOOST_ARCH_PATH : installation directory (as per config file)
|
||||||
|
#
|
||||||
|
# *PACKAGE : name-version of the package
|
||||||
|
# *SOURCE : location of original sources
|
||||||
|
# *PREFIX : installation directory
|
||||||
|
#
|
||||||
# For 64-bit:
|
# For 64-bit:
|
||||||
# - system is normally built into 'lib64'
|
# - system is normally built into 'lib64'
|
||||||
# - use Third-Party 'lib64' for consistency.
|
# - use Third-Party 'lib64' for consistency.
|
||||||
# Boost 1_62_0 and older normally build into 'lib'.
|
# Boost 1_62_0 and older normally build into 'lib'.
|
||||||
#
|
|
||||||
# BOOST_ARCH_PATH : installation directory
|
|
||||||
# BOOST_SOURCE_DIR : location of the original sources
|
|
||||||
|
|
||||||
BOOST_SOURCE_DIR="$sourceBASE/$boostPACKAGE"
|
BOOST_SOURCE="$(findSourceDir "$BOOST_PACKAGE")"
|
||||||
: "${BOOST_ARCH_PATH:=$installBASE/$boostPACKAGE}"
|
BOOST_PACKAGE="$(basename "$BOOST_PACKAGE")"
|
||||||
|
BOOST_PREFIX="$installBASE/$BOOST_PACKAGE"
|
||||||
|
|
||||||
boostInc="$BOOST_ARCH_PATH/include"
|
# Override as per config file (if any)
|
||||||
boostLib="$BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
|
[ -n "$BOOST_ARCH_PATH" ] && BOOST_PREFIX="$BOOST_ARCH_PATH"
|
||||||
|
|
||||||
if _foamIsSystem "$boostPACKAGE"
|
boostInc="$BOOST_PREFIX/include"
|
||||||
|
boostLib="$BOOST_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||||
|
|
||||||
|
if _foamIsSystem "$BOOST_PACKAGE"
|
||||||
then
|
then
|
||||||
echo "Using boost-system (skip ThirdParty build of BOOST)"
|
echo "Using boost-system (skip ThirdParty build of BOOST)"
|
||||||
|
|
||||||
@ -230,16 +250,16 @@ then
|
|||||||
|
|
||||||
if [ -d "$boostInc" ]
|
if [ -d "$boostInc" ]
|
||||||
then
|
then
|
||||||
if BOOST_ARCH_PATH=$(cd "$BOOST_ARCH_PATH" 2>/dev/null && pwd -P)
|
if BOOST_PREFIX=$(cd "$BOOST_PREFIX" 2>/dev/null && pwd -P)
|
||||||
then
|
then
|
||||||
boostPACKAGE="${BOOST_ARCH_PATH##*/}"
|
BOOST_PACKAGE="$(basename "$BOOST_PREFIX")"
|
||||||
else
|
else
|
||||||
echo "ERROR: bad path for BOOST_ARCH_PATH"
|
echo "ERROR: bad path for BOOST_PREFIX"
|
||||||
echo "stopping build"
|
echo "stopping build"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
libdir="$BOOST_ARCH_PATH/lib"
|
libdir="$BOOST_PREFIX/lib"
|
||||||
else
|
else
|
||||||
boostInc="/usr/include"
|
boostInc="/usr/include"
|
||||||
boostLib="/usr/lib$WM_COMPILER_LIB_ARCH"
|
boostLib="/usr/lib$WM_COMPILER_LIB_ARCH"
|
||||||
@ -252,22 +272,23 @@ then
|
|||||||
elif [ -z "$optForce" ] \
|
elif [ -z "$optForce" ] \
|
||||||
&& [ -f "$boostInc/boost/version.hpp" ]
|
&& [ -f "$boostInc/boost/version.hpp" ]
|
||||||
then
|
then
|
||||||
echo "Using $boostPACKAGE"
|
echo "Using $BOOST_PACKAGE"
|
||||||
|
|
||||||
libdir="$BOOST_ARCH_PATH/lib"
|
libdir="$BOOST_PREFIX/lib"
|
||||||
|
|
||||||
# Use lib when lib64 does not exist
|
# Use lib when lib64 does not exist
|
||||||
[ -d "$libdir" -a ! -d "$boostLib" ] && boostLib="$libdir"
|
[ -d "$libdir" -a ! -d "$boostLib" ] && boostLib="$libdir"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Starting build: $boostPACKAGE"
|
echo "Starting build: $BOOST_PACKAGE"
|
||||||
echo
|
echo
|
||||||
# Absolute path for --libdir
|
# Absolute path for --libdir
|
||||||
|
|
||||||
(
|
(
|
||||||
# Write user-config.jam into source directory
|
# Write user-config.jam into source directory
|
||||||
cd "$BOOST_SOURCE_DIR" || exit
|
# this is not great, but project-config.jam is written there too
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
cd "$BOOST_SOURCE" || exit
|
||||||
|
export GIT_DIR="$PWD/.git" # Avoid seeing our own git-repo
|
||||||
|
|
||||||
# Configuration options:
|
# Configuration options:
|
||||||
unset buildOpt
|
unset buildOpt
|
||||||
@ -314,25 +335,26 @@ else
|
|||||||
# End of configuration options
|
# End of configuration options
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
|
||||||
rm -rf "$BOOST_ARCH_PATH"
|
rm -rf "$BOOST_PREFIX"
|
||||||
|
|
||||||
./bootstrap.sh \
|
./bootstrap.sh \
|
||||||
--prefix="$BOOST_ARCH_PATH" \
|
--prefix="$BOOST_PREFIX" \
|
||||||
--libdir="$boostLib" \
|
--libdir="$boostLib" \
|
||||||
--with-libraries=thread \
|
--with-libraries=thread \
|
||||||
--with-libraries=system \
|
--with-libraries=system \
|
||||||
--with-toolset="$optToolset" \
|
--with-toolset="$optToolset" \
|
||||||
&& ./b2 $buildOpt -j $WM_NCOMPPROCS install \
|
&& ./b2 $buildOpt -j $WM_NCOMPPROCS install \
|
||||||
&& echo "Built: boost"
|
&& echo "Built: $BOOST_PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: boost"
|
echo "Error building: $BOOST_PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Nothing left to build
|
# Nothing left to build
|
||||||
if _foamIsSystem "$cgalPACKAGE"
|
if _foamIsSystem "$CGAL_PACKAGE"
|
||||||
then
|
then
|
||||||
echo "Using cgal-system (skip ThirdParty build of CGAL)"
|
echo "Using cgal-system (skip ThirdParty build of CGAL)"
|
||||||
exit 0
|
exit 0
|
||||||
@ -360,23 +382,28 @@ fi
|
|||||||
# - use Third-Party 'lib64' for consistency.
|
# - use Third-Party 'lib64' for consistency.
|
||||||
# CGAL-4.9 normally builds into 'lib64', older versions into 'lib'.
|
# CGAL-4.9 normally builds into 'lib64', older versions into 'lib'.
|
||||||
#
|
#
|
||||||
# CGAL_SOURCE_DIR : location of the original sources
|
# *PACKAGE : name-version of the package
|
||||||
# CGAL_BUILD_DIR : location of the build
|
# *SOURCE : location of original sources
|
||||||
# CGAL_ARCH_PATH : installation directory
|
# *PREFIX : installation directory
|
||||||
|
# CGAL_ARCH_PATH : installation directory (as per config file)
|
||||||
|
|
||||||
|
CGAL_SOURCE="$(findSourceDir "$CGAL_PACKAGE")"
|
||||||
|
CGAL_PACKAGE="$(basename "$CGAL_PACKAGE")"
|
||||||
|
CGAL_PREFIX="$installBASE$WM_SIZE_OPTIONS/$CGAL_PACKAGE"
|
||||||
|
|
||||||
|
# Override as per config file (if any)
|
||||||
|
[ -n "$CGAL_ARCH_PATH" ] && CGAL_PREFIX="$CGAL_ARCH_PATH"
|
||||||
|
|
||||||
CGAL_SOURCE_DIR="$sourceBASE/$cgalPACKAGE"
|
|
||||||
CGAL_BUILD_DIR="$buildBASE/$cgalPACKAGE"
|
|
||||||
: "${CGAL_ARCH_PATH:=$installBASE/$cgalPACKAGE}"
|
|
||||||
|
|
||||||
# gmp/mpfr are installed without compiler name
|
# gmp/mpfr are installed without compiler name
|
||||||
mpfrBASE="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH"
|
archBASE="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH"
|
||||||
|
|
||||||
# Enable/disable gmp/mpfr together
|
# Enable/disable gmp/mpfr together
|
||||||
if _foamIsNone "$gmpPACKAGE" || _foamIsNone "$mpfrPACKAGE"
|
if _foamIsNone "$GMP_PACKAGE" || _foamIsNone "$MPFR_PACKAGE"
|
||||||
then
|
then
|
||||||
GMP_ARCH_PATH=none
|
GMP_ARCH_PATH=none
|
||||||
MPFR_ARCH_PATH=none
|
MPFR_ARCH_PATH=none
|
||||||
elif _foamIsSystem "$gmpPACKAGE" || _foamIsSystem "$mpfrPACKAGE"
|
elif _foamIsSystem "$GMP_PACKAGE" || _foamIsSystem "$MPFR_PACKAGE"
|
||||||
then
|
then
|
||||||
# May really be system, but could also by a central installation
|
# May really be system, but could also by a central installation
|
||||||
# Ensure everything is accurately recorded. Resolve paths etc.
|
# Ensure everything is accurately recorded. Resolve paths etc.
|
||||||
@ -385,7 +412,7 @@ then
|
|||||||
then
|
then
|
||||||
if GMP_ARCH_PATH=$(cd "$GMP_ARCH_PATH" 2>/dev/null && pwd -P)
|
if GMP_ARCH_PATH=$(cd "$GMP_ARCH_PATH" 2>/dev/null && pwd -P)
|
||||||
then
|
then
|
||||||
gmpPACKAGE="${GMP_ARCH_PATH##*/}"
|
GMP_PACKAGE="${GMP_ARCH_PATH##*/}"
|
||||||
else
|
else
|
||||||
echo "ERROR: bad path for GMP_ARCH_PATH"
|
echo "ERROR: bad path for GMP_ARCH_PATH"
|
||||||
echo "stopping build"
|
echo "stopping build"
|
||||||
@ -399,7 +426,7 @@ then
|
|||||||
then
|
then
|
||||||
if MPFR_ARCH_PATH=$(cd "$MPFR_ARCH_PATH" 2>/dev/null && pwd -P)
|
if MPFR_ARCH_PATH=$(cd "$MPFR_ARCH_PATH" 2>/dev/null && pwd -P)
|
||||||
then
|
then
|
||||||
mpfrPACKAGE="${MPFR_ARCH_PATH##*/}"
|
MPFR_PACKAGE="${MPFR_ARCH_PATH##*/}"
|
||||||
else
|
else
|
||||||
echo "ERROR: bad path for MPFR_ARCH_PATH"
|
echo "ERROR: bad path for MPFR_ARCH_PATH"
|
||||||
echo "stopping build"
|
echo "stopping build"
|
||||||
@ -409,8 +436,10 @@ then
|
|||||||
MPFR_ARCH_PATH=system
|
MPFR_ARCH_PATH=system
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
GMP_ARCH_PATH="$mpfrBASE/$gmpPACKAGE"
|
|
||||||
MPFR_ARCH_PATH="$mpfrBASE/$mpfrPACKAGE"
|
# Respect the *ARCH_PATH if set
|
||||||
|
[ -d "$GMP_ARCH_PATH" ] || GMP_ARCH_PATH="$archBASE/$GMP_PACKAGE"
|
||||||
|
[ -d "$MPFR_ARCH_PATH" ] || MPFR_ARCH_PATH="$archBASE/$MPFR_PACKAGE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
@ -418,27 +447,27 @@ fi
|
|||||||
cat<<SUMMARY
|
cat<<SUMMARY
|
||||||
CGAL configuration
|
CGAL configuration
|
||||||
------------------
|
------------------
|
||||||
CGAL = $cgalPACKAGE
|
CGAL = $CGAL_PACKAGE
|
||||||
BOOST = $boostPACKAGE
|
BOOST = $BOOST_PACKAGE
|
||||||
GMP = $gmpPACKAGE
|
GMP = $GMP_PACKAGE
|
||||||
MPFR = $mpfrPACKAGE
|
MPFR = $MPFR_PACKAGE
|
||||||
------------------
|
------------------
|
||||||
SUMMARY
|
SUMMARY
|
||||||
|
|
||||||
#
|
#
|
||||||
# build information recorded for later use
|
# build information recorded for later use
|
||||||
#
|
#
|
||||||
buildInfoFile=$CGAL_ARCH_PATH/share/openfoam-build
|
buildInfoFile="$CGAL_PREFIX"/share/openfoam-build
|
||||||
|
|
||||||
recordCGALinfo()
|
recordCGALinfo()
|
||||||
{
|
{
|
||||||
CGAL_VERSION=$(sed -ne 's/^ *# *define *CGAL_VERSION_NR *\([0-9][0-9]*\).*$/\1/p' $CGAL_ARCH_PATH/include/CGAL/version.h 2>/dev/null)
|
CGAL_VERSION=$(sed -ne 's/^ *# *define *CGAL_VERSION_NR *\([0-9][0-9]*\).*$/\1/p' $CGAL_PREFIX/include/CGAL/version.h 2>/dev/null)
|
||||||
|
|
||||||
cat<<BUILD_INFO > $buildInfoFile
|
cat<<BUILD_INFO > "$buildInfoFile"
|
||||||
# Information from OpenFOAM build on '$(date)'
|
# Information from OpenFOAM build on '$(date)'
|
||||||
#
|
#
|
||||||
CGAL=${CGAL_ARCH_PATH##*/}
|
CGAL=${CGAL_PREFIX##*/}
|
||||||
BOOST=${BOOST_ARCH_PATH##*/}
|
BOOST=${BOOST_PREFIX##*/}
|
||||||
GMP=${GMP_ARCH_PATH##*/}
|
GMP=${GMP_ARCH_PATH##*/}
|
||||||
MPFR=${MPFR_ARCH_PATH##*/}
|
MPFR=${MPFR_ARCH_PATH##*/}
|
||||||
CGAL_VERSION=$CGAL_VERSION
|
CGAL_VERSION=$CGAL_VERSION
|
||||||
@ -477,10 +506,10 @@ cgalIsCurrent()
|
|||||||
local libDirName="lib$WM_COMPILER_LIB_ARCH"
|
local libDirName="lib$WM_COMPILER_LIB_ARCH"
|
||||||
|
|
||||||
echo "checking information from existing build ..."
|
echo "checking information from existing build ..."
|
||||||
echo " ${CGAL_ARCH_PATH}"
|
echo " ${CGAL_PREFIX}"
|
||||||
|
|
||||||
infoValueEq CGAL "${CGAL_ARCH_PATH##*/}" "$info" || return 1
|
infoValueEq CGAL "${CGAL_PREFIX##*/}" "$info" || return 1
|
||||||
infoValueEq BOOST "${BOOST_ARCH_PATH##*/}" "$info" || return 1
|
infoValueEq BOOST "${BOOST_PREFIX##*/}" "$info" || return 1
|
||||||
infoValueEq GMP "${GMP_ARCH_PATH##*/}" "$info" || return 1
|
infoValueEq GMP "${GMP_ARCH_PATH##*/}" "$info" || return 1
|
||||||
infoValueEq MPFR "${MPFR_ARCH_PATH##*/}" "$info" || return 1
|
infoValueEq MPFR "${MPFR_ARCH_PATH##*/}" "$info" || return 1
|
||||||
infoValueEq BOOST_VERSION "${BOOST_VERSION}" "$info" || return 1
|
infoValueEq BOOST_VERSION "${BOOST_VERSION}" "$info" || return 1
|
||||||
@ -494,48 +523,44 @@ cgalIsCurrent()
|
|||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& cgalIsCurrent
|
&& cgalIsCurrent
|
||||||
then
|
then
|
||||||
echo " ${CGAL_ARCH_PATH##*/} build appears to be up-to-date - skipping"
|
echo " ${CGAL_PREFIX##*/} build appears to be up-to-date - skipping"
|
||||||
echo
|
echo
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
(
|
(
|
||||||
# Remove any existing build folder and recreate
|
export GIT_DIR="$CGAL_SOURCE/.git"
|
||||||
if [ -d "$CGAL_BUILD_DIR" ]
|
PKG_BUILD="$buildBASE/$CGAL_PACKAGE"
|
||||||
then
|
|
||||||
echo "removing old build directory"
|
|
||||||
echo " $CGAL_BUILD_DIR"
|
|
||||||
rm -rf "$CGAL_BUILD_DIR"
|
|
||||||
fi
|
|
||||||
mkdir -p "$CGAL_BUILD_DIR"
|
|
||||||
|
|
||||||
cd "$CGAL_BUILD_DIR" || exit
|
# Remove existing build
|
||||||
export GIT_DIR="$CGAL_SOURCE_DIR/.git" # Mask seeing our own git-repo
|
rm -rf "$PKG_BUILD"
|
||||||
|
mkdir -p "$PKG_BUILD"
|
||||||
|
cd "$PKG_BUILD" || exit
|
||||||
|
|
||||||
unset configBoost configGmp configMpfr
|
unset configBoost configGmp configMpfr
|
||||||
echo "----"
|
echo "----"
|
||||||
echo "Configuring $cgalPACKAGE with boost $BOOST_VERSION"
|
echo "Configuring $CGAL_PACKAGE with boost $BOOST_VERSION"
|
||||||
echo " Source : $CGAL_SOURCE_DIR"
|
echo " Source : $CGAL_SOURCE"
|
||||||
echo " Build : $CGAL_BUILD_DIR"
|
echo " Build : $CGAL_BUILD"
|
||||||
echo " Target : $CGAL_ARCH_PATH"
|
echo " Target : $CGAL_PREFIX"
|
||||||
|
|
||||||
|
|
||||||
# See http://doc.cgal.org/latest/Manual/installation.html
|
# See http://doc.cgal.org/latest/Manual/installation.html
|
||||||
if _foamIsSystem "$boostPACKAGE"
|
if _foamIsSystem "$BOOST_PACKAGE"
|
||||||
then
|
then
|
||||||
# Tagged as 'system' but could actually point to a central location
|
# Tagged as 'system' but could actually point to a central location
|
||||||
if [ -d "$BOOST_ARCH_PATH/include" ]
|
if [ -d "$BOOST_PREFIX/include" ]
|
||||||
then
|
then
|
||||||
echo " boost : ${BOOST_ARCH_PATH##*/}"
|
echo " boost : ${BOOST_PREFIX##*/}"
|
||||||
configBoost="-DBOOST_ROOT=$BOOST_ARCH_PATH"
|
configBoost="-DBOOST_ROOT=$BOOST_PREFIX"
|
||||||
else
|
else
|
||||||
echo " boost : system"
|
echo " boost : system"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## For system - possible that /usr/lib64 not being found?
|
## For system - possible that /usr/lib64 not being found?
|
||||||
## configBoost="-DBoost_LIBRARY_DIRS=$boostLib"
|
## configBoost="-DBoost_LIBRARY_DIRS=$boostLib"
|
||||||
elif [ -d "$BOOST_ARCH_PATH" ]
|
elif [ -d "$BOOST_PREFIX" ]
|
||||||
then
|
then
|
||||||
echo " boost : $boostPACKAGE"
|
echo " boost : $BOOST_PACKAGE"
|
||||||
configBoost=$(cat <<CMAKE_OPTIONS
|
configBoost=$(cat <<CMAKE_OPTIONS
|
||||||
-DBoost_INCLUDE_DIR=$boostInc
|
-DBoost_INCLUDE_DIR=$boostInc
|
||||||
-DBoost_LIBRARY_DIRS=$boostLib
|
-DBoost_LIBRARY_DIRS=$boostLib
|
||||||
@ -557,11 +582,12 @@ CMAKE_OPTIONS
|
|||||||
configGmp="-DCGAL_DISABLE_GMP=TRUE" # Also used for mpfr
|
configGmp="-DCGAL_DISABLE_GMP=TRUE" # Also used for mpfr
|
||||||
elif [ -d "$GMP_ARCH_PATH" ]
|
elif [ -d "$GMP_ARCH_PATH" ]
|
||||||
then
|
then
|
||||||
echo " gmp : $gmpPACKAGE"
|
echo " gmp : $GMP_PACKAGE"
|
||||||
|
|
||||||
|
# Alternative: export GMP_DIR=... hint
|
||||||
for libdir in \
|
for libdir in \
|
||||||
$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
"$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
$GMP_ARCH_PATH/lib \
|
"$GMP_ARCH_PATH"/lib \
|
||||||
;
|
;
|
||||||
do
|
do
|
||||||
if [ -f "$libdir/libgmp$EXT_SO" ]
|
if [ -f "$libdir/libgmp$EXT_SO" ]
|
||||||
@ -588,11 +614,12 @@ CMAKE_OPTIONS
|
|||||||
configGmp="-DCGAL_DISABLE_GMP=TRUE" # Also used for mpfr
|
configGmp="-DCGAL_DISABLE_GMP=TRUE" # Also used for mpfr
|
||||||
elif [ -d "$MPFR_ARCH_PATH" ]
|
elif [ -d "$MPFR_ARCH_PATH" ]
|
||||||
then
|
then
|
||||||
echo " mpfr : $mpfrPACKAGE"
|
echo " mpfr : $MPFR_PACKAGE"
|
||||||
|
|
||||||
|
# Alternative: export MPFR_DIR=... hint
|
||||||
for libdir in \
|
for libdir in \
|
||||||
$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
"$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
$MPFR_ARCH_PATH/lib \
|
"$MPFR_ARCH_PATH/lib" \
|
||||||
;
|
;
|
||||||
do
|
do
|
||||||
if [ -f "$libdir/libmpfr$EXT_SO" ]
|
if [ -f "$libdir/libmpfr$EXT_SO" ]
|
||||||
@ -633,10 +660,10 @@ CMAKE_OPTIONS
|
|||||||
# For CGAL < 4.9, for installation into lib64/, not lib/
|
# For CGAL < 4.9, for installation into lib64/, not lib/
|
||||||
# Name only (not path) for CGAL_INSTALL_LIB_DIR
|
# Name only (not path) for CGAL_INSTALL_LIB_DIR
|
||||||
echo "----"
|
echo "----"
|
||||||
set -x
|
set -x && \
|
||||||
$cmake \
|
${cmake:?} \
|
||||||
-DCMAKE_INSTALL_PREFIX=$CGAL_ARCH_PATH \
|
-DCMAKE_INSTALL_PREFIX="$CGAL_PREFIX" \
|
||||||
-DCGAL_INSTALL_LIB_DIR=lib$WM_COMPILER_LIB_ARCH \
|
-DCGAL_INSTALL_LIB_DIR="lib$WM_COMPILER_LIB_ARCH" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DWITH_CGAL_Core=OFF \
|
-DWITH_CGAL_Core=OFF \
|
||||||
-DWITH_CGAL_ImageIO=OFF \
|
-DWITH_CGAL_ImageIO=OFF \
|
||||||
@ -644,26 +671,27 @@ CMAKE_OPTIONS
|
|||||||
$cmakeDefs \
|
$cmakeDefs \
|
||||||
$configBoost $configGmp $configMpfr \
|
$configBoost $configGmp $configMpfr \
|
||||||
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
||||||
$CGAL_SOURCE_DIR \
|
"$CGAL_SOURCE" \
|
||||||
&& set +x \
|
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
|
&& set +x \
|
||||||
&& make install || exit 1
|
&& make install || exit 1
|
||||||
|
|
||||||
echo "----"
|
echo "----"
|
||||||
echo "create '\$CGAL_ARCH_PATH/share/files'"
|
echo "create '\$CGAL_PREFIX/share/files'"
|
||||||
echo "----"
|
echo "----"
|
||||||
mkdir -p $CGAL_ARCH_PATH/share/src
|
mkdir -p "$CGAL_PREFIX"/share/src
|
||||||
rm -f $CGAL_ARCH_PATH/share/files
|
rm -f "$CGAL_PREFIX"/share/files
|
||||||
|
|
||||||
for i in assertions.cpp io.cpp MP_Float.cpp Random.cpp
|
for i in assertions.cpp io.cpp MP_Float.cpp Random.cpp
|
||||||
do
|
do
|
||||||
if [ -e "$CGAL_SOURCE_DIR/src/CGAL/$i" ]
|
if [ -e "$CGAL_SOURCE/src/CGAL/$i" ]
|
||||||
then
|
then
|
||||||
\cp $CGAL_SOURCE_DIR/src/CGAL/$i $CGAL_ARCH_PATH/share/src/
|
\cp "$CGAL_SOURCE/src/CGAL/$i" "$CGAL_PREFIX"/share/src/
|
||||||
echo "\${CGAL_ARCH_PATH}/share/src/$i" >> $CGAL_ARCH_PATH/share/files
|
echo "\${CGAL_PREFIX}/share/src/$i" >> "$CGAL_PREFIX"/share/files
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Record our build-status
|
# Record our build-status
|
||||||
recordCGALinfo
|
recordCGALinfo
|
||||||
|
|
||||||
|
|||||||
95
makeCmake
95
makeCmake
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011 OpenFOAM Foundation
|
# Copyright (C) 2011 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -24,38 +24,40 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Special purpose script - no default version.
|
# Special purpose script - no default version
|
||||||
unset cmakePACKAGE
|
unset PACKAGE
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions cmake; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] cmake-VERSION
|
Usage: ${0##*/} [OPTION] cmake-VERSION
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if binary already exists
|
-force Force compilation, even if binary already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-link Create additional symlink as 'cmake-system'
|
-link Create additional symlink as 'cmake-system'
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build cmake
|
* Build cmake
|
||||||
${cmakePACKAGE:-'unspecified'}
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint CMAKE
|
showDownloadHint cmake
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -67,13 +69,15 @@ while [ "$#" -gt 0 ]
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
-link) optLink=true ;;
|
-link) optLink=true ;;
|
||||||
|
|
||||||
|
cmake/* | sources/cmake* | \
|
||||||
cmake-[0-9]*)
|
cmake-[0-9]*)
|
||||||
cmakePACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unknown option/argument: '$1'"
|
die "unknown option/argument: '$1'"
|
||||||
@ -82,55 +86,60 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$cmakePACKAGE" ] || die "The cmake-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
if _foamIsSystem "$cmakePACKAGE"
|
|
||||||
then
|
then
|
||||||
unset optLink # basic sanity - cannot
|
die "The CMAKE package/version not specified"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if _foamIsSystem "$PACKAGE"
|
||||||
|
then
|
||||||
|
unset optLink # basic sanity - cannot create a link
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build CMAKE
|
# Build CMAKE
|
||||||
# CMAKE_SOURCE_DIR : location of the original sources
|
# *PACKAGE : name-version of the package
|
||||||
# CMAKE_ARCH_PATH : installation directory
|
# *SOURCE : location of original sources
|
||||||
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
CMAKE_SOURCE_DIR=$sourceBASE/$cmakePACKAGE
|
|
||||||
CMAKE_ARCH_PATH=$installBASE/$cmakePACKAGE
|
|
||||||
|
|
||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& [ -d "$CMAKE_ARCH_PATH" ] \
|
&& [ -d "$PKG_PREFIX" ] \
|
||||||
&& [ -r "$CMAKE_ARCH_PATH/bin/cmake" ]
|
&& [ -r "$PKG_PREFIX/bin/cmake" ]
|
||||||
then
|
then
|
||||||
echo "Already built: $cmakePACKAGE"
|
echo "Already built: $PACKAGE"
|
||||||
else
|
else
|
||||||
echo "Starting build: $cmakePACKAGE"
|
echo "Starting build: $PACKAGE"
|
||||||
(
|
(
|
||||||
buildDIR=$buildBASE/$cmakePACKAGE
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
cd "$PKG_SOURCE" || exit
|
||||||
|
make distclean 2>/dev/null || true
|
||||||
|
|
||||||
cd "$CMAKE_SOURCE_DIR" || exit
|
rm -rf "$PKG_BUILD"
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
mkdir -p "$PKG_BUILD"
|
||||||
make distclean 2>/dev/null
|
|
||||||
|
|
||||||
rm -rf $buildDIR
|
cd "$PKG_BUILD" && \
|
||||||
mkdir -p $buildDIR
|
"$PKG_SOURCE"/bootstrap \
|
||||||
cd $buildDIR
|
--prefix="$PKG_PREFIX" \
|
||||||
|
|
||||||
$CMAKE_SOURCE_DIR/bootstrap \
|
|
||||||
--prefix=$CMAKE_ARCH_PATH \
|
|
||||||
&& time make -j $WM_NCOMPPROCS \
|
&& time make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $cmakePACKAGE"
|
&& echo "Built: $PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $cmakePACKAGE"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$optLink" = true ] && [ -x "$CMAKE_ARCH_PATH/bin/cmake" ]
|
if [ "$optLink" = true ] && [ -x "$PKG_PREFIX/bin/cmake" ]
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
cd "${CMAKE_ARCH_PATH%/*}" || exit
|
cd "${PKG_PREFIX%/*}" || exit
|
||||||
if [ -L cmake-system ]
|
if [ -L cmake-system ]
|
||||||
then
|
then
|
||||||
rm cmake-system
|
rm cmake-system
|
||||||
@ -138,7 +147,7 @@ then
|
|||||||
then
|
then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
ln -svf "$cmakePACKAGE" cmake-system
|
ln -svf "$PACKAGE" cmake-system
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
98
makeFFTW
98
makeFFTW
@ -6,7 +6,7 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -47,39 +47,40 @@ then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
# FFTW version from OpenFOAM etc/config.sh file:
|
|
||||||
_foamConfig FFTW
|
_foamConfig FFTW
|
||||||
|
|
||||||
fftwPACKAGE="${fftw_version:-fftw-system}"
|
PACKAGE="${fftw_version:-none}"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions fftw; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [fftw-VERSION] [-- configure-options]
|
Usage: ${0##*/} [OPTION] [fftw-VERSION] [-- configure-options]
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if include/library already exists
|
-force Force compilation, even if include/library already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build FFTW with
|
* build FFTW with
|
||||||
${fftwPACKAGE:-'unspecified FFTW version'}
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint FFTW
|
showDownloadHint fftw
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -92,12 +93,14 @@ do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
|
|
||||||
|
fftw/* | sources/fftw* | \
|
||||||
fftw-[0-9]* | fftw_[0-9]* | fftw-system )
|
fftw-[0-9]* | fftw_[0-9]* | fftw-system )
|
||||||
fftwPACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unknown option/argument: '$1'"
|
die "unknown option/argument: '$1'"
|
||||||
@ -106,44 +109,43 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$fftwPACKAGE" ] || die "The fftw-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone "$fftwPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using fftw-none (skip ThirdParty build of FFTW)"
|
die "The FFTW package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem "$fftwPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using fftw-system (skip ThirdParty build of FFTW)"
|
echo "Using none/system (skip ThirdParty build of FFTW)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build FFTW
|
# Build FFTW
|
||||||
|
# *PACKAGE : name-version of the package
|
||||||
|
# *SOURCE : location of original sources
|
||||||
|
# *PREFIX : installation directory
|
||||||
|
#
|
||||||
# For 64-bit
|
# For 64-bit
|
||||||
# - FFTW itself will normally build into 'lib64',
|
# - FFTW itself will normally build into 'lib64',
|
||||||
# but provide --libdir on configure to be 100% certain
|
# but provide --libdir on configure to be 100% certain
|
||||||
# - Third-Party builds into 'lib64'
|
# - Third-Party builds into 'lib64'
|
||||||
# - system is normally built into 'lib64'
|
# - system is normally built into 'lib64'
|
||||||
#
|
|
||||||
# FFTW_SOURCE_DIR : location of the original sources
|
|
||||||
# FFTW_ARCH_PATH : installation directory
|
|
||||||
|
|
||||||
FFTW_SOURCE_DIR="$sourceBASE/$fftwPACKAGE"
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
FFTW_ARCH_PATH="$installBASE/$fftwPACKAGE"
|
PACKAGE="$(basename "$PKG_SOURCE")"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& {
|
&& {
|
||||||
[ -r "$FFTW_ARCH_PATH/lib/libfftw3$EXT_SO" ] \
|
[ -r "$PKG_PREFIX/lib/libfftw3$EXT_SO" ] \
|
||||||
|| [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ] \
|
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ] \
|
||||||
|| [ -r "$FFTW_ARCH_PATH/bin/libfftw3-3$EXT_SO" ] # Windows
|
|| [ -r "$PKG_PREFIX/bin/libfftw3-3$EXT_SO" ] # Windows
|
||||||
}
|
}
|
||||||
then
|
then
|
||||||
echo "FFTW already built : $FFTW_ARCH_PATH"
|
echo "FFTW already built : $PKG_PREFIX"
|
||||||
else
|
else
|
||||||
echo "Starting build: FFTW ($fftwPACKAGE)"
|
echo "Starting build: FFTW ($PACKAGE)"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
(
|
(
|
||||||
@ -174,32 +176,30 @@ else
|
|||||||
|
|
||||||
# End of configuration options
|
# End of configuration options
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
buildDIR="$buildBASE/$fftwPACKAGE"
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
cd "$PKG_SOURCE" || exit
|
||||||
|
|
||||||
cd "$FFTW_SOURCE_DIR" || exit
|
rm -rf "$PKG_PREFIX"
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
rm -rf "$PKG_BUILD"
|
||||||
|
mkdir -p "$PKG_BUILD"
|
||||||
|
|
||||||
rm -rf "$FFTW_ARCH_PATH"
|
cd "$PKG_BUILD" && set -x && \
|
||||||
rm -rf "$buildDIR"
|
"$PKG_SOURCE"/configure \
|
||||||
mkdir -p "$buildDIR"
|
--prefix="$PKG_PREFIX" \
|
||||||
cd "$buildDIR"
|
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
|
|
||||||
set -x
|
|
||||||
"$FFTW_SOURCE_DIR"/configure \
|
|
||||||
--prefix="$FFTW_ARCH_PATH" \
|
|
||||||
--libdir="$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" \
|
|
||||||
--enable-shared --disable-static \
|
--enable-shared --disable-static \
|
||||||
--disable-fortran \
|
--disable-fortran \
|
||||||
$configOpt \
|
$configOpt \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built $fftwPACKAGE" \
|
&& echo "Built: $PACKAGE" \
|
||||||
&& pkgconfigAdjust "$FFTW_ARCH_PATH"
|
&& pkgconfigAdjust "$PKG_PREFIX"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: FFTW"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
290
makeGcc
290
makeGcc
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -33,14 +33,16 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
unset GMP_ARCH_PATH MPFR_ARCH_PATH # Purge old
|
unset GMP_ARCH_PATH MPFR_ARCH_PATH # Purge old
|
||||||
|
|
||||||
@ -50,18 +52,17 @@ WM_COMPILER_TYPE=ThirdParty # Ensure we get the correct settings
|
|||||||
# Default GCC, mpfr, gmp and mpc versions from OpenFOAM etc/config.sh file:
|
# Default GCC, mpfr, gmp and mpc versions from OpenFOAM etc/config.sh file:
|
||||||
_foamConfig compiler
|
_foamConfig compiler
|
||||||
|
|
||||||
gmpPACKAGE=${gmp_version:-gmp-system}
|
GMP_PACKAGE="${gmp_version:-gmp-system}"
|
||||||
mpfrPACKAGE=${mpfr_version:-mpfr-system}
|
MPFR_PACKAGE="${mpfr_version:-mpfr-system}"
|
||||||
mpcPACKAGE=${mpc_version:-mpc-system}
|
MPC_PACKAGE="${mpc_version:-mpc-system}"
|
||||||
gccPACKAGE=$gcc_version
|
GCC_PACKAGE="$gcc_version"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions gcc gmp mpfr mpc; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [gcc-VERSION] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION]
|
Usage: ${0##*/} [OPTION] [gcc-VERSION] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION]
|
||||||
options:
|
options:
|
||||||
-clang Force clang/clang++ for building
|
-clang Force clang/clang++ for building
|
||||||
-m32 | -m64 32-bit or 64-bit (default) ABI
|
-m32 | -m64 32-bit or 64-bit (default) ABI
|
||||||
@ -69,20 +70,21 @@ options:
|
|||||||
-no-multilib for 64-bit systems without 32-bit support (DEFAULT)
|
-no-multilib for 64-bit systems without 32-bit support (DEFAULT)
|
||||||
-no-threadsafe disable mpfr thread-safe (default is auto-detect)
|
-no-threadsafe disable mpfr thread-safe (default is auto-detect)
|
||||||
-system use system versions for gmp/mpfr/mpc
|
-system use system versions for gmp/mpfr/mpc
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build combinations of gmp, mpfr, mpc and gcc
|
* Build combinations of gmp, mpfr, mpc and gcc
|
||||||
$gmpPACKAGE
|
${GMP_PACKAGE:-[gmp unspecified]}
|
||||||
$mpfrPACKAGE
|
${MPFR_PACKAGE:-[mpfr unspecified]}
|
||||||
$mpcPACKAGE
|
${MPC_PACKAGE:-[mpc unspecified]}
|
||||||
${gccPACKAGE:-'unspecified GCC version'}
|
${GCC_PACKAGE:-[gcc unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint GCC
|
showDownloadHint gcc
|
||||||
showDownloadHint GMP
|
showDownloadHint gmp
|
||||||
showDownloadHint MPFR
|
showDownloadHint mpfr
|
||||||
showDownloadHint MPC
|
showDownloadHint mpc
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
optArch=64 # Use 64-bit ABI
|
optArch=64 # Use 64-bit ABI
|
||||||
@ -96,7 +98,8 @@ while [ "$#" -gt 0 ]
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-clang) # Force use of clang/clang++ for building
|
-clang) # Force use of clang/clang++ for building
|
||||||
export CC=clang
|
export CC=clang
|
||||||
export CXX=clang++
|
export CXX=clang++
|
||||||
@ -115,27 +118,35 @@ do
|
|||||||
optThreadSafe=disable
|
optThreadSafe=disable
|
||||||
;;
|
;;
|
||||||
-sys*)
|
-sys*)
|
||||||
gmpPACKAGE="gmp-system"
|
GMP_PACKAGE="gmp-system"
|
||||||
mpfrPACKAGE="mpfr-system"
|
MPFR_PACKAGE="mpfr-system"
|
||||||
mpcPACKAGE="mpc-system"
|
MPC_PACKAGE="mpc-system"
|
||||||
unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
gmp/* | sources/gmp* |\
|
||||||
gmp-[0-9]* | gmp-system)
|
gmp-[0-9]* | gmp-system)
|
||||||
gmpPACKAGE="${1%%/}"
|
GMP_PACKAGE="${1%%/}"
|
||||||
unset GMP_ARCH_PATH
|
unset GMP_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
mpfr/* | sources/mpfr* |\
|
||||||
mpfr-[0-9]* | mpfr-system)
|
mpfr-[0-9]* | mpfr-system)
|
||||||
mpfrPACKAGE="${1%%/}"
|
MPFR_PACKAGE="${1%%/}"
|
||||||
unset MPFR_ARCH_PATH
|
unset MPFR_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
mpc/* | sources/mpc* |\
|
||||||
mpc-[0-9]* | mpc-system)
|
mpc-[0-9]* | mpc-system)
|
||||||
mpcPACKAGE="${1%%/}"
|
MPC_PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
gcc/* | sources/gcc* |\
|
||||||
gcc-[0-9]* | gcc-system)
|
gcc-[0-9]* | gcc-system)
|
||||||
gccPACKAGE="${1%%/}"
|
GCC_PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
[0-9]*)
|
[0-9]*)
|
||||||
gccPACKAGE="gcc-${1%%/}"
|
GCC_PACKAGE="gcc-${1%%/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unknown option/argument: '$1'"
|
die "unknown option/argument: '$1'"
|
||||||
@ -144,37 +155,58 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$gccPACKAGE" ] || die "The gcc-VERSION was not specified"
|
[ -n "$GCC_PACKAGE" ] || die "The gcc-VERSION was not specified"
|
||||||
|
|
||||||
cat<<SUMMARY
|
cat<<SUMMARY
|
||||||
GCC configuration
|
GCC configuration
|
||||||
------------------
|
------------------
|
||||||
GCC = $gccPACKAGE
|
|
||||||
ABI = $optArch
|
ABI = $optArch
|
||||||
GMP = $gmpPACKAGE
|
GCC = $GCC_PACKAGE
|
||||||
MPFR = $mpfrPACKAGE
|
GMP = $GMP_PACKAGE
|
||||||
MPC = $mpcPACKAGE
|
MPFR = $MPFR_PACKAGE
|
||||||
|
MPC = $MPC_PACKAGE
|
||||||
------------------
|
------------------
|
||||||
Using CC = $CC $CFLAGS
|
Using CC = $CC $CFLAGS
|
||||||
Using CXX = $CXX $CXXFLAGS
|
Using CXX = $CXX $CXXFLAGS
|
||||||
SUMMARY
|
SUMMARY
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Build/install without compiler name
|
# !Build/install locations with arch name only (NO compiler name)!
|
||||||
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
|
buildBASE="$(dirname "$buildBASE")/$WM_ARCH$WM_COMPILER_ARCH"
|
||||||
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
installBASE="$(dirname "$installBASE")/$WM_ARCH$WM_COMPILER_ARCH"
|
||||||
|
|
||||||
|
# gcc
|
||||||
|
GCC_SOURCE="$(findSourceDir "$GCC_PACKAGE")"
|
||||||
|
GCC_PACKAGE="$(basename "$GCC_PACKAGE")"
|
||||||
|
GCC_PREFIX="$installBASE/$GCC_PACKAGE"
|
||||||
|
|
||||||
|
# gmp
|
||||||
|
GMP_SOURCE="$(findSourceDir "$GMP_PACKAGE")"
|
||||||
|
GMP_PACKAGE="$(basename "$GMP_PACKAGE")"
|
||||||
|
GMP_PREFIX="$installBASE/$GMP_PACKAGE"
|
||||||
|
|
||||||
|
# mpc
|
||||||
|
MPC_SOURCE="$(findSourceDir "$MPC_PACKAGE")"
|
||||||
|
MPC_PACKAGE="$(basename "$MPC_PACKAGE")"
|
||||||
|
MPC_PREFIX="$installBASE/$MPC_PACKAGE"
|
||||||
|
|
||||||
|
# mpfr
|
||||||
|
MPFR_SOURCE="$(findSourceDir "$MPFR_PACKAGE")"
|
||||||
|
MPFR_PACKAGE="$(basename "$MPFR_PACKAGE")"
|
||||||
|
MPFR_PREFIX="$installBASE/$MPFR_PACKAGE"
|
||||||
|
|
||||||
|
|
||||||
|
# Override as per config file (if any)
|
||||||
|
[ -n "$GMP_ARCH_PATH" ] && GMP_PREFIX="$GMP_ARCH_PATH"
|
||||||
|
[ -n "$MPFR_ARCH_PATH" ] && MPFR_PREFIX="$MPFR_ARCH_PATH"
|
||||||
|
|
||||||
GCC_ARCH_PATH=$installBASE/$gccPACKAGE
|
|
||||||
GMP_ARCH_PATH=$installBASE/$gmpPACKAGE
|
|
||||||
MPFR_ARCH_PATH=$installBASE/$mpfrPACKAGE
|
|
||||||
MPC_ARCH_PATH=$installBASE/$mpcPACKAGE
|
|
||||||
|
|
||||||
# Prefix <dir> to LD_LIBRARY_PATH, if it exists. 0 on success, 1 on failure
|
# Prefix <dir> to LD_LIBRARY_PATH, if it exists. 0 on success, 1 on failure
|
||||||
addLib()
|
addLib()
|
||||||
{
|
{
|
||||||
if [ -d "$1" ]
|
if [ -d "$1" ]
|
||||||
then
|
then
|
||||||
export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@ -186,47 +218,47 @@ addLib()
|
|||||||
# Build GMP
|
# Build GMP
|
||||||
# ================
|
# ================
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d "$GMP_ARCH_PATH" ]
|
if [ -d "$GMP_PREFIX" ]
|
||||||
then
|
then
|
||||||
echo "Already built: $gmpPACKAGE"
|
echo "Already built: $GMP_PREFIX"
|
||||||
elif _foamIsSystem $GMP_ARCH_PATH
|
elif _foamIsSystem "$GMP_PREFIX"
|
||||||
then
|
then
|
||||||
echo "Using gmp-system"
|
echo "Using system gmp"
|
||||||
else
|
else
|
||||||
echo "Starting build: $gmpPACKAGE"
|
echo "Starting build: $GMP_PACKAGE"
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
sourceDIR=$sourceBASE/$gmpPACKAGE
|
PKG_SOURCE="$GMP_SOURCE"
|
||||||
buildDIR=$buildBASE/$gmpPACKAGE
|
PKG_PREFIX="$GMP_PREFIX"
|
||||||
|
PKG_BUILD="$buildBASE/$GMP_PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
cd "$sourceDIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
make distclean 2>/dev/null || true
|
||||||
make distclean 2>/dev/null
|
|
||||||
|
|
||||||
rm -rf $buildDIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $buildDIR
|
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$sourceDIR/configure ABI=$optArch \
|
"$PKG_SOURCE"/configure ABI="$optArch" \
|
||||||
--prefix=$GMP_ARCH_PATH \
|
--prefix="$PKG_PREFIX" \
|
||||||
--libdir=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
--enable-cxx \
|
--enable-cxx \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $gmpPACKAGE"
|
&& echo "Built: $GMP_PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $gmpPACKAGE"
|
echo "Error building: $GMP_PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if addLib "$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
|
if addLib "$GMP_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||||
then
|
then
|
||||||
configGMP=$(cat <<CONFIG_OPTIONS
|
configGMP=$(cat <<CONFIG_OPTIONS
|
||||||
--with-gmp-include=$GMP_ARCH_PATH/include
|
--with-gmp-include=$GMP_PREFIX/include
|
||||||
--with-gmp-lib=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
--with-gmp-lib=$GMP_PREFIX/lib$WM_COMPILER_LIB_ARCH
|
||||||
CONFIG_OPTIONS
|
CONFIG_OPTIONS
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@ -238,51 +270,51 @@ fi
|
|||||||
# Build MPFR
|
# Build MPFR
|
||||||
# ================
|
# ================
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d "$MPFR_ARCH_PATH" ]
|
if [ -d "$MPFR_PREFIX" ]
|
||||||
then
|
then
|
||||||
echo "Already built: $mpfrPACKAGE"
|
echo "Already built: $MPFR_PACKAGE"
|
||||||
elif _foamIsSystem $MPFR_ARCH_PATH
|
elif _foamIsSystem "$MPFR_PREFIX"
|
||||||
then
|
then
|
||||||
echo "Using mpfr-system"
|
echo "Using system mpfr"
|
||||||
else
|
else
|
||||||
echo "Starting build: $mpfrPACKAGE"
|
echo "Starting build: $MPFR_PACKAGE"
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
sourceDIR=$sourceBASE/$mpfrPACKAGE
|
PKG_SOURCE="$MPFR_SOURCE"
|
||||||
buildDIR=$buildBASE/$mpfrPACKAGE
|
PKG_PREFIX="$MPFR_PREFIX"
|
||||||
|
PKG_BUILD="$buildBASE/$MPFR_PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
cd "$sourceDIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
make distclean 2>/dev/null || true
|
||||||
make distclean 2>/dev/null
|
|
||||||
|
|
||||||
rm -rf $buildDIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $buildDIR
|
|
||||||
|
|
||||||
unset configOpt
|
unset configOpt
|
||||||
# explicitly enable/disable thread-safe
|
# explicitly enable/disable thread-safe
|
||||||
[ -n "$optThreadSafe" ] && configOpt="--${optThreadSafe}-thread-safe"
|
[ -n "$optThreadSafe" ] && configOpt="--${optThreadSafe}-thread-safe"
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$sourceDIR/configure ABI=$optArch \
|
"$PKG_SOURCE"/configure ABI="$optArch" \
|
||||||
--prefix=$MPFR_ARCH_PATH \
|
--prefix="$PKG_PREFIX" \
|
||||||
--libdir=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
$configGMP $configOpt \
|
$configGMP $configOpt \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $mpfrPACKAGE"
|
&& echo "Built: $MPFR_PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $mpfrPACKAGE"
|
echo "Error building: $MPFR_PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if addLib "$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
|
if addLib "$MPFR_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||||
then
|
then
|
||||||
configMPFR=$(cat <<CONFIG_OPTIONS
|
configMPFR=$(cat <<CONFIG_OPTIONS
|
||||||
--with-mpfr-include=$MPFR_ARCH_PATH/include \
|
--with-mpfr-include=$MPFR_PREFIX/include \
|
||||||
--with-mpfr-lib=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
--with-mpfr-lib=$MPFR_PREFIX/lib$WM_COMPILER_LIB_ARCH
|
||||||
CONFIG_OPTIONS
|
CONFIG_OPTIONS
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@ -294,47 +326,47 @@ fi
|
|||||||
# Build MPC
|
# Build MPC
|
||||||
# ================
|
# ================
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d "$MPC_ARCH_PATH" ]
|
if [ -d "$MPC_PREFIX" ]
|
||||||
then
|
then
|
||||||
echo "Already built: $mpcPACKAGE"
|
echo "Already built: $MPC_PACKAGE"
|
||||||
elif _foamIsSystem $MPC_ARCH_PATH
|
elif _foamIsSystem "$MPC_PREFIX"
|
||||||
then
|
then
|
||||||
echo "Using mpc-system"
|
echo "Using system mpc"
|
||||||
else
|
else
|
||||||
echo "Starting build: $mpcPACKAGE"
|
echo "Starting build: $MPC_PACKAGE"
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
sourceDIR=$sourceBASE/$mpcPACKAGE
|
PKG_SOURCE="$MPC_SOURCE"
|
||||||
buildDIR=$buildBASE/$mpcPACKAGE
|
PKG_PREFIX="$MPC_PREFIX"
|
||||||
|
PKG_BUILD="$buildBASE/$MPC_PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
cd "$sourceDIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
make distclean 2>/dev/null || true
|
||||||
make distclean 2>/dev/null
|
|
||||||
|
|
||||||
rm -rf $buildDIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $buildDIR
|
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$sourceDIR/configure ABI=$optArch \
|
"$PKG_SOURCE"/configure ABI="$optArch" \
|
||||||
--prefix=$MPC_ARCH_PATH \
|
--prefix="$PKG_PREFIX" \
|
||||||
--libdir=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
$configGMP $configMPFR \
|
$configGMP $configMPFR \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $mpcPACKAGE"
|
&& echo "Built: $MPC_PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $mpcPACKAGE"
|
echo "Error building: $MPC_PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if addLib "$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
|
if addLib "$MPC_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||||
then
|
then
|
||||||
configMPC=$(cat <<CONFIG_OPTIONS
|
configMPC=$(cat <<CONFIG_OPTIONS
|
||||||
--with-mpc-include=$MPC_ARCH_PATH/include \
|
--with-mpc-include=$MPC_PREFIX/include \
|
||||||
--with-mpc-lib=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
--with-mpc-lib=$MPC_PREFIX/lib$WM_COMPILER_LIB_ARCH
|
||||||
CONFIG_OPTIONS
|
CONFIG_OPTIONS
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@ -350,35 +382,35 @@ fi
|
|||||||
# or specify -no-multilib on the command-line
|
# or specify -no-multilib on the command-line
|
||||||
#
|
#
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d "$GCC_ARCH_PATH" ]
|
if [ -d "$GCC_PREFIX" ]
|
||||||
then
|
then
|
||||||
echo "Already built: $gccPACKAGE"
|
echo "Already built: $GCC_PACKAGE"
|
||||||
elif _foamIsSystem $GCC_ARCH_PATH
|
elif _foamIsSystem "$GCC_PREFIX"
|
||||||
then
|
then
|
||||||
echo "Using gcc-system"
|
echo "Using system gcc"
|
||||||
else
|
else
|
||||||
echo "Starting build: $gccPACKAGE"
|
echo "Starting build: $GCC_PACKAGE"
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
sourceDIR=$sourceBASE/$gccPACKAGE
|
PKG_SOURCE="$GCC_SOURCE"
|
||||||
buildDIR=$buildBASE/$gccPACKAGE
|
PKG_PREFIX="$GCC_PREFIX"
|
||||||
|
PKG_BUILD="$buildBASE/$GCC_PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
cd "$sourceDIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
make distclean 2>/dev/null || true
|
||||||
make distclean 2>/dev/null
|
|
||||||
|
|
||||||
rm -rf $buildDIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $buildDIR
|
|
||||||
|
|
||||||
unset configOpt
|
unset configOpt
|
||||||
# with/without multi-lib (32-bit support on 64-bit systems)
|
# with/without multi-lib (32-bit support on 64-bit systems)
|
||||||
[ -n "$optMultilib" ] && configOpt="--${optMultilib}-multilib"
|
[ -n "$optMultilib" ] && configOpt="--${optMultilib}-multilib"
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$sourceDIR/configure \
|
"$PKG_SOURCE"/configure \
|
||||||
--prefix=$GCC_ARCH_PATH \
|
--prefix="$PKG_PREFIX" \
|
||||||
--with-pkgversion=OpenFOAM \
|
--with-pkgversion=www.openfoam.com \
|
||||||
--enable-languages=c,c++ \
|
--enable-languages=c,c++ \
|
||||||
--enable-__cxa_atexit \
|
--enable-__cxa_atexit \
|
||||||
--enable-libstdcxx-allocator=new \
|
--enable-libstdcxx-allocator=new \
|
||||||
@ -388,9 +420,9 @@ else
|
|||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $gccPACKAGE"
|
&& echo "Built: $GCC_PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $gccPACKAGE"
|
echo "Error building: $GCC_PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2012 OpenFOAM Foundation
|
# Copyright (C) 2012 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -21,52 +21,59 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
# Gperftools version from OpenFOAM etc/config.sh file:
|
|
||||||
_foamConfig gperftools
|
_foamConfig gperftools
|
||||||
|
|
||||||
gperftoolsPACKAGE=${gperftools_version:-gperftools-system}
|
PACKAGE="${gperftools_version:-none}"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions gperf; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [gperftools-VERSION]
|
Usage: ${0##*/} [gperftools-VERSION]
|
||||||
options:
|
options:
|
||||||
|
-force Force compilation, even if include/library already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build gperftools
|
* Build gperftools
|
||||||
$gperftoolsPACKAGE
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint GPERFTOOLS
|
showDownloadHint gperftools
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
|
|
||||||
|
unset optForce
|
||||||
|
|
||||||
# Parse options
|
# Parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
|
-force) optForce=true ;;
|
||||||
|
|
||||||
|
gperftools/* | sources/gperftools* |\
|
||||||
gperftools-[0-9]* | gperftools-svn* | gperftools-git)
|
gperftools-[0-9]* | gperftools-svn* | gperftools-git)
|
||||||
gperftoolsPACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unknown option/argument: '$1'"
|
die "unknown option/argument: '$1'"
|
||||||
@ -75,55 +82,56 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$gperftoolsPACKAGE" ] || die "The gperftools-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone $gperftoolsPACKAGE
|
|
||||||
then
|
then
|
||||||
echo "Using gperftools-none (skip ThirdParty build of gperftools)"
|
die "The GPERFTOOLS package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem $gperftoolsPACKAGE
|
|
||||||
then
|
then
|
||||||
echo "Using gperftools-system (skip ThirdParty build of gperftools)"
|
echo "Using none/system (skip ThirdParty build of GPERFTOOLS)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build gperftools
|
# Build gperftools
|
||||||
#
|
# *PACKAGE : name-version of the package
|
||||||
GPERFTOOLS_SOURCE_DIR=$sourceBASE/$gperftoolsPACKAGE
|
# *SOURCE : location of original sources
|
||||||
GPERFTOOLS_ARCH_PATH=$installBASE/$gperftoolsPACKAGE
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d "$GPERFTOOLS_ARCH_PATH" ]
|
if [ -z "$optForce" ] \
|
||||||
|
&& [ -d "$PKG_PREFIX" ]
|
||||||
then
|
then
|
||||||
echo "Already built: $gperftoolsPACKAGE"
|
echo "Already built: $PACKAGE"
|
||||||
else
|
else
|
||||||
echo "Starting build: $gperftoolsPACKAGE"
|
echo "Starting build: $PACKAGE"
|
||||||
(
|
(
|
||||||
buildDIR=$buildBASE/$gperftoolsPACKAGE
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
cd "$PKG_SOURCE" || exit
|
||||||
|
|
||||||
cd "$GPERFTOOLS_SOURCE_DIR" || exit
|
make distclean 2>/dev/null || true
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
[ -e Makefile ] && make distclean 2>/dev/null
|
|
||||||
|
|
||||||
rm -rf $GPERFTOOLS_ARCH_PATH
|
rm -rf "$PKG_PREFIX"
|
||||||
rm -rf $buildDIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $buildDIR
|
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$GPERFTOOLS_SOURCE_DIR/configure \
|
"$PKG_SOURCE"/configure \
|
||||||
--prefix=$GPERFTOOLS_ARCH_PATH \
|
--prefix="$PKG_PREFIX" \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $gperftoolsPACKAGE" \
|
&& echo "Built: $PACKAGE" \
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $gperftoolsPACKAGE"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
92
makeHYPRE
92
makeHYPRE
@ -6,7 +6,7 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2018-2020 OpenCFD Ltd.
|
# Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -20,39 +20,46 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
if : # Run from third-party directory
|
||||||
# Run from third-party directory only
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Obtain version from etc/config.sh file:
|
||||||
_foamConfig hypre
|
_foamConfig hypre
|
||||||
|
|
||||||
hyprePACKAGE="${hypre_version:-hypre-system}"
|
PACKAGE="${hypre_version:-none}"
|
||||||
targetType=libso
|
targetType=libso
|
||||||
|
|
||||||
|
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||||
|
then
|
||||||
|
unset HYPRE_ARCH_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions hypre; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [-- configure-options]
|
Usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [-- configure-options]
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if include/library already exists
|
-force Force compilation, even if include/library already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build HYPRE with
|
* Build HYPRE with
|
||||||
${hyprePACKAGE:-'unspecified hypre version'}
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint HYPRE
|
showDownloadHint hypre
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -65,7 +72,8 @@ do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
|
|
||||||
@ -73,8 +81,9 @@ do
|
|||||||
targetType="$1"
|
targetType="$1"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
hypre/* | sources/hypre* |\
|
||||||
hypre-[0-9]* | hypre-git)
|
hypre-[0-9]* | hypre-git)
|
||||||
hyprePACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -84,16 +93,12 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$hyprePACKAGE" ] || die "The hypre-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone "$hyprePACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using hypre-none (skip ThirdParty build of HYPRE)"
|
die "The HYPRE package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem "$hyprePACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using hypre-system"
|
echo "Using none/system (skip ThirdParty build of HYPRE)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -101,15 +106,23 @@ fi
|
|||||||
#
|
#
|
||||||
# Build HYPRE
|
# Build HYPRE
|
||||||
#
|
#
|
||||||
# HYPRE_ARCH_PATH : installation directory
|
# HYPRE_ARCH_PATH : installation directory (as per config file)
|
||||||
# HYPRE_SOURCE_DIR : location of the original sources
|
#
|
||||||
|
# *PACKAGE : name-version of the package
|
||||||
|
# *SOURCE : location of original sources
|
||||||
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
HYPRE_SOURCE_DIR="$sourceBASE/$hyprePACKAGE"
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
: "${HYPRE_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$hyprePACKAGE}"
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
[ -d "$HYPRE_SOURCE_DIR" ] || {
|
# Override as per config file (if any)
|
||||||
echo "Missing sources: '$hyprePACKAGE'"
|
[ -n "$HYPRE_ARCH_PATH" ] && PKG_PREFIX="$HYPRE_ARCH_PATH"
|
||||||
showDownloadHint HYPRE
|
|
||||||
|
[ -d "$PKG_SOURCE" ] || {
|
||||||
|
echo "Missing sources: '$PACKAGE'"
|
||||||
|
showDownloadHint hypre
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +131,7 @@ HYPRE_SOURCE_DIR="$sourceBASE/$hyprePACKAGE"
|
|||||||
CC="$(whichMpicc)"
|
CC="$(whichMpicc)"
|
||||||
CXX="$(whichMpicxx)"
|
CXX="$(whichMpicxx)"
|
||||||
|
|
||||||
echo "Starting build: $hyprePACKAGE ($targetType)"
|
echo "Starting build: $PACKAGE ($targetType)"
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
# Configuration options
|
# Configuration options
|
||||||
@ -131,25 +144,24 @@ echo
|
|||||||
configOpt="$configOpt $@"
|
configOpt="$configOpt $@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$HYPRE_SOURCE_DIR/src" || exit
|
cd "$PKG_SOURCE/src" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
|
|
||||||
rm -rf "$HYPRE_ARCH_PATH"
|
rm -rf "$PKG_PREFIX"
|
||||||
[ -e Makefile ] && make distclean 2>/dev/null
|
make distclean 2>/dev/null || true
|
||||||
|
|
||||||
|
set -x && \
|
||||||
./configure \
|
./configure \
|
||||||
--prefix="$HYPRE_ARCH_PATH" \
|
--prefix="$PKG_PREFIX" \
|
||||||
--disable-fortran \
|
--disable-fortran \
|
||||||
--enable-shared \
|
--enable-shared \
|
||||||
$configOpt \
|
$configOpt \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& echo "Built: hypre" \
|
&& echo "Built: hypre" \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Installed: hypre"
|
&& echo "Installed: $PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: hypre"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
19
makeKAHIP
19
makeKAHIP
@ -50,13 +50,15 @@ then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
fi
|
||||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Obtain version from OpenFOAM etc/config.sh file:
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
@ -71,6 +73,11 @@ then
|
|||||||
export MPI_HOME="$MPI_ARCH_PATH"
|
export MPI_HOME="$MPI_ARCH_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||||
|
then
|
||||||
|
unset KAHIP_ARCH_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
printVersions() { listPackageVersions kahip; exit 0; }
|
printVersions() { listPackageVersions kahip; exit 0; }
|
||||||
printHelp() {
|
printHelp() {
|
||||||
@ -134,6 +141,7 @@ do
|
|||||||
targetType="$1"
|
targetType="$1"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
kahip/* | sources/kahip* | sources/KaHIP* |\
|
||||||
kahip-[0-9]* | kahip-git | KaHIP_* | KaHIP-[0-9]*)
|
kahip-[0-9]* | kahip-git | KaHIP_* | KaHIP-[0-9]*)
|
||||||
PACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
unset KAHIP_ARCH_PATH # Avoid inconsistency
|
unset KAHIP_ARCH_PATH # Avoid inconsistency
|
||||||
@ -184,7 +192,7 @@ fi
|
|||||||
# *SOURCE : location of original sources
|
# *SOURCE : location of original sources
|
||||||
# *PREFIX : installation directory
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
PKG_SOURCE="$sourceBASE/$PACKAGE"
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
PACKAGE="$(basename "$PACKAGE")"
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
# Future: PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
# Future: PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
@ -395,7 +403,6 @@ install_wmake()
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [ "${useWmakeWorkaround:-false}" = false ]
|
if [ "${useWmakeWorkaround:-false}" = false ]
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
@ -418,13 +425,15 @@ then
|
|||||||
|
|
||||||
cmake=$(findCMake)
|
cmake=$(findCMake)
|
||||||
|
|
||||||
cd "$PKG_BUILD" && $cmake \
|
cd "$PKG_BUILD" && set -x && \
|
||||||
|
${cmake:?} \
|
||||||
-B "$PKG_BUILD" \
|
-B "$PKG_BUILD" \
|
||||||
-S "$PKG_SOURCE" \
|
-S "$PKG_SOURCE" \
|
||||||
-DCMAKE_INSTALL_PREFIX="$PKG_PREFIX" \
|
-DCMAKE_INSTALL_PREFIX="$PKG_PREFIX" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
$buildOpt \
|
$buildOpt \
|
||||||
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
||||||
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& install \
|
&& install \
|
||||||
@ -458,7 +467,7 @@ then
|
|||||||
&& echo "Built: $PACKAGE" \
|
&& echo "Built: $PACKAGE" \
|
||||||
&& install_wmake
|
&& install_wmake
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: kahip"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|||||||
123
makeLLVM
123
makeLLVM
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -39,14 +39,16 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
[ "${WM_COMPILER#Clang}" = "$WM_COMPILER" ] && WM_COMPILER=Clang # Force clang
|
[ "${WM_COMPILER#Clang}" = "$WM_COMPILER" ] && WM_COMPILER=Clang # Force clang
|
||||||
@ -55,26 +57,26 @@ WM_COMPILER_TYPE=ThirdParty # Ensure we get the correct settings
|
|||||||
# LLVM/Clang version from OpenFOAM etc/config.sh file:
|
# LLVM/Clang version from OpenFOAM etc/config.sh file:
|
||||||
_foamConfig compiler
|
_foamConfig compiler
|
||||||
|
|
||||||
llvmPACKAGE=$clang_version
|
PACKAGE="$clang_version"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions llvm; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [llvm-VERSION]
|
Usage: ${0##*/} [OPTION] [llvm-VERSION]
|
||||||
options:
|
options:
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-cmake PATH with cmake from the given path
|
-cmake PATH with cmake from the given path
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build llvm/clang
|
* Build llvm/clang
|
||||||
${llvmPACKAGE:-'unspecified LLVM version'}
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint LLVM
|
showDownloadHint llvm
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -84,7 +86,8 @@ while [ "$#" -gt 0 ]
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
|
|
||||||
-cmake)
|
-cmake)
|
||||||
@ -92,11 +95,13 @@ do
|
|||||||
CMAKE_PATH="${2%%/}"
|
CMAKE_PATH="${2%%/}"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
llvm/* | sources/llvm* |\
|
||||||
llvm-[0-9]* | llvm-svn*)
|
llvm-[0-9]* | llvm-svn*)
|
||||||
llvmPACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
[0-9]*)
|
[0-9]*)
|
||||||
llvmPACKAGE="llvm-${1%%/}"
|
PACKAGE="llvm-${1%%/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unknown option/argument: '$1'"
|
die "unknown option/argument: '$1'"
|
||||||
@ -105,97 +110,97 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$llvmPACKAGE" ] || die "The llvm-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
then
|
||||||
|
die "The LLVM package/version not specified"
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Build/install locations without a compiler name
|
# !Build/install locations with arch name only (NO compiler name)!
|
||||||
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
|
buildBASE="$(dirname "$buildBASE")/$WM_ARCH$WM_COMPILER_ARCH"
|
||||||
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
installBASE="$(dirname "$installBASE")/$WM_ARCH$WM_COMPILER_ARCH"
|
||||||
|
|
||||||
# Build LLVM (clang)
|
# Build LLVM (clang)
|
||||||
# LLVM_SOURCE_DIR : location of the original sources
|
# *PACKAGE : name-version of the package
|
||||||
# LLVM_BUILD_DIR : location of the build
|
# *SOURCEDIR : location of original sources
|
||||||
# LLVM_ARCH_PATH : location of the installed program
|
# *PREFIXDIR : installation directory
|
||||||
# - Strip any trailing '.src' from the proper names
|
# Note: strip trailing '.src' from package name
|
||||||
|
|
||||||
LLVM_SOURCE_DIR=$sourceBASE/$llvmPACKAGE
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
LLVM_BUILD_DIR=$buildBASE/${llvmPACKAGE%%.src}
|
PACKAGE="$(basename "$PACKAGE" .src)" # Strip of trailing .src
|
||||||
LLVM_ARCH_PATH=$installBASE/${llvmPACKAGE%%.src}
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git" # Avoid seeing our own git-repo
|
||||||
|
|
||||||
#
|
|
||||||
# Build LLVM
|
# Building...
|
||||||
#
|
|
||||||
echo "---------------"
|
echo "---------------"
|
||||||
if [ -d $LLVM_ARCH_PATH ]
|
if [ -d "$PKG_PREFIX" ]
|
||||||
then
|
then
|
||||||
echo "Already built: $llvmPACKAGE"
|
echo "Already built: $PACKAGE"
|
||||||
elif [ -z "$CMAKE_PATH" ] && $LLVM_SOURCE_DIR/configure -help >/dev/null 2>&1
|
elif [ -z "$CMAKE_PATH" ] && "$PKG_SOURCE"/configure -help >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
# configure can be used prior to 3.9.0
|
# configure can be used prior to 3.9.0
|
||||||
# but use cmake if someone explicitly mentioned -cmake on the command-line
|
# but use cmake if someone explicitly mentioned -cmake on the command-line
|
||||||
|
|
||||||
echo "Starting build: $llvmPACKAGE (using configure)"
|
echo "Starting build: $PACKAGE (using configure)"
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
cd "$LLVM_SOURCE_DIR" || exit
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
cd "$PKG_SOURCE" || exit
|
||||||
make distclean 2>/dev/null
|
make distclean 2>/dev/null || true
|
||||||
|
|
||||||
rm -rf $LLVM_BUILD_DIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $LLVM_BUILD_DIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $LLVM_BUILD_DIR
|
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$LLVM_SOURCE_DIR/configure \
|
"$PKG_SOURCE"/configure \
|
||||||
--prefix=$LLVM_ARCH_PATH \
|
--prefix="$PKG_PREFIX" \
|
||||||
--with-gcc-toolchain="$(command -v gcc | sed 's%/bin/gcc%%')" \
|
--with-gcc-toolchain="$(command -v gcc | sed 's%/bin/gcc%%')" \
|
||||||
--enable-optimized \
|
--enable-optimized \
|
||||||
--enable-shared \
|
--enable-shared \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $llvmPACKAGE"
|
&& echo "Built: $PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $llvmPACKAGE"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
# CMake used with 3.9.0 and later
|
# CMake used with 3.9.0 and later
|
||||||
|
|
||||||
echo "Starting build: $llvmPACKAGE (using cmake)"
|
echo "Starting build: $PACKAGE (using cmake)"
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
cd "$PKG_SOURCE" || exit
|
||||||
|
|
||||||
# Configuration options:
|
# Configuration options:
|
||||||
unset configOpt
|
unset configOpt
|
||||||
|
|
||||||
cd "$LLVM_SOURCE_DIR" || exit
|
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
|
|
||||||
if [ -f tools/openmp/CMakeLists.txt ]
|
if [ -f tools/openmp/CMakeLists.txt ]
|
||||||
then
|
then
|
||||||
configOpt="$configOpt -DLLVM_TOOL_OPENMP_BUILD=ON"
|
configOpt="$configOpt -DLLVM_TOOL_OPENMP_BUILD=ON"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf $LLVM_BUILD_DIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $LLVM_BUILD_DIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $LLVM_BUILD_DIR
|
|
||||||
|
|
||||||
cmake=$(findCMake)
|
cmake=$(findCMake)
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$cmake \
|
${cmake:?} \
|
||||||
-DCMAKE_INSTALL_PREFIX=$LLVM_ARCH_PATH \
|
-DCMAKE_INSTALL_PREFIX="$PKG_PREFIX" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DBUILD_SHARED_LIBS=ON \
|
-DBUILD_SHARED_LIBS=ON \
|
||||||
$configOpt \
|
$configOpt \
|
||||||
$LLVM_SOURCE_DIR \
|
"$PKG_SOURCE" \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $llvmPACKAGE"
|
&& echo "Built: $PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $llvmPACKAGE"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
makeMETIS
12
makeMETIS
@ -50,13 +50,15 @@ then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
fi
|
||||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Obtain version from OpenFOAM etc/config.sh file:
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
@ -65,6 +67,11 @@ _foamConfig metis
|
|||||||
PACKAGE="${METIS_VERSION:-system}"
|
PACKAGE="${METIS_VERSION:-system}"
|
||||||
targetType=libso
|
targetType=libso
|
||||||
|
|
||||||
|
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||||
|
then
|
||||||
|
unset METIS_ARCH_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
printVersions() { listPackageVersions metis; exit 0; }
|
printVersions() { listPackageVersions metis; exit 0; }
|
||||||
printHelp() {
|
printHelp() {
|
||||||
@ -114,6 +121,7 @@ do
|
|||||||
targetType="$1"
|
targetType="$1"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
metis/* | sources/metis* | \
|
||||||
metis-[0-9]*)
|
metis-[0-9]*)
|
||||||
PACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
unset METIS_ARCH_PATH # Avoid inconsistency
|
unset METIS_ARCH_PATH # Avoid inconsistency
|
||||||
@ -161,7 +169,7 @@ fi
|
|||||||
# *SOURCE : location of original sources
|
# *SOURCE : location of original sources
|
||||||
# *PREFIX : installation directory
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
PKG_SOURCE="$sourceBASE/$PACKAGE"
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
PACKAGE="$(basename "$PACKAGE")"
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||||
export GIT_DIR="$PKG_SOURCE/.git"
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|||||||
113
makeMGridGen
113
makeMGridGen
@ -6,7 +6,7 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -20,40 +20,40 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from ThirdParty directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " The environment variables are inconsistent with the installation."
|
echo " Check your OpenFOAM environment and installation"
|
||||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
# mgridgen version from OpenFOAM etc/config.sh file:
|
|
||||||
_foamConfig mgridgen
|
_foamConfig mgridgen
|
||||||
|
|
||||||
mgridgenPACKAGE=${MGRIDGEN_VERSION:-mgridgen-none}
|
PACKAGE="${MGRIDGEN_VERSION:-none}"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions mgridgen parmgridgen; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [mgridgen-VERSION]
|
Usage: ${0##*/} [OPTION] [mgridgen-VERSION]
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if include/library already exists
|
-force Force compilation, even if include/library already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* Build MGridGen
|
* Build MGridGen with
|
||||||
$mgridgenPACKAGE
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
# showDownloadHint GRIDGEN
|
# showDownloadHint gridgen
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -65,12 +65,15 @@ while [ "$#" -gt 0 ]
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
|
|
||||||
mgridgen-[0-9]* | MGridGen-[0-9]* | parmgridgen-[0-9]* | ParMGridGen-[0-9]*)
|
mgridgen/* | sources/*gridgen* | sources/*GridGen* | \
|
||||||
mgridgenPACKAGE="${1%%/}"
|
mgridgen-[0-9]* | MGridGen-[0-9]* | \
|
||||||
|
parmgridgen-[0-9]* | ParMGridGen-[0-9]*)
|
||||||
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unknown option/argument: '$1'"
|
die "unknown option/argument: '$1'"
|
||||||
@ -79,34 +82,32 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$mgridgenPACKAGE" ] || die "The mgridgen-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone "$mgridgenPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using mgridgen-none (skip ThirdParty build of MGridGen)"
|
die "The MGRIDGEN package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem "$mgridgenPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using mgridgen-system"
|
echo "Using none/system (skip ThirdParty build of MGRIDGEN)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build MGridGen
|
# Build MGridGen
|
||||||
|
# *PACKAGE : name-version of the package
|
||||||
|
# *SOURCE : location of original sources
|
||||||
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
# MGRIDGEN_SOURCE_DIR : location of the original sources
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
# MGRIDGEN_ARCH_PATH : installation directory
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
MGRIDGEN_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$mgridgenPACKAGE
|
: "${FOAM_MPI:=dummy}"
|
||||||
MGRIDGEN_ARCH_PATH="$installBASE$WM_SIZE_OPTIONS/$mgridgenPACKAGE"
|
|
||||||
|
|
||||||
: ${FOAM_MPI:=dummy}
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo ========================================
|
echo ========================================
|
||||||
echo "Build mgridgen library $mgridgenPACKAGE"
|
echo "Build mgridgen library $PACKAGE"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -114,23 +115,23 @@ echo
|
|||||||
#
|
#
|
||||||
install()
|
install()
|
||||||
{
|
{
|
||||||
echo "Install into $MGRIDGEN_ARCH_PATH"
|
echo "Install into $PKG_PREFIX"
|
||||||
|
|
||||||
local bindir=$MGRIDGEN_ARCH_PATH/bin
|
local bindir="$PKG_PREFIX"/bin
|
||||||
local incdir=$MGRIDGEN_ARCH_PATH/include
|
local incdir="$PKG_PREFIX"/include
|
||||||
local libdir=$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
local libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||||
|
|
||||||
for dir in $MGRIDGEN_ARCH_PATH $bindir $incdir $libdir
|
for dir in "$PKG_PREFIX" "$bindir" "$incdir" "$libdir"
|
||||||
do
|
do
|
||||||
mkdir -m 0755 -p $dir
|
mkdir -m 0755 -p "$dir"
|
||||||
done
|
done
|
||||||
|
|
||||||
cp -vf mgridgen.h $incdir
|
cp -vf mgridgen.h "$incdir"
|
||||||
cp -vf libmgrid.a $libdir
|
cp -vf libmgrid.a "$libdir"
|
||||||
cp -vf mgridgen $bindir
|
cp -vf mgridgen "$bindir"
|
||||||
|
|
||||||
chmod -R 0644 $incdir/* $libdir/*
|
chmod -R 0644 "$incdir"/* "$libdir"/*
|
||||||
chmod -R 0755 $bindir/*
|
chmod -R 0755 "$bindir"/*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -138,20 +139,20 @@ install()
|
|||||||
# - for shared library
|
# - for shared library
|
||||||
# - for mpi-specific library locations
|
# - for mpi-specific library locations
|
||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& [ -f "$MGRIDGEN_ARCH_PATH/include/mgridgen.h" ] \
|
&& [ -f "$PKG_PREFIX/include/mgridgen.h" ] \
|
||||||
&& {
|
&& {
|
||||||
[ -r "$MGRIDGEN_ARCH_PATH/lib/libmgrid.a" ] \
|
[ -r "$PKG_PREFIX/lib/libmgrid.a" ] \
|
||||||
|| [ -r "$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmgrid.a" ]
|
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmgrid.a" ]
|
||||||
}
|
}
|
||||||
then
|
then
|
||||||
echo " MGridGen already built : $MGRIDGEN_ARCH_PATH"
|
echo " MGridGen already built : $PKG_PREFIX"
|
||||||
else
|
else
|
||||||
(
|
(
|
||||||
cd "$MGRIDGEN_SOURCE_DIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
[ -e Makefile ] && make realclean 2>/dev/null
|
[ -e Makefile ] && make realclean 2>/dev/null
|
||||||
|
|
||||||
# Remove any existing build folder and recreate
|
# Remove any existing build folder and recreate
|
||||||
rm -rf $MGRIDGEN_ARCH_PATH
|
rm -rf "$PKG_PREFIX"
|
||||||
|
|
||||||
serial="$(whichCC)" # CC (serial compiler) default=gcc
|
serial="$(whichCC)" # CC (serial compiler) default=gcc
|
||||||
# parallel=$(whichMpicc) # PARCC (parallel compiler) default=mpicc
|
# parallel=$(whichMpicc) # PARCC (parallel compiler) default=mpicc
|
||||||
@ -169,9 +170,9 @@ else
|
|||||||
make=make \
|
make=make \
|
||||||
serial \
|
serial \
|
||||||
&& install \
|
&& install \
|
||||||
&& echo "Built: $mgridgenPACKAGE"
|
&& echo "Built: $PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $mgridgenPACKAGE"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|||||||
106
makeMPICH
106
makeMPICH
@ -6,7 +6,7 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -48,46 +48,45 @@ then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
# Transition
|
# Transition
|
||||||
# ~~~~~~~~~~
|
|
||||||
_foamAddLib() { true; }
|
_foamAddLib() { true; }
|
||||||
_foamAddMan() { true; }
|
_foamAddMan() { true; }
|
||||||
_foamAddPath() { true; }
|
_foamAddPath() { true; }
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
WM_MPLIB=MPICH # Ensure we get the correct MPI
|
WM_MPLIB=MPICH # Ensure we get the correct MPI
|
||||||
|
|
||||||
# mpich version from OpenFOAM etc/config.sh file:
|
|
||||||
_foamConfig mpi
|
_foamConfig mpi
|
||||||
|
|
||||||
mpiPACKAGE=${FOAM_MPI:-mpich-system}
|
PACKAGE="${FOAM_MPI:-system}"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions mpich; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [mpich-VERSION] [-- configure-options]
|
Usage: ${0##*/} [OPTION] [mpich-VERSION] [-- configure-options]
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if include/library already exists
|
-force Force compilation, even if include/library already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build mpich with
|
* build mpich with
|
||||||
${mpiPACKAGE:-'unspecified mpich version'}
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint MPICH
|
showDownloadHint mpich
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -100,12 +99,14 @@ do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
|
|
||||||
|
mpich/* | sources/mpich* | \
|
||||||
mpich*)
|
mpich*)
|
||||||
mpiPACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
@ -115,45 +116,43 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$mpiPACKAGE" ] || die "The mpich-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone "$mpiPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using mpich-none (skip ThirdParty build of mpich)"
|
die "The MPICH package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem "$mpiPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using mpich-system (skip ThirdParty build of mpich)"
|
echo "Using none/system (skip ThirdParty build of MPICH)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build mpich
|
# Build MPICH
|
||||||
#
|
# *PACKAGE : name-version of the package
|
||||||
# MPI_SOURCE_DIR : location of the original sources
|
# *SOURCE : location of original sources
|
||||||
# MPI_ARCH_PATH : installation directory
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& {
|
&& {
|
||||||
[ -r "$MPI_ARCH_PATH/lib/libmpi$EXT_SO" ] \
|
[ -r "$PKG_PREFIX/lib/libmpi$EXT_SO" ] \
|
||||||
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||||
}
|
}
|
||||||
then
|
then
|
||||||
echo "Already has shared library: $MPI_ARCH_PATH"
|
echo "Already has shared library: $PKG_PREFIX"
|
||||||
elif [ -z "$optForce" ] \
|
elif [ -z "$optForce" ] \
|
||||||
&& {
|
&& {
|
||||||
[ -r "$MPI_ARCH_PATH/lib/libmpi.a" ] \
|
[ -r "$PKG_PREFIX/lib/libmpi.a" ] \
|
||||||
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||||
}
|
}
|
||||||
then
|
then
|
||||||
echo "Already has static library: $MPI_ARCH_PATH"
|
echo "Already has static library: $PKG_PREFIX"
|
||||||
else
|
else
|
||||||
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
|
echo "Starting build: $WM_MPLIB ($PACKAGE)"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
(
|
(
|
||||||
@ -170,33 +169,32 @@ else
|
|||||||
# End of configuration options
|
# End of configuration options
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
|
||||||
buildDIR=$buildBASE/$mpiPACKAGE
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
|
||||||
cd "$MPI_SOURCE_DIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
make distclean 2>/dev/null || true
|
||||||
[ -e Makefile ] && make distclean 2>/dev/null
|
|
||||||
|
|
||||||
rm -rf $MPI_ARCH_PATH
|
rm -rf "$PKG_PREFIX"
|
||||||
rm -rf $buildDIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $buildDIR
|
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$MPI_SOURCE_DIR/configure \
|
"$PKG_SOURCE"/configure \
|
||||||
--prefix=$MPI_ARCH_PATH \
|
--prefix="$PKG_PREFIX" \
|
||||||
|
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
--disable-fortran --disable-g \
|
--disable-fortran --disable-g \
|
||||||
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
|
||||||
--enable-shared --disable-static \
|
--enable-shared --disable-static \
|
||||||
$configOpt \
|
$configOpt \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $mpiPACKAGE" \
|
&& echo "Built: $PACKAGE" \
|
||||||
&& pkgconfigAdjust $MPI_ARCH_PATH
|
&& pkgconfigAdjust "$PKG_PREFIX"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $mpiPACKAGE"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
105
makeMVAPICH
105
makeMVAPICH
@ -6,7 +6,7 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2019-2020 OpenCFD Ltd.
|
# Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -48,50 +48,49 @@ then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
# Transition
|
# Transition
|
||||||
# ~~~~~~~~~~
|
|
||||||
_foamAddLib() { true; }
|
_foamAddLib() { true; }
|
||||||
_foamAddMan() { true; }
|
_foamAddMan() { true; }
|
||||||
_foamAddPath() { true; }
|
_foamAddPath() { true; }
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
WM_MPLIB=MV2MPI # Ensure we get the correct MPI
|
WM_MPLIB=MV2MPI # Ensure we get the correct MPI
|
||||||
|
|
||||||
# mvapich2 version from OpenFOAM etc/config.sh file:
|
|
||||||
_foamConfig mpi
|
_foamConfig mpi
|
||||||
|
|
||||||
mpiPACKAGE=${FOAM_MPI:-mvapich2-system}
|
PACKAGE="${FOAM_MPI:-system}"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions mvapich; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [mvapich2-VERSION] [-- configure-options]
|
Usage: ${0##*/} [OPTION] [mvapich2-VERSION] [-- configure-options]
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if include/library already exists
|
-force Force compilation, even if include/library already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build mvapich2 with
|
* build mvapich2 with
|
||||||
${mpiPACKAGE:-'unspecified mpich version'}
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
The additional configure-options could include, for example,
|
The additional configure-options could include, for example,
|
||||||
|
|
||||||
${0##*/} -- --disable-mcast
|
${0##*/} -- --disable-mcast
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint MVAPICH
|
showDownloadHint mvapich
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -104,12 +103,14 @@ do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
|
|
||||||
|
mvapich/* | sources/mvapich* | \
|
||||||
mvapich*)
|
mvapich*)
|
||||||
mpiPACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
@ -119,45 +120,43 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$mpiPACKAGE" ] || die "The mvapich-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone "$mpiPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using mvapich-none (skip ThirdParty build of mvapich)"
|
die "The MVAPICH package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem "$mpiPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using mvapich-system (skip ThirdParty build of mvapich)"
|
echo "Using none/system (skip ThirdParty build of MVAPICH)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build mvapich
|
# Build MVAPICH
|
||||||
#
|
# *PACKAGE : name-version of the package
|
||||||
# MPI_SOURCE_DIR : location of the original sources
|
# *SOURCE : location of original sources
|
||||||
# MPI_ARCH_PATH : installation directory
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& {
|
&& {
|
||||||
[ -r "$MPI_ARCH_PATH/lib/libmpi$EXT_SO" ] \
|
[ -r "$PKG_PREFIX/lib/libmpi$EXT_SO" ] \
|
||||||
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||||
}
|
}
|
||||||
then
|
then
|
||||||
echo "Already has shared library: $MPI_ARCH_PATH"
|
echo "Already has shared library: $PKG_PREFIX"
|
||||||
elif [ -z "$optForce" ] \
|
elif [ -z "$optForce" ] \
|
||||||
&& {
|
&& {
|
||||||
[ -r "$MPI_ARCH_PATH/lib/libmpi.a" ] \
|
[ -r "$PKG_PREFIX/lib/libmpi.a" ] \
|
||||||
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||||
}
|
}
|
||||||
then
|
then
|
||||||
echo "Already has static library: $MPI_ARCH_PATH"
|
echo "Already has static library: $PKG_PREFIX"
|
||||||
else
|
else
|
||||||
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
|
echo "Starting build: $WM_MPLIB ($PACKAGE)"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
(
|
(
|
||||||
@ -174,31 +173,29 @@ else
|
|||||||
# End of configuration options
|
# End of configuration options
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
|
||||||
buildDIR=$buildBASE/$mpiPACKAGE
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
|
||||||
cd "$MPI_SOURCE_DIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
make distclean 2>/dev/null || true
|
||||||
[ -e Makefile ] && make distclean 2>/dev/null
|
|
||||||
|
|
||||||
rm -rf $MPI_ARCH_PATH
|
rm -rf "$PKG_PREFIX"
|
||||||
rm -rf $buildDIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $buildDIR
|
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$MPI_SOURCE_DIR/configure \
|
"$PKG_SOURCE"/configure \
|
||||||
--prefix=$MPI_ARCH_PATH \
|
--prefix="$PKG_PREFIX" \
|
||||||
|
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
--disable-fortran --disable-g \
|
--disable-fortran --disable-g \
|
||||||
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
|
||||||
--enable-shared --disable-static \
|
--enable-shared --disable-static \
|
||||||
$configOpt \
|
$configOpt \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $mpiPACKAGE" \
|
&& echo "Built: $PACKAGE" \
|
||||||
&& pkgconfigAdjust $MPI_ARCH_PATH
|
&& pkgconfigAdjust "$PKG_PREFIX"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $mpiPACKAGE"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|||||||
140
makeMesa
140
makeMesa
@ -15,7 +15,7 @@
|
|||||||
# makeMesa
|
# makeMesa
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Build script for Mesa
|
# Build script for MESA
|
||||||
#
|
#
|
||||||
# Note
|
# Note
|
||||||
# Building with mesa-12.x.x fails to create an include/GL directory and
|
# Building with mesa-12.x.x fails to create an include/GL directory and
|
||||||
@ -34,41 +34,41 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
unset vtk_version mesa_version mesa_llvm # Purge current values
|
unset vtk_version mesa_version mesa_llvm # Purge current values
|
||||||
|
|
||||||
# mesa version from OpenFOAM etc/config.sh file:
|
|
||||||
_foamConfig vtk
|
_foamConfig vtk
|
||||||
|
|
||||||
mesaPACKAGE=$mesa_version
|
PACKAGE="$mesa_version"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions mesa; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] mesa-VERSION [-- configure-options]
|
Usage: ${0##*/} [OPTION] mesa-VERSION [-- configure-options]
|
||||||
options:
|
options:
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-llvm VER llvm version (in ThirdParty) or 'system' to use system
|
-llvm VER llvm version (in ThirdParty) or 'system' to use system
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build Mesa with
|
* build MESA with
|
||||||
${mesaPACKAGE:-'unspecified MESA version'}
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint MESA
|
showDownloadHint mesa
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -101,7 +101,8 @@ do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc)
|
-gcc)
|
||||||
useGcc
|
useGcc
|
||||||
unset withLLVM
|
unset withLLVM
|
||||||
@ -114,8 +115,10 @@ do
|
|||||||
llvm-*)
|
llvm-*)
|
||||||
withLLVM="$1"
|
withLLVM="$1"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
mesa/* | sources/mesa* |\
|
||||||
mesa-*)
|
mesa-*)
|
||||||
mesaPACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "unknown option/argument: '$1'"
|
die "unknown option/argument: '$1'"
|
||||||
@ -124,16 +127,12 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$mesaPACKAGE" ] || die "The mesa-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone "$mesaPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using mesa-none (skip ThirdParty build of MESA)"
|
die "The MESA package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem "$mesaPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using mesa-system (skip ThirdParty build of MESA)"
|
echo "Using none/system (skip ThirdParty build of MESA)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -142,7 +141,7 @@ fi
|
|||||||
case "$withLLVM" in
|
case "$withLLVM" in
|
||||||
('' | none | false)
|
('' | none | false)
|
||||||
withLLVM=none
|
withLLVM=none
|
||||||
echo "No llvm"
|
echo "Without llvm"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(true | system)
|
(true | system)
|
||||||
@ -182,29 +181,32 @@ esac
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build MESA
|
# Build MESA
|
||||||
|
# *PACKAGE : name-version of the package
|
||||||
|
# *SOURCE : location of original sources
|
||||||
|
# *PREFIX : installation directory
|
||||||
|
#
|
||||||
# For 64-bit
|
# For 64-bit
|
||||||
# - MESA itself will normally build into 'lib64' (depends on autoconfig).
|
# - MESA itself will normally build into 'lib64' (depends on autoconfig).
|
||||||
#
|
|
||||||
# MESA_SOURCE_DIR : location of the original sources
|
|
||||||
# MESA_ARCH_DIR : installation directory
|
|
||||||
|
|
||||||
MESA_SOURCE_DIR="$sourceBASE/$mesaPACKAGE"
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
MESA_ARCH_PATH="$installBASE/$mesaPACKAGE"
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Manual adjustments to mesa
|
# Manual adjustments to mesa
|
||||||
# - avoid GLES (GLES1) since <GLES/gl.h> may mask the <GL/gl.h> header
|
# - avoid GLES (GLES1) since <GLES/gl.h> may mask the <GL/gl.h> header
|
||||||
adjustMESA()
|
adjustMESA()
|
||||||
{
|
{
|
||||||
pkgconfigAdjust "$MESA_ARCH_PATH"
|
pkgconfigAdjust "$PKG_PREFIX"
|
||||||
|
|
||||||
\rm -rf "$MESA_ARCH_PATH"/include/GLES "$MESA_ARCH_PATH"/include/GLES1
|
rm -rf "$PKG_PREFIX"/include/GLES "$PKG_PREFIX"/include/GLES1
|
||||||
echo "removed all gles1 includes"
|
echo "removed all gles1 includes"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Old MESA with autoconfig
|
# Old MESA with autoconfig
|
||||||
|
|
||||||
if [ -e "$MESA_SOURCE_DIR"/configure ]
|
if [ -e "$PKG_SOURCE"/configure ]
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
# Configuration options:
|
# Configuration options:
|
||||||
@ -230,21 +232,14 @@ then
|
|||||||
|
|
||||||
# End of configuration options
|
# End of configuration options
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
buildDIR="$buildBASE/$mesaPACKAGE"
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
|
||||||
cd "$MESA_SOURCE_DIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
|
|
||||||
# Remove any existing build
|
|
||||||
rm -rf "$MESA_ARCH_PATH"
|
|
||||||
rm -rf "$buildDIR"
|
|
||||||
mkdir -p "$buildDIR"
|
|
||||||
cd "$buildDIR"
|
|
||||||
|
|
||||||
echo "----"
|
echo "----"
|
||||||
echo "Building $mesaPACKAGE"
|
echo "Building $PACKAGE (with autoconf)"
|
||||||
echo " Source : $MESA_SOURCE_DIR"
|
echo " Source : $PKG_SOURCE"
|
||||||
echo " Target : $MESA_ARCH_PATH"
|
echo " Target : $PKG_PREFIX"
|
||||||
if [ -d "$LLVM_ARCH_PATH" ]
|
if [ -d "$LLVM_ARCH_PATH" ]
|
||||||
then
|
then
|
||||||
echo " llvm : $LLVM_ARCH_PATH"
|
echo " llvm : $LLVM_ARCH_PATH"
|
||||||
@ -258,9 +253,14 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
## autoreconf -fi
|
## autoreconf -fi
|
||||||
set -x
|
|
||||||
$MESA_SOURCE_DIR/configure \
|
rm -rf "$PKG_PREFIX"
|
||||||
--prefix="$MESA_ARCH_PATH" \
|
rm -rf "$PKG_BUILD"
|
||||||
|
mkdir -p "$PKG_BUILD"
|
||||||
|
|
||||||
|
cd "$PKG_BUILD" && set -x && \
|
||||||
|
"$PKG_SOURCE"/configure \
|
||||||
|
--prefix="$PKG_PREFIX" \
|
||||||
--disable-xvmc \
|
--disable-xvmc \
|
||||||
--disable-glx \
|
--disable-glx \
|
||||||
--disable-dri \
|
--disable-dri \
|
||||||
@ -273,14 +273,14 @@ then
|
|||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built $mesaPACKAGE" \
|
&& echo "Built $PACKAGE" \
|
||||||
&& adjustMESA
|
&& adjustMESA
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: MESA"
|
echo "Error building: MESA"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
elif [ -e "$MESA_SOURCE_DIR"/meson.build ]
|
elif [ -e "$PKG_SOURCE"/meson.build ]
|
||||||
then
|
then
|
||||||
(
|
(
|
||||||
# Configuration options:
|
# Configuration options:
|
||||||
@ -301,21 +301,13 @@ then
|
|||||||
|
|
||||||
# End of configuration options
|
# End of configuration options
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
buildDIR="$buildBASE/$mesaPACKAGE"
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
cd "$PKG_SOURCE" || exit
|
||||||
cd "$MESA_SOURCE_DIR" || exit
|
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
|
|
||||||
# Remove any existing build
|
|
||||||
rm -rf $MESA_ARCH_PATH
|
|
||||||
rm -rf $buildDIR
|
|
||||||
mkdir -p $buildDIR
|
|
||||||
cd $MESA_SOURCE_DIR
|
|
||||||
|
|
||||||
echo "----"
|
echo "----"
|
||||||
echo "Building $mesaPACKAGE"
|
echo "Building $PACKAGE (with meson)"
|
||||||
echo " Source : $MESA_SOURCE_DIR"
|
echo " Source : $PKG_SOURCE"
|
||||||
echo " Target : $MESA_ARCH_PATH"
|
echo " Target : $PKG_PREFIX"
|
||||||
if [ -d "$LLVM_ARCH_PATH" ]
|
if [ -d "$LLVM_ARCH_PATH" ]
|
||||||
then
|
then
|
||||||
echo " llvm : $LLVM_ARCH_PATH"
|
echo " llvm : $LLVM_ARCH_PATH"
|
||||||
@ -331,9 +323,13 @@ then
|
|||||||
# Needs c++14 not c++11
|
# Needs c++14 not c++11
|
||||||
CXXFLAGS="$(echo "$CXXFLAGS" | sed 's/c++11/c++14/')"
|
CXXFLAGS="$(echo "$CXXFLAGS" | sed 's/c++11/c++14/')"
|
||||||
|
|
||||||
set -x
|
rm -rf "$PKG_PREFIX"
|
||||||
meson "$buildDIR" \
|
rm -rf "$PKG_BUILD"
|
||||||
--prefix="$MESA_ARCH_PATH" \
|
mkdir -p "$PKG_BUILD"
|
||||||
|
|
||||||
|
cd "$PKG_SOURCE" && set -x && \
|
||||||
|
meson "$PKG_BUILD" \
|
||||||
|
--prefix="$PKG_PREFIX" \
|
||||||
-Dplatforms=x11 \
|
-Dplatforms=x11 \
|
||||||
-Dosmesa=gallium \
|
-Dosmesa=gallium \
|
||||||
-Dgallium-drivers=swrast \
|
-Dgallium-drivers=swrast \
|
||||||
@ -341,9 +337,9 @@ then
|
|||||||
-Dvulkan-drivers=[] \
|
-Dvulkan-drivers=[] \
|
||||||
$configOpt \
|
$configOpt \
|
||||||
&& set +x \
|
&& set +x \
|
||||||
&& ninja -j $WM_NCOMPPROCS -C "$buildDIR" \
|
&& ninja -j $WM_NCOMPPROCS -C "$PKG_BUILD" \
|
||||||
&& ninja -C "$buildDIR" install \
|
&& ninja -C "$PKG_BUILD" install \
|
||||||
&& echo "Built $mesaPACKAGE" \
|
&& echo "Built $PACKAGE" \
|
||||||
&& adjustMESA
|
&& adjustMESA
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: MESA"
|
echo "Error building: MESA"
|
||||||
|
|||||||
106
makeOPENMPI
106
makeOPENMPI
@ -6,7 +6,7 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -48,49 +48,48 @@ then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
# Transition
|
# Transition
|
||||||
# ~~~~~~~~~~
|
|
||||||
_foamAddLib() { true; }
|
_foamAddLib() { true; }
|
||||||
_foamAddMan() { true; }
|
_foamAddMan() { true; }
|
||||||
_foamAddPath() { true; }
|
_foamAddPath() { true; }
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
WM_MPLIB=OPENMPI # Ensure we get the correct MPI
|
WM_MPLIB=OPENMPI # Ensure we get the correct MPI
|
||||||
|
|
||||||
# openmpi version from OpenFOAM etc/config.sh file:
|
|
||||||
_foamConfig mpi
|
_foamConfig mpi
|
||||||
|
|
||||||
mpiPACKAGE=${FOAM_MPI:-openmpi-system}
|
PACKAGE="${FOAM_MPI:-system}"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions openmpi; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [openmpi-VERSION] [-- configure-options]
|
Usage: ${0##*/} [OPTION] [openmpi-VERSION] [-- configure-options]
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if include/library already exists
|
-force Force compilation, even if include/library already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-memcheck Configure with --enable-memcheck (requires valgrind.h)
|
-memcheck Configure with --enable-memcheck (requires valgrind.h)
|
||||||
-threaded Configure with --enable-mpi-thread-multiple
|
-threaded Configure with --enable-mpi-thread-multiple
|
||||||
-no-threaded Configure with --disable-mpi-thread-multiple
|
-no-threaded Configure with --disable-mpi-thread-multiple
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build openmpi with
|
* build openmpi with
|
||||||
${mpiPACKAGE:-'unspecified openmpi version'}
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint OPENMPI
|
showDownloadHint openmpi
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -103,15 +102,17 @@ do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
-memcheck*) optMemchecker=true ;;
|
-memcheck*) optMemchecker=true ;;
|
||||||
-thread*) optThreaded=enable ;;
|
-thread*) optThreaded=enable ;;
|
||||||
-no-thread*) optThreaded=disable ;;
|
-no-thread*) optThreaded=disable ;;
|
||||||
|
|
||||||
|
openmpi/* | sources/openmpi* | \
|
||||||
openmpi-[0-9]* | openmpi_[0-9]* | openmpi-system )
|
openmpi-[0-9]* | openmpi_[0-9]* | openmpi-system )
|
||||||
mpiPACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
@ -121,45 +122,43 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$mpiPACKAGE" ] || die "The openmpi-VERSION was not specified"
|
if [ -z "$PACKAGE" ]
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone "$mpiPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using openmpi-none (skip ThirdParty build of openmpi)"
|
die "The OPENMPI package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem "$mpiPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using openmpi-system (skip ThirdParty build of openmpi)"
|
echo "Using none/system (skip ThirdParty build of OPENMPI)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build openmpi
|
# Build OPENMPI
|
||||||
#
|
# *PACKAGE : name-version of the package
|
||||||
# MPI_SOURCE_DIR : location of the original sources
|
# *SOURCE : location of original sources
|
||||||
# MPI_ARCH_PATH : installation directory
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& {
|
&& {
|
||||||
[ -r "$MPI_ARCH_PATH/lib/libmpi$EXT_SO" ] \
|
[ -r "$PKG_PREFIX/lib/libmpi$EXT_SO" ] \
|
||||||
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||||
}
|
}
|
||||||
then
|
then
|
||||||
echo "Already has shared library: $MPI_ARCH_PATH"
|
echo "Already has shared library: $PKG_PREFIX"
|
||||||
elif [ -z "$optForce" ] \
|
elif [ -z "$optForce" ] \
|
||||||
&& {
|
&& {
|
||||||
[ -r "$MPI_ARCH_PATH/lib/libmpi.a" ] \
|
[ -r "$PKG_PREFIX/lib/libmpi.a" ] \
|
||||||
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||||
}
|
}
|
||||||
then
|
then
|
||||||
echo "Already has static library: $MPI_ARCH_PATH"
|
echo "Already has static library: $PKG_PREFIX"
|
||||||
else
|
else
|
||||||
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
|
echo "Starting build: $WM_MPLIB ($PACKAGE)"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
(
|
(
|
||||||
@ -188,21 +187,19 @@ else
|
|||||||
# End of configuration options
|
# End of configuration options
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
|
||||||
buildDIR=$buildBASE/$mpiPACKAGE
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
cd "$PKG_SOURCE" || exit
|
||||||
|
|
||||||
cd "$MPI_SOURCE_DIR" || exit
|
make distclean 2>/dev/null || true
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
[ -e Makefile ] && make distclean 2>/dev/null
|
|
||||||
|
|
||||||
rm -rf $MPI_ARCH_PATH
|
rm -rf "$PKG_PREFIX"
|
||||||
rm -rf $buildDIR
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
cd $buildDIR
|
|
||||||
|
|
||||||
set -x
|
cd "$PKG_BUILD" && set -x && \
|
||||||
$MPI_SOURCE_DIR/configure \
|
"$PKG_SOURCE"/configure \
|
||||||
--prefix=$MPI_ARCH_PATH \
|
--prefix="$PKG_PREFIX" \
|
||||||
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
--disable-orterun-prefix-by-default \
|
--disable-orterun-prefix-by-default \
|
||||||
--enable-shared --disable-static \
|
--enable-shared --disable-static \
|
||||||
--enable-mpi-fortran=none \
|
--enable-mpi-fortran=none \
|
||||||
@ -210,12 +207,13 @@ else
|
|||||||
&& set +x \
|
&& set +x \
|
||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: $mpiPACKAGE" \
|
&& echo "Built: $PACKAGE" \
|
||||||
&& pkgconfigAdjust $MPI_ARCH_PATH
|
&& pkgconfigAdjust "$PKG_PREFIX"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: $mpiPACKAGE"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
124
makePETSC
124
makePETSC
@ -20,31 +20,36 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
if : # Run from third-party directory
|
||||||
# Run from third-party directory only
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
_foamConfig petsc
|
_foamConfig petsc
|
||||||
|
|
||||||
petscPACKAGE="${petsc_version:-petsc-system}"
|
PETSC_PACKAGE="${petsc_version:-none}"
|
||||||
targetType=libso
|
targetType=libso
|
||||||
|
|
||||||
unset hyprePACKAGE
|
unset HYPRE_PACKAGE
|
||||||
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
||||||
|
|
||||||
|
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||||
|
then
|
||||||
|
unset PETSC_ARCH_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions petsc; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [PETSC-VERSION] [-- configure-options]
|
Usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [PETSC-VERSION] [-- configure-options]
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if include/library already exists
|
-force Force compilation, even if include/library already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
@ -52,19 +57,20 @@ options:
|
|||||||
-debug Build with debugging enabled
|
-debug Build with debugging enabled
|
||||||
-hypre=URL Specify hypre download location
|
-hypre=URL Specify hypre download location
|
||||||
-no-hypre Disable automatic hypre download/detection
|
-no-hypre Disable automatic hypre download/detection
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build PETSC with
|
* build PETSC with
|
||||||
${petscPACKAGE:-'unspecified petsc version'}
|
${PACKAGE:-[unspecified]}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint PETSC
|
showDownloadHint petsc
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Many people who have downloaded PETSC have also downloaded HYPRE :"
|
echo "Many people who have downloaded PETSC have also downloaded HYPRE :"
|
||||||
showDownloadHint HYPRE
|
showDownloadHint hypre
|
||||||
|
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler # Compiler info for CMake/configure
|
exportCompiler # Compiler info for CMake/configure
|
||||||
@ -77,7 +83,8 @@ do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
-inplace) optInplace=true ;;
|
-inplace) optInplace=true ;;
|
||||||
@ -87,21 +94,23 @@ do
|
|||||||
|
|
||||||
-hypre=*)
|
-hypre=*)
|
||||||
optHypre="${1#*=}" # URL for download
|
optHypre="${1#*=}" # URL for download
|
||||||
unset hyprePACKAGE HYPRE_ARCH_PATH
|
unset HYPRE_PACKAGE HYPRE_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-no-hypre)
|
-no-hypre)
|
||||||
optHypre=false
|
optHypre=false
|
||||||
unset hyprePACKAGE HYPRE_ARCH_PATH
|
unset HYPRE_PACKAGE HYPRE_ARCH_PATH
|
||||||
;;
|
;;
|
||||||
|
|
||||||
hypre-[0-9]* | hypre-git)
|
hypre-[0-9]* | hypre-git)
|
||||||
hyprePACKAGE="${1%%/}"
|
HYPRE_PACKAGE="${1%%/}"
|
||||||
unset optHypre
|
unset optHypre
|
||||||
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
petsc/* | sources/petsc* |\
|
||||||
petsc-[0-9]* | petsc-git)
|
petsc-[0-9]* | petsc-git)
|
||||||
petscPACKAGE="${1%%/}"
|
PETSC_PACKAGE="${1%%/}"
|
||||||
unset PETSC_ARCH_PATH # Avoid inconsistency
|
unset PETSC_ARCH_PATH # Avoid inconsistency
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -111,16 +120,12 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$petscPACKAGE" ] || die "The petsc-VERSION was not specified"
|
if [ -z "$PETSC_PACKAGE" ]
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone "$petscPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using petsc-none (skip ThirdParty build of PETSC)"
|
die "The PETSC package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PETSC_PACKAGE" || _foamIsSystem "$PETSC_PACKAGE"
|
||||||
elif _foamIsSystem "$petscPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using petsc-system"
|
echo "Using none/system (skip ThirdParty build of PETSC)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -128,11 +133,11 @@ fi
|
|||||||
# Integrations
|
# Integrations
|
||||||
|
|
||||||
# Clunky
|
# Clunky
|
||||||
if [ -z "$optHypre" ] && [ -n "$hyprePACKAGE" ] \
|
if [ -z "$optHypre" ] && [ -n "$HYPRE_PACKAGE" ] \
|
||||||
&& ! _foamIsNone "$hyprePACKAGE"
|
&& ! _foamIsNone "$HYPRE_PACKAGE"
|
||||||
then
|
then
|
||||||
echo "Using $hyprePACKAGE"
|
echo "Using $HYPRE_PACKAGE"
|
||||||
: "${HYPRE_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$hyprePACKAGE}"
|
: "${HYPRE_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$HYPRE_PACKAGE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -140,15 +145,22 @@ fi
|
|||||||
#
|
#
|
||||||
# Build PETSC
|
# Build PETSC
|
||||||
#
|
#
|
||||||
# PETSC_ARCH_PATH : installation directory
|
# PETSC_ARCH_PATH : installation directory (as per config file)
|
||||||
# PETSC_SOURCE_DIR : location of the original sources
|
#
|
||||||
|
# *PACKAGE : name-version of the package
|
||||||
|
# *SOURCE : location of original sources
|
||||||
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
PETSC_SOURCE_DIR="$sourceBASE/$petscPACKAGE"
|
PETSC_SOURCE="$(findSourceDir "$PETSC_PACKAGE")"
|
||||||
: "${PETSC_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$petscPACKAGE}"
|
PETSC_PACKAGE="$(basename "$PETSC_PACKAGE")"
|
||||||
|
PETSC_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PETSC_PACKAGE"
|
||||||
|
|
||||||
[ -d "$PETSC_SOURCE_DIR" ] || {
|
# Override as per config file (if any)
|
||||||
echo "Missing sources: '$petscPACKAGE'"
|
[ -n "$PETSC_ARCH_PATH" ] && PETSC_PREFIX="$PETSC_ARCH_PATH"
|
||||||
showDownloadHint PETSC
|
|
||||||
|
[ -d "$PETSC_SOURCE" ] || {
|
||||||
|
echo "Missing sources: '$PETSC_PACKAGE'"
|
||||||
|
showDownloadHint petsc
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,29 +170,28 @@ archOpt="$WM_SIZE_OPTIONS"
|
|||||||
|
|
||||||
if [ -n "$optInplace" ]
|
if [ -n "$optInplace" ]
|
||||||
then
|
then
|
||||||
unset installPrefix
|
# Inplace installation. No install stage required
|
||||||
# No install stage requires
|
unset PETSC_PREFIX
|
||||||
makeInstall() { true; }
|
makeInstall() { true; }
|
||||||
else
|
else
|
||||||
|
# Regular installation location (PETSC_PREFIX)
|
||||||
# Regular installation location
|
|
||||||
installPrefix="$PETSC_ARCH_PATH"
|
|
||||||
|
|
||||||
makeInstall() {
|
makeInstall() {
|
||||||
make PETSC_DIR="$PETSC_SOURCE_DIR" PETSC_ARCH="$archOpt" install
|
make PETSC_DIR="$PETSC_SOURCE" PETSC_ARCH="$archOpt" install
|
||||||
|
pkgconfigAdjust "$PETSC_PREFIX"
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting build: $petscPACKAGE ($targetType)"
|
echo "Starting build: $PETSC_PACKAGE ($targetType)"
|
||||||
if [ "$WM_PRECISION_OPTION" = SP ]
|
if [ "$WM_PRECISION_OPTION" = SP ]
|
||||||
then
|
then
|
||||||
optHypre=false # No single-precision hypre
|
optHypre=false # No single-precision hypre
|
||||||
echo "No single-precision hypre"
|
echo "No single-precision hypre"
|
||||||
fi
|
fi
|
||||||
if [ -d "$PETSC_SOURCE_DIR/$archOpt/externalpackages" ]
|
if [ -d "$PETSC_SOURCE/$archOpt/externalpackages" ]
|
||||||
then
|
then
|
||||||
echo "Removing old $archOpt/externalpackages"
|
echo "Removing old $archOpt/externalpackages"
|
||||||
rm -rf "$PETSC_SOURCE_DIR/$archOpt/externalpackages"
|
rm -rf "$PETSC_SOURCE/$archOpt/externalpackages"
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
(
|
(
|
||||||
@ -233,7 +244,7 @@ echo
|
|||||||
# This is a really clunky way to use ThirdParty hypre
|
# This is a really clunky way to use ThirdParty hypre
|
||||||
if [ -f "$HYPRE_ARCH_PATH/include/HYPRE.h" ]
|
if [ -f "$HYPRE_ARCH_PATH/include/HYPRE.h" ]
|
||||||
then
|
then
|
||||||
echo "Has installed hypre: $hyprePACKAGE"
|
echo "Has installed hypre: $HYPRE_PACKAGE"
|
||||||
configOpt="$configOpt --with-hypre-dir=$HYPRE_ARCH_PATH"
|
configOpt="$configOpt --with-hypre-dir=$HYPRE_ARCH_PATH"
|
||||||
else
|
else
|
||||||
configOpt="$configOpt --download-hypre"
|
configOpt="$configOpt --download-hypre"
|
||||||
@ -254,17 +265,20 @@ echo
|
|||||||
unset CC CXX
|
unset CC CXX
|
||||||
unset CFLAGS CXXFLAGS
|
unset CFLAGS CXXFLAGS
|
||||||
|
|
||||||
cd "$PETSC_SOURCE_DIR" || exit
|
cd "$PETSC_SOURCE" || exit
|
||||||
unset GIT_DIR # No special git-repo handling
|
unset GIT_DIR # No special git-repo handling
|
||||||
|
|
||||||
rm -rf "$PETSC_ARCH_PATH"
|
if [ -n "$PETSC_PREFIX" ]
|
||||||
|
then
|
||||||
|
rm -rf "$PETSC_PREFIX"
|
||||||
|
fi
|
||||||
# No clean here, if we have multiple arch in the same directory
|
# No clean here, if we have multiple arch in the same directory
|
||||||
|
|
||||||
echo
|
echo
|
||||||
set -x
|
set -x
|
||||||
./configure \
|
./configure \
|
||||||
${installPrefix:+--prefix="$installPrefix"} \
|
${PETSC_PREFIX:+--prefix="$PETSC_PREFIX"} \
|
||||||
--PETSC_DIR="$PETSC_SOURCE_DIR" \
|
--PETSC_DIR="$PETSC_SOURCE" \
|
||||||
--with-petsc-arch="$archOpt" \
|
--with-petsc-arch="$archOpt" \
|
||||||
--with-clanguage=C \
|
--with-clanguage=C \
|
||||||
--with-fc=0 \
|
--with-fc=0 \
|
||||||
@ -273,12 +287,12 @@ echo
|
|||||||
&& set +x \
|
&& set +x \
|
||||||
&& echo "Configured: petsc" \
|
&& echo "Configured: petsc" \
|
||||||
&& make ${WM_NCOMPPROCS:+-j $WM_NCOMPPROCS} \
|
&& make ${WM_NCOMPPROCS:+-j $WM_NCOMPPROCS} \
|
||||||
PETSC_DIR="$PETSC_SOURCE_DIR" PETSC_ARCH="$archOpt" all \
|
PETSC_DIR="$PETSC_SOURCE" PETSC_ARCH="$archOpt" all \
|
||||||
&& echo "Built: petsc" \
|
&& echo "Built: petsc" \
|
||||||
&& makeInstall \
|
&& makeInstall \
|
||||||
&& echo "Installed: petsc - may require etc/pkgconfigPrefix to relocate"
|
&& echo "Installed: $PETSC_PACKAGE"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: petsc"
|
echo "Error building: $PETSC_PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
makeParaView
34
makeParaView
@ -26,20 +26,21 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
. etc/tools/ParaViewFunctions
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ParaViewFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
unset ParaView_VERSION # Purge current values
|
|
||||||
|
|
||||||
# ParaView_VERSION from etc/config.sh file:
|
# ParaView_VERSION from etc/config.sh file:
|
||||||
|
unset ParaView_VERSION # Purge current values
|
||||||
_foamConfig paraview
|
_foamConfig paraview
|
||||||
|
|
||||||
# Avoid any potential conflicts (especially if building from git)
|
# Avoid any potential conflicts (especially if building from git)
|
||||||
@ -71,13 +72,12 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions paraview; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
: ${ParaView_VERSION:=none} # some dummy value for usage information
|
: ${ParaView_VERSION:=none} # some dummy value for usage information
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [paraview-VERSION] [CMAKE-OPTION]
|
Usage: ${0##*/} [OPTION] [paraview-VERSION] [CMAKE-OPTION]
|
||||||
options:
|
options:
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-cmake PATH with cmake from the given path
|
-cmake PATH with cmake from the given path
|
||||||
@ -105,7 +105,8 @@ options:
|
|||||||
-buildType NAME specify the build type (default: Release)
|
-buildType NAME specify the build type (default: Release)
|
||||||
-suffix NAME specify a suffix to distinguish the build
|
-suffix NAME specify a suffix to distinguish the build
|
||||||
-DNAME=VALUE add cmake variable
|
-DNAME=VALUE add cmake variable
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
The -no-FEATURE option can be used to forcibly disable these features:
|
The -no-FEATURE option can be used to forcibly disable these features:
|
||||||
-no-gl2 | -no-mesa | -no-mpi | -no-python | -no-qt
|
-no-gl2 | -no-mesa | -no-mpi | -no-python | -no-qt
|
||||||
@ -134,8 +135,8 @@ For example,
|
|||||||
Or change the \$WM_PROJECT_DIR/etc/config.sh/paraview settings.
|
Or change the \$WM_PROJECT_DIR/etc/config.sh/paraview settings.
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint PARAVIEW
|
showDownloadHint paraview
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler minimal # Minimal compiler info for CMake/configure
|
exportCompiler minimal # Minimal compiler info for CMake/configure
|
||||||
@ -149,11 +150,14 @@ while [ "$#" -gt 0 ]
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
|
|
||||||
[0-9]* | paraview-[0-9]* | ParaView-[0-9]*) # paraview version
|
# paraview version
|
||||||
setParaViewVersion "${1%%/}"
|
paraview/* | vtk/* | sources/paraview* | sources/vtk* |\
|
||||||
|
[0-9]* | paraview-[0-9]* | ParaView-[0-9]* | ParaView-v[0-9]*)
|
||||||
|
setParaViewVersion "$(basename "$1")"
|
||||||
;;
|
;;
|
||||||
-D[A-Z]*=* | [A-Z]*=*) # cmake variables
|
-D[A-Z]*=* | [A-Z]*=*) # cmake variables
|
||||||
addCMakeVariable "$1"
|
addCMakeVariable "$1"
|
||||||
|
|||||||
95
makeQt
95
makeQt
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011 OpenFOAM Foundation
|
# Copyright (C) 2011 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -21,37 +21,40 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
. etc/tools/QtFunctions
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/QtFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions qt; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [qt-VERSION] [-- configure-options]
|
Usage: ${0##*/} [OPTION] [qt-VERSION] [-- configure-options]
|
||||||
options:
|
options:
|
||||||
-force Force compilation, even if it already exists
|
-force Force compilation, even if it already exists
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
* build $qtTYPE, version ${qtVERSION:-undefined}
|
* build $qtTYPE, version ${qtVERSION:-undefined}
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
showDownloadHint QT
|
showDownloadHint qt
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler true # Compiler info + flags for CMake/configure
|
exportCompiler true # Compiler info + flags for CMake/configure
|
||||||
|
|
||||||
unset optForce
|
unset optForce
|
||||||
|
unset PACKAGE qtVERSION
|
||||||
|
|
||||||
# Parse options
|
# Parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
@ -59,14 +62,22 @@ do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
-force) optForce=true ;;
|
-force) optForce=true ;;
|
||||||
|
|
||||||
|
qt/* | sources/qt*)
|
||||||
|
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
|
||||||
|
PACKAGE="${1%%/}";
|
||||||
|
qtVERSION="$(basename "$PACKAGE" | sed 's#^.*-##')"
|
||||||
|
;;
|
||||||
|
|
||||||
-qt-[0-9]* | [0-9]* | qt-*)
|
-qt-[0-9]* | [0-9]* | qt-*)
|
||||||
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
|
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
|
||||||
qtVERSION="${1%%/}";
|
qtVERSION="${1%%/}";
|
||||||
qtVERSION="${qtVERSION##*-}"
|
qtVERSION="${qtVERSION##*-}"
|
||||||
|
PACKAGE="$qtTYPE-$qtVERSION"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
@ -75,38 +86,41 @@ do
|
|||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
qtPACKAGE=$qtTYPE-$qtVERSION
|
|
||||||
|
|
||||||
# Nothing to build
|
if [ -z "$PACKAGE" ]
|
||||||
if _foamIsNone "$qtPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using qt-none (skip ThirdParty build of QT)"
|
die "The QT package/version not specified"
|
||||||
exit 0
|
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||||
elif _foamIsSystem "$qtPACKAGE"
|
|
||||||
then
|
then
|
||||||
echo "Using qt-system"
|
echo "Using none/system (skip ThirdParty build of QT)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Build QT
|
# Build QT
|
||||||
|
#
|
||||||
|
# *PACKAGE : name-version of the package
|
||||||
|
# *SOURCE : location of original sources
|
||||||
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
QT_SOURCE_DIR=$sourceBASE/$qtPACKAGE
|
PKG_SOURCE="$(findSourceDir "$PACKAGE" "$qtTYPE-$qtVERSION")"
|
||||||
QT_ARCH_PATH=$installBASE/qt-$qtVERSION
|
PACKAGE="qt-$qtVERSION"
|
||||||
|
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||||
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo ========================================
|
echo ========================================
|
||||||
echo "Build Qt $qtPACKAGE"
|
echo "Build Qt $PACKAGE"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& [ -d "$QT_ARCH_PATH" ] \
|
&& [ -d "$PKG_PREFIX" ] \
|
||||||
&& [ -r "$QT_ARCH_PATH/bin/qmake" ]
|
&& [ -r "$PKG_PREFIX"/bin/qmake ]
|
||||||
then
|
then
|
||||||
echo "Already built: Qt-$qtVERSION"
|
echo "Already built: $PACKAGE"
|
||||||
else
|
else
|
||||||
echo "Starting build: Qt-$qtVERSION"
|
echo "Starting build: $PACKAGE"
|
||||||
(
|
(
|
||||||
# Configuration options:
|
# Configuration options:
|
||||||
unset configOpt
|
unset configOpt
|
||||||
@ -140,35 +154,34 @@ else
|
|||||||
|
|
||||||
# End of configuration options
|
# End of configuration options
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
buildDIR=$buildBASE/$qtPACKAGE
|
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||||
|
|
||||||
cd "$QT_SOURCE_DIR" || exit
|
cd "$PKG_SOURCE" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
[ -e Makefile ] && make distclean 2>/dev/null
|
[ -e Makefile ] && make distclean 2>/dev/null
|
||||||
|
|
||||||
# Remove any existing build folder and recreate
|
# Remove any existing build folder and recreate
|
||||||
rm -rf $QT_ARCH_DIR
|
rm -rf "$PKG_PREFIX"
|
||||||
rm -rf $buildDIR 2>/dev/null
|
rm -rf "$PKG_BUILD"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$PKG_BUILD"
|
||||||
|
|
||||||
# Remove any remnants from a previous shadow build
|
# Remove any remnants from a previous shadow build
|
||||||
rm -f "$QT_SOURCE_DIR/.qmake.cache" 2>/dev/null
|
rm -f "$PKG_SOURCE"/.qmake.cache
|
||||||
rm -f "$QT_SOURCE_DIR/src/corelib/global/qconfig.h" 2>/dev/null
|
rm -f "$PKG_SOURCE"/src/corelib/global/qconfig.h
|
||||||
rm -f "$QT_SOURCE_DIR/src/corelib/global/qconfig.cpp" 2>/dev/null
|
rm -f "$PKG_SOURCE"/src/corelib/global/qconfig.cpp
|
||||||
|
|
||||||
cd "$buildDIR" || exit
|
cd "$PKG_BUILD" || exit
|
||||||
|
|
||||||
# Compile as opensource, accepting LGPL conditions (yes)
|
# Compile as opensource, accepting LGPL conditions (yes)
|
||||||
echo yes | $QT_SOURCE_DIR/configure \
|
echo yes | "$PKG_SOURCE"/configure \
|
||||||
-prefix $QT_ARCH_PATH \
|
-prefix "$PKG_PREFIX" \
|
||||||
-opensource \
|
-opensource \
|
||||||
$configOpt \
|
$configOpt \
|
||||||
&& time make -j $WM_NCOMPPROCS \
|
&& time make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built: Qt-$qtVERSION" \
|
&& echo "Built: $PACKAGE" \
|
||||||
&& finalizeQt
|
&& finalizeQt "$PKG_PREFIX"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: Qt-$qtVERSION"
|
echo "Error building: $PACKAGE"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|||||||
14
makeSCOTCH
14
makeSCOTCH
@ -20,13 +20,15 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
fi
|
||||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
_foamConfig scotch # Get SCOTCH_ARCH_PATH, SCOTCH_VERSION
|
_foamConfig scotch # Get SCOTCH_ARCH_PATH, SCOTCH_VERSION
|
||||||
@ -36,6 +38,11 @@ PACKAGE="${SCOTCH_VERSION:-system}"
|
|||||||
unset withMPI
|
unset withMPI
|
||||||
case "$WM_MPLIB" in (*MPI*) [ "$FOAM_MPI" = dummy ] || withMPI=true ;; esac
|
case "$WM_MPLIB" in (*MPI*) [ "$FOAM_MPI" = dummy ] || withMPI=true ;; esac
|
||||||
|
|
||||||
|
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||||
|
then
|
||||||
|
unset SCOTCH_ARCH_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
printVersions() { listPackageVersions scotch; exit 0; }
|
printVersions() { listPackageVersions scotch; exit 0; }
|
||||||
printHelp() {
|
printHelp() {
|
||||||
@ -82,7 +89,8 @@ do
|
|||||||
-no-mpi) unset withMPI ;;
|
-no-mpi) unset withMPI ;;
|
||||||
-no-extlib) optNoExtlib=true ;; # Hidden option
|
-no-extlib) optNoExtlib=true ;; # Hidden option
|
||||||
|
|
||||||
scotch-[0-9]* | scotch-git | scotch_* )
|
scotch/ | sources/scotch* |\
|
||||||
|
scotch-[0-9]* | scotch-v[0-9]* | scotch-git | scotch_* )
|
||||||
PACKAGE="${1%%/}"
|
PACKAGE="${1%%/}"
|
||||||
unset SCOTCH_ARCH_PATH # Avoid inconsistency
|
unset SCOTCH_ARCH_PATH # Avoid inconsistency
|
||||||
;;
|
;;
|
||||||
@ -118,7 +126,7 @@ fi
|
|||||||
# *SOURCE : location of original sources
|
# *SOURCE : location of original sources
|
||||||
# *PREFIX : installation directory
|
# *PREFIX : installation directory
|
||||||
|
|
||||||
PKG_SOURCE="$sourceBASE/$PACKAGE"
|
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||||
PACKAGE="$(basename "$PACKAGE")"
|
PACKAGE="$(basename "$PACKAGE")"
|
||||||
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||||
export GIT_DIR="$PKG_SOURCE/.git"
|
export GIT_DIR="$PKG_SOURCE/.git"
|
||||||
|
|||||||
37
makeVTK
37
makeVTK
@ -27,21 +27,21 @@
|
|||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Run from third-party directory only
|
if : # Run from third-party directory
|
||||||
|
then
|
||||||
cd "${0%/*}" || exit
|
cd "${0%/*}" || exit
|
||||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||||
echo " Check your OpenFOAM environment and installation"
|
echo " Check your OpenFOAM environment and installation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
. etc/tools/ThirdPartyFunctions
|
fi
|
||||||
. etc/tools/ParaViewFunctions
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||||
. etc/tools/vtkFunctions
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ParaViewFunctions
|
||||||
|
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/vtkFunctions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
# Obtain version from OpenFOAM etc/config.sh file:
|
||||||
unset vtk_version mesa_version # Purge current values
|
unset vtk_version mesa_version # Purge current values
|
||||||
|
|
||||||
# vtk version from OpenFOAM etc/config.sh file:
|
|
||||||
_foamConfig vtk
|
_foamConfig vtk
|
||||||
|
|
||||||
VTK_VERSION="$vtk_version"
|
VTK_VERSION="$vtk_version"
|
||||||
@ -63,12 +63,11 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printVersions() { listPackageVersions vtk; exit 0; }
|
||||||
exec 1>&2
|
printHelp() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [vtk-VERSION] [CMAKE-OPTION]
|
Usage: ${0##*/} [OPTION] [vtk-VERSION] [CMAKE-OPTION]
|
||||||
options:
|
options:
|
||||||
-gcc Force use of gcc/g++
|
-gcc Force use of gcc/g++
|
||||||
-cmake PATH with cmake from the given path
|
-cmake PATH with cmake from the given path
|
||||||
@ -87,7 +86,8 @@ options:
|
|||||||
-buildType NAME specify the build type (default: Release)
|
-buildType NAME specify the build type (default: Release)
|
||||||
-suffix NAME specify a suffix to distinguish the build
|
-suffix NAME specify a suffix to distinguish the build
|
||||||
-DNAME=VALUE add cmake variable
|
-DNAME=VALUE add cmake variable
|
||||||
-help
|
-list List available unpacked source versions
|
||||||
|
-help Display usage help
|
||||||
|
|
||||||
The -no-FEATURE option can be used to forcibly disable these features:
|
The -no-FEATURE option can be used to forcibly disable these features:
|
||||||
-no-gl2 | -no-mesa | -no-mpi
|
-no-gl2 | -no-mesa | -no-mpi
|
||||||
@ -109,8 +109,8 @@ For finer control, the build stages can be selected or deselected individually:
|
|||||||
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/VTK-$VTK_VERSION$BUILD_SUFFIX
|
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/VTK-$VTK_VERSION$BUILD_SUFFIX
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
# showDownloadHint VTK
|
# showDownloadHint vtk
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
exportCompiler minimal # Minimal compiler info for CMake/configure
|
exportCompiler minimal # Minimal compiler info for CMake/configure
|
||||||
@ -124,11 +124,14 @@ while [ "$#" -gt 0 ]
|
|||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'') ;; # Ignore empty
|
'') ;; # Ignore empty
|
||||||
-h | -help) usage ;;
|
-h | -help*) printHelp;;
|
||||||
|
-list) printVersions;;
|
||||||
-gcc) useGcc ;;
|
-gcc) useGcc ;;
|
||||||
|
|
||||||
[0-9]* | vtk-[0-9]* | VTK-[0-9]*) # VTK version
|
# VTK version
|
||||||
setVtkVersion "${1%%/}"
|
paraview/* | vtk/* | sources/paraview* | sources/vtk* |\
|
||||||
|
[0-9]* | vtk-[0-9]* | VTK-[0-9]*)
|
||||||
|
setVtkVersion "$(basename "$1")"
|
||||||
;;
|
;;
|
||||||
-D[A-Z]*=* | [A-Z]*=*) # cmake variables
|
-D[A-Z]*=* | [A-Z]*=*) # cmake variables
|
||||||
addCMakeVariable "$1"
|
addCMakeVariable "$1"
|
||||||
|
|||||||
51
minCmake
51
minCmake
@ -6,7 +6,7 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -28,12 +28,10 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printHelp() {
|
||||||
exec 1>&2
|
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [dir1 ... dirN]
|
Usage: ${0##*/} [OPTION] [dir1 ... dirN]
|
||||||
options:
|
options:
|
||||||
-help
|
-help
|
||||||
|
|
||||||
@ -41,18 +39,17 @@ options:
|
|||||||
* Without any arguments, select all first level directories.
|
* Without any arguments, select all first level directories.
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 0 # Clean exit
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Parse options
|
# Parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | -help)
|
-h | -help*) printHelp;;
|
||||||
usage
|
|
||||||
;;
|
|
||||||
-*)
|
-*)
|
||||||
usage "unknown option: '$1'"
|
echo "$0: Error unknown option: '$1'" 1>&2
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
break
|
||||||
@ -62,22 +59,50 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Nothing specified - use first level of unpacked directories
|
# Nothing specified - use first level of unpacked directories
|
||||||
[ "$#" -gt 0 ] || set -- $(find -mindepth 1 -maxdepth 1 -type d)
|
if [ "$#" -eq 0 ]
|
||||||
|
then
|
||||||
|
set -- \
|
||||||
|
$(
|
||||||
|
echo "searching..." 1>&2
|
||||||
|
find . -mindepth 2 -maxdepth 2 -name CMakeLists.txt
|
||||||
|
for dir in sources/*
|
||||||
|
do
|
||||||
|
[ -d "$dir" ] || continue
|
||||||
|
## echo "search <$dir>" 1>&2
|
||||||
|
depth=1
|
||||||
|
# Is sources/pkg/pkg-version ?
|
||||||
|
if [ "$(echo "$dir" | sed -e 's#.*/[a-z][a-z]*##' | wc -w)" = 0 ]
|
||||||
|
then
|
||||||
|
depth=2
|
||||||
|
fi
|
||||||
|
find "$dir" -maxdepth "$depth" -name CMakeLists.txt
|
||||||
|
done
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "processing..." 1>&2
|
||||||
for dir
|
for dir
|
||||||
do
|
do
|
||||||
dir="${dir#./}" # Remove leading "./"
|
dir="${dir#./}" # Remove leading "./"
|
||||||
dir="${dir%/}" # Remove trailing "/"
|
dir="${dir%/}" # Remove trailing "/"
|
||||||
|
|
||||||
|
case "$dir" in
|
||||||
|
(*/CMakeLists.txt) file="$dir" ;;
|
||||||
|
(*) file="$dir/CMakeLists.txt" ;;
|
||||||
|
esac
|
||||||
|
dir="$(dirname "$file")"
|
||||||
|
dir="$(basename "$dir")"
|
||||||
|
|
||||||
min=$(sed -n \
|
min=$(sed -n \
|
||||||
-e 's/^.*cmake_minimum.*VERSION *\([0-9.][0-9.]*\).*/\1/p' \
|
-e 's/^.*cmake_minimum.*VERSION *\([0-9.][0-9.]*\).*/\1/p' \
|
||||||
"$dir/CMakeLists.txt" \
|
"$file" \
|
||||||
2>/dev/null | head -1)
|
2>/dev/null | head -1)
|
||||||
|
|
||||||
if [ -n "$min" ]
|
if [ -n "$min" ]
|
||||||
then
|
then
|
||||||
# Remove trailing ".0" from version
|
# Remove trailing ".0" from version
|
||||||
echo "${min%.0}" "${dir#sources/}"
|
echo "${min%.0}" "$dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done \
|
done \
|
||||||
|
|||||||
Reference in New Issue
Block a user