Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c72929887 | |||
| 365730e5b7 | |||
| d5589614f4 | |||
| c30d606f52 | |||
| ad69b472e6 | |||
| 525f3f4e67 | |||
| 43606b62df | |||
| 1054dd83cf | |||
| 0d0f439dde | |||
| 325e3e230d | |||
| f1fe6c9866 | |||
| 1f6835794f | |||
| 665437cf8c | |||
| cd853a6270 | |||
| 2beb3cfbc9 | |||
| c8542bd70d | |||
| f84990e906 | |||
| ddfdec4cd9 | |||
| 834efe6dda | |||
| 69cff3b3d3 | |||
| c3aa2a4bfe | |||
| 9a3938551a | |||
| 28f482b836 | |||
| 53a1736aad | |||
| f197c721c8 | |||
| 11e3723f10 | |||
| 9a8a4852bc | |||
| 507c01e485 |
10
.gitignore
vendored
10
.gitignore
vendored
@ -12,9 +12,13 @@
|
||||
*.tgz
|
||||
*.gtgz
|
||||
|
||||
# Ignore build and platforms folders
|
||||
build/
|
||||
platforms/
|
||||
# Ignore standard input/output folders
|
||||
/build/
|
||||
/download/
|
||||
/opt/
|
||||
/platforms/
|
||||
/sources/
|
||||
/unpack/
|
||||
|
||||
# Generated files in the main directory
|
||||
/*.html
|
||||
|
||||
259
Allclean
259
Allclean
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -28,94 +28,173 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
# . etc/tools/ThirdPartyFunctions
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
Usage: ${0##*/} [OPTION] [platform [ ... platformN]]
|
||||
Usage: ${0##*/} [OPTION]
|
||||
options:
|
||||
-all remove all platforms directories
|
||||
-current clean the current platform ($WM_OPTIONS)
|
||||
-help print the usage
|
||||
-build Remove all 'build' directories
|
||||
-current Clean the current platform ($WM_OPTIONS)
|
||||
-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.
|
||||
Optionally remove specified platform(s) from the ThirdParty platforms
|
||||
directory $WM_THIRD_PARTY_DIR/platforms
|
||||
directory \$WM_THIRD_PARTY_DIR/platforms
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
|
||||
# Print help message
|
||||
case "$1" in
|
||||
(-h | -help*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
#------------------------------------------------------------------------------
|
||||
unset optDryRun optCleanType optPlatformName
|
||||
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
--) 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
|
||||
shift
|
||||
done
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
[ -n "$optCleanType" ] || die "No clean operation specified"
|
||||
|
||||
# Clean various packages via 'distclean'
|
||||
for i in \
|
||||
openmpi-* metis-* adios-* ADIOS-* gperftools-* qt-* \
|
||||
gmp-* mpfr-* mpc-* gcc-* llvm-* \
|
||||
;
|
||||
do
|
||||
if [ -d "$i" ]
|
||||
then
|
||||
(
|
||||
echo
|
||||
echo "${i%/*}"
|
||||
echo " make distclean"
|
||||
echo
|
||||
cd $i && make distclean
|
||||
# sources
|
||||
case "$optCleanType" in (*full* | *source*)
|
||||
|
||||
# Clean various packages via 'distclean'
|
||||
for dir in \
|
||||
$(etc/list-available -dirs \
|
||||
gcc \
|
||||
gmp \
|
||||
gperftools \
|
||||
llvm \
|
||||
metis \
|
||||
mpc \
|
||||
mpfr \
|
||||
openmpi \
|
||||
qt \
|
||||
)
|
||||
fi
|
||||
done
|
||||
do
|
||||
if [ -n "$optDryRun" ]
|
||||
then
|
||||
echo "$dir : ${optDryRun}make distclean"
|
||||
elif [ -d "$dir" ]
|
||||
then
|
||||
(
|
||||
cd "$dir" 2>/dev/null || exit
|
||||
echo
|
||||
echo "$dir : make distclean"
|
||||
echo
|
||||
make distclean || true
|
||||
)
|
||||
fi
|
||||
done
|
||||
|
||||
# Clean scotch (src) with 'realclean'
|
||||
for dir in $(etc/list-available -dirs scotch)
|
||||
do
|
||||
dir="$dir/src" # Within the src directory!
|
||||
|
||||
# Clean various packages via 'realclean'
|
||||
for i in scotch*/src
|
||||
do
|
||||
if [ -d "$i" ]
|
||||
if [ -n "$optDryRun" ]
|
||||
then
|
||||
echo "$dir : ${optDryRun}make realclean"
|
||||
elif [ -d "$dir" ]
|
||||
then
|
||||
(
|
||||
cd "$dir" 2>/dev/null || exit
|
||||
echo
|
||||
echo "$dir : make realclean"
|
||||
echo
|
||||
make realclean || true
|
||||
)
|
||||
fi
|
||||
done
|
||||
|
||||
# Clean various packages via 'wclean'
|
||||
for dir in $(etc/list-available -dirs ccmio libccmio)
|
||||
do
|
||||
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
|
||||
|
||||
# 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
|
||||
if [ -d build ]
|
||||
then
|
||||
(
|
||||
echo
|
||||
echo "${i%/*}"
|
||||
echo " make realclean"
|
||||
echo
|
||||
cd $i && make realclean
|
||||
)
|
||||
echo "${optDryRun}Remove build/ directory contents"
|
||||
[ -z "$optDryRun" ] && rm -rf build/*
|
||||
fi
|
||||
done
|
||||
esac
|
||||
|
||||
|
||||
# Clean various packages via 'wclean'
|
||||
for i in libccmio*/Make kahip*/lib/Make
|
||||
do
|
||||
if [ -d "$i" ]
|
||||
then
|
||||
(
|
||||
echo
|
||||
echo "${i%/Make}"
|
||||
echo " wclean"
|
||||
echo
|
||||
cd ${i%/Make} && wclean
|
||||
)
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Clean out-of-source build directories
|
||||
if [ -d build ]
|
||||
then
|
||||
echo
|
||||
echo "Clean build/ directory"
|
||||
rm -rf build/*
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
@ -127,42 +206,28 @@ removePlatform()
|
||||
if [ -n "$platform" ] && [ -d "platforms/$platform" ]
|
||||
then
|
||||
echo
|
||||
echo "Cleaning platform '$platform'"
|
||||
rm -rf "platforms/$platform"
|
||||
echo "${optDryRun}Cleaning platform '$platform'"
|
||||
[ -z "$optDryRun" ] && "platforms/$platform"
|
||||
else
|
||||
echo
|
||||
echo "Platform '$platform' not built"
|
||||
echo "${optDryRun}Platform '$platform' not built"
|
||||
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)
|
||||
echo "Current platform '$WM_OPTIONS'"
|
||||
removePlatform "$WM_OPTIONS"
|
||||
;;
|
||||
# current platform
|
||||
case "$optCleanType" in (*full* | *current*)
|
||||
echo "${optDryRun}Remove current platform: '$WM_OPTIONS'"
|
||||
removePlatform "$WM_OPTIONS"
|
||||
esac
|
||||
|
||||
*)
|
||||
removePlatform "$1"
|
||||
;;
|
||||
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"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler true # Compiler info + flags for CMake/configure
|
||||
exportLinker # Linker flags for CMake/configure
|
||||
|
||||
56
BUILD.md
56
BUILD.md
@ -31,7 +31,7 @@ variety of versions of the third-party libraries, with the software
|
||||
version specified on the command-line. For example,
|
||||
```
|
||||
$ ./makeFFTW -help
|
||||
usage: makeFFTW [OPTION] [fftw-VERSION]
|
||||
Usage: makeFFTW [OPTION] [fftw-VERSION]
|
||||
```
|
||||
|
||||
---
|
||||
@ -431,7 +431,7 @@ you may have additional hurdles to using the newest versions of clang.
|
||||
|-----------------------|------------------------
|
||||
| [openmpi][page openmpi] | [download][link openmpi]. ***Some openmpi2/openmpi3 versions exhibit [stability issues](https://github.com/open-mpi/ompi/issues/5375)***
|
||||
| [adios][page adios] | [repo][repo adios] or [github download][link adios]
|
||||
| [scotch, ptscotch][page scotch] | [repo][repo scotch] or [download][link scotch] or [older][older scotch] or [even older][oldest scotch]
|
||||
| [scotch, ptscotch][page scotch] | [repo][repo scotch] or [download][link scotch] or [older][older scotch]
|
||||
| [kahip][page kahip] | [download][link kahip] or [older][older kahip]
|
||||
| [metis][page metis] | [download][link metis]
|
||||
|
||||
@ -441,7 +441,7 @@ you may have additional hurdles to using the newest versions of clang.
|
||||
| Name | Location
|
||||
|-----------------------|------------------------
|
||||
| [MESA][page mesa] | [download][link mesa] or [older 13][link mesa13], [older 11][link mesa11]
|
||||
| [ParaView][page ParaView] | [download][link ParaView] or older [paraview-56][link ParaView56], [paraview-55][link ParaView55] or [binaries][download ParaView]
|
||||
| [ParaView][page ParaView] | [download][link ParaView] or older [paraview-56][link ParaView56] or [binaries][download ParaView]
|
||||
| [Qt][page Qt] | [QT5][link Qt5] for ParaView-5.3.0 and later, or the [older qt-56][link Qt56] for older systems.
|
||||
|
||||
|
||||
@ -452,14 +452,16 @@ The minimum CMake requirements for building various components.
|
||||
2.8 llvm-3.4.2
|
||||
2.8.11 CGAL-4.9
|
||||
2.8.11 CGAL-4.11
|
||||
3.1 CGAL-4.12 -> CGAL-4.14.3
|
||||
2.8.12.2 llvm-3.7.0
|
||||
2.8.12.2 llvm-3.8.0
|
||||
2.8.4 cmake-3.6.0
|
||||
3.3 ParaView-5.6.3
|
||||
3.10 ParaView-5.7.0 - ParaView-5.8.0
|
||||
3.12 - 3.16 ParaView-5.9.0 - ParaView-5.10.1
|
||||
3.4.3 llvm-3.9.1
|
||||
3.4.3 llvm-4.0.0 - llvm-6.0.0
|
||||
3.6 ADIOS2
|
||||
3.12 ADIOS2
|
||||
```
|
||||
|
||||
### GCC Minimum Requirements <a name="min-gcc"></a>
|
||||
@ -524,56 +526,60 @@ easier to use `grep` and find the relevant pages and links.
|
||||
<!-- parallel -->
|
||||
[page adios]: https://csmd.ornl.gov/software/adios2
|
||||
[repo adios]: https://github.com/ornladios/ADIOS2
|
||||
[link adios]: https://github.com/ornladios/ADIOS2/archive/v2.4.0.tar.gz
|
||||
[link adios]: https://github.com/ornladios/ADIOS2/archive/v2.8.3.tar.gz
|
||||
|
||||
[page zfp]: http://computation.llnl.gov/projects/floating-point-compression/zfp-versions
|
||||
|
||||
[page scotch]: https://www.labri.fr/perso/pelegrin/scotch/
|
||||
[repo scotch]: https://gitlab.inria.fr/scotch/scotch
|
||||
[link scotch]: https://gforge.inria.fr/frs/download.php/file/38187/scotch_6.0.9.tar.gz
|
||||
[older scotch]: https://gforge.inria.fr/frs/download.php/file/38114/scotch_6.0.8.tar.gz
|
||||
[oldest scotch]: https://gforge.inria.fr/frs/download.php/file/37622/scotch_6.0.6.tar.gz
|
||||
[link scotch]: https://gitlab.inria.fr/scotch/scotch/-/archive/v6.1.3/scotch-v6.1.3.tar.gz
|
||||
[link scotch60_10]: https://gforge.inria.fr/frs/download.php/file/38350/scotch_6.0.10.tar.gz
|
||||
[link scotch60_9]: https://gforge.inria.fr/frs/download.php/file/38187/scotch_6.0.9.tar.gz
|
||||
[link scotch61_0]: https://gforge.inria.fr/frs/download.php/file/38352/scotch_6.1.0.tar.gz
|
||||
[link scotch61_3]: https://gitlab.inria.fr/scotch/scotch/-/archive/v6.1.3/scotch-v6.1.3.tar.gz
|
||||
[older scotch]: https://gforge.inria.fr/frs/download.php/file/38352/scotch_6.1.0.tar.gz
|
||||
[newer scotch]: https://gitlab.inria.fr/scotch/scotch/-/archive/v7.0.1/scotch-v7.0.1.tar.gz
|
||||
|
||||
[page kahip]: http://algo2.iti.kit.edu/documents/kahip/
|
||||
[older kahip]: http://algo2.iti.kit.edu/schulz/software_releases/KaHIP_2.00.tar.gz
|
||||
[link kahip]: http://algo2.iti.kit.edu/schulz/software_releases/KaHIP_2.12.tar.gz
|
||||
[older kahip]: http://algo2.iti.kit.edu/schulz/software_releases/KaHIP_2.12.tar.gz
|
||||
[link kahip]: https://github.com/KaHIP/KaHIP/archive/v3.14.tar.gz
|
||||
|
||||
[page metis]: http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
|
||||
[link metis]: http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz
|
||||
|
||||
[page openmpi]: http://www.open-mpi.org/
|
||||
[older openmpi]: https://download.open-mpi.org/release/open-mpi/v1.10/openmpi-1.10.7.tar.bz2
|
||||
[link openmpi]: https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.3.tar.bz2
|
||||
[link openmpi]: https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.2.tar.bz2
|
||||
|
||||
[page mpich]: http://www.mpich.org/
|
||||
[link mpich]: http://www.mpich.org/static/downloads/3.3/mpich-3.3.tar.gz
|
||||
[link mpich]: http://www.mpich.org/static/downloads/3.4.2/mpich-3.4.2.tar.gz
|
||||
|
||||
[page mvpapich]: http://mvapich.cse.ohio-state.edu/
|
||||
[link mvpapich]: http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.3.tar.gz
|
||||
[link mvpapich]: http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.3.6.tar.gz
|
||||
|
||||
<!-- general -->
|
||||
[page cmake]: http://www.cmake.org/
|
||||
[link cmake]: https://cmake.org/files/v3.8/cmake-3.8.2.tar.gz
|
||||
|
||||
[page boost]: http://boost.org
|
||||
[link boost]: https://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.bz2
|
||||
[link boost]: https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.bz2
|
||||
|
||||
[page CGAL]: http://cgal.org
|
||||
[link CGAL]: https://github.com/CGAL/cgal/releases/download/releases/CGAL-4.12.2/CGAL-4.12.2.tar.xz
|
||||
[link CGAL]: https://github.com/CGAL/cgal/releases/download/releases/CGAL-4.14.3/CGAL-4.14.3.tar.xz
|
||||
|
||||
[page FFTW]: http://www.fftw.org/
|
||||
[link FFTW]: http://www.fftw.org/fftw-3.3.7.tar.gz
|
||||
[link FFTW]: http://www.fftw.org/fftw-3.3.10.tar.gz
|
||||
|
||||
[page petsc]: https://www.mcs.anl.gov/petsc/
|
||||
[link petsc]: http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.2.tar.gz
|
||||
[link petsc]: https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.18.2.tar.gz
|
||||
|
||||
[page hypre]: https://computing.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods/
|
||||
[repo hypre]: https://github.com/hypre-space/hypre/
|
||||
[link hypre]: https://github.com/hypre-space/hypre/archive/v2.19.0.tar.gz
|
||||
[link hypre]: https://github.com/hypre-space/hypre/archive/v2.24.0.tar.gz
|
||||
|
||||
[page cgns]: http://cgns.github.io/
|
||||
[link ccmio]: http://portal.nersc.gov/project/visit/third_party/libccmio-2.6.1.tar.gz (check usage conditions)
|
||||
[altlink ccmio]: http://portal.nersc.gov/svn/visit/trunk/third_party/libccmio-2.6.1.tar.gz (check usage conditions)
|
||||
[altlink ccmio]: https://sourceforge.net/projects/foam-extend/files/ThirdParty/libccmio-2.6.1.tar.gz (check usage conditions)
|
||||
|
||||
[repo gperftools]: https://github.com/gperftools/gperftools
|
||||
[link gperftools]: https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz
|
||||
@ -586,10 +592,12 @@ easier to use `grep` and find the relevant pages and links.
|
||||
|
||||
[page ParaView]: http://www.paraview.org/
|
||||
[download ParaView]: https://www.paraview.org/download/
|
||||
[link ParaView54]: http://www.paraview.org/files/v5.4/ParaView-v5.4.1.tar.gz
|
||||
[link ParaView55]: http://www.paraview.org/files/v5.5/ParaView-v5.5.2.tar.gz
|
||||
[link ParaView56]: http://www.paraview.org/files/v5.6/ParaView-v5.6.3.tar.gz
|
||||
[link ParaView]: http://www.paraview.org/files/v5.7/ParaView-v5.7.0.tar.gz
|
||||
[link ParaView56]: http://www.paraview.org/files/v5.6/ParaView-v5.6.3.tar.xz
|
||||
[link ParaView57]: http://www.paraview.org/files/v5.7/ParaView-v5.7.0.tar.xz
|
||||
[link ParaView58]: http://www.paraview.org/files/v5.8/ParaView-v5.8.1.tar.xz
|
||||
[link ParaView59]: http://www.paraview.org/files/v5.9/ParaView-v5.9.1.tar.xz
|
||||
[link ParaView510]: http://www.paraview.org/files/v5.10/ParaView-v5.10.1.tar.xz
|
||||
[link ParaView]: http://www.paraview.org/files/v5.11/ParaView-v5.11.0.tar.xz
|
||||
|
||||
[page mesa]: http://mesa3d.org/
|
||||
[link mesa]: ftp://ftp.freedesktop.org/pub/mesa/mesa-17.1.1.tar.xz
|
||||
@ -603,4 +611,4 @@ easier to use `grep` and find the relevant pages and links.
|
||||
|
||||
---
|
||||
|
||||
Copyright 2016-2020 OpenCFD Ltd
|
||||
Copyright 2016-2022 OpenCFD Ltd
|
||||
|
||||
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>
|
||||
|
||||
---
|
||||
@ -11,7 +11,7 @@ any third-party compilation.
|
||||
|
||||
For general functionality, the paraview version distributed with
|
||||
the operating system or a [binary package][download ParaView]
|
||||
is likely adequate for your needs.
|
||||
is likely [fully adequate for your needs][FAQ ParaView].
|
||||
|
||||
|
||||
***Please help us with keeping the information here up-to-date and accurate.***
|
||||
@ -28,11 +28,11 @@ sudo apt install paraview-dev
|
||||
```
|
||||
Depending on your setup, the following subset may also be enough:
|
||||
```
|
||||
sudo apt install cmake qt5base-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev libqt5x11extras5-dev libxt-dev
|
||||
sudo apt install cmake qtbase5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev libqt5x11extras5-dev libxt-dev
|
||||
```
|
||||
|
||||
|
||||
### openSUSE
|
||||
### openSUSE (eg, Leap-15.3)
|
||||
|
||||
The full dependency list for building ParaView can be found from the
|
||||
corresponding [rpm spec][suse spec] file.
|
||||
@ -46,8 +46,21 @@ sudo zypper install paraview-devel
|
||||
Depending on your setup, the following subset may also be enough:
|
||||
```
|
||||
sudo zypper install Mesa-libEGL-devel
|
||||
sudo zypper install libqt5-qtbase-devel libqt5-qtsvg-devel libqt5-qttools-devel libqt5-qtx11extras
|
||||
sudo zypper install libXt-devel
|
||||
sudo zypper install libqt5-qtbase-devel libqt5-qtsvg-devel libqt5-qttools-devel libqt5-qtx11extras-devel
|
||||
sudo zypper install libxcb-devel libXt-devel
|
||||
```
|
||||
|
||||
For building paraview with ffmpeg support (components: avformat
|
||||
avcodec avutil swscale), the packman repository may be required, with a
|
||||
variety of additional packages:
|
||||
```
|
||||
sudo zypper install ffmpeg-3
|
||||
sudo zypper install ffmpeg-3-libavcodec-devel
|
||||
sudo zypper install ffmpeg-3-libavformat-devel
|
||||
sudo zypper install ffmpeg-3-libavresample-devel
|
||||
sudo zypper install ffmpeg-3-libavutil-devel
|
||||
sudo zypper install ffmpeg-3-libswresample-devel
|
||||
sudo zypper install ffmpeg-3-libswscale-devel
|
||||
```
|
||||
|
||||
|
||||
@ -56,6 +69,7 @@ sudo zypper install libXt-devel
|
||||
[download ParaView]: https://www.paraview.org/download/
|
||||
[debian control]: https://salsa.debian.org/science-team/paraview/-/blob/master/debian/control
|
||||
[suse spec]: https://build.opensuse.org/package/view_file/science/paraview/paraview.spec
|
||||
[FAQ ParaView]: https://discourse.paraview.org/t/i-want-to-visualize-my-openfoam-simulation-results-with-paraview-but-im-confused-which-version-should-i-use
|
||||
|
||||
|
||||
<!-- OpenFOAM -->
|
||||
@ -69,4 +83,4 @@ sudo zypper install libXt-devel
|
||||
[link third-require]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/Requirements.md
|
||||
|
||||
---
|
||||
Copyright 2019-2020 OpenCFD Ltd
|
||||
Copyright 2019-2022 OpenCFD Ltd
|
||||
|
||||
185
SOURCES.md
Normal file
185
SOURCES.md
Normal file
@ -0,0 +1,185 @@
|
||||
Third-party software (shipped) versions according to OpenFOAM version
|
||||
|
||||
# OpenFOAM-2212
|
||||
|
||||
- ADIOS2-2.8.3 *new*
|
||||
- CGAL-4.14.3
|
||||
- ParaView-v5.11.0 *new*
|
||||
- boost_1_74_0
|
||||
- fftw-3.3.10
|
||||
- openmpi-4.1.2
|
||||
- scotch_6.1.0
|
||||
- kahip-3.14
|
||||
|
||||
|
||||
# OpenFOAM-2206
|
||||
|
||||
- ADIOS2-2.7.1
|
||||
- CGAL-4.14.3
|
||||
- ParaView-v5.10.1 *update*
|
||||
- boost_1_74_0
|
||||
- fftw-3.3.10
|
||||
- openmpi-4.1.2
|
||||
- scotch_6.1.0
|
||||
- kahip-3.14
|
||||
|
||||
|
||||
# OpenFOAM-2112
|
||||
|
||||
- ADIOS2-2.7.1 *new*
|
||||
- CGAL-4.14.3 *new*
|
||||
- ParaView-v5.10.0 *new*
|
||||
- boost_1_74_0 *new*
|
||||
- fftw-3.3.10 *update*
|
||||
- openmpi-4.1.2 *new*
|
||||
- scotch_6.1.0
|
||||
- kahip-3.14 *new*
|
||||
|
||||
|
||||
# OpenFOAM-2106
|
||||
|
||||
- ADIOS2-2.6.0
|
||||
- CGAL-4.12.2
|
||||
- ParaView-v5.9.1 *update*
|
||||
- boost_1_66_0
|
||||
- fftw-3.3.7
|
||||
- openmpi-4.0.3
|
||||
- scotch_6.1.0 *update*
|
||||
- kahip-2.12
|
||||
|
||||
|
||||
# OpenFOAM-2012
|
||||
|
||||
- ADIOS2-2.6.0 *update*
|
||||
- CGAL-4.12.2
|
||||
- ParaView-v5.6.3
|
||||
- boost_1_66_0
|
||||
- fftw-3.3.7
|
||||
- openmpi-4.0.3
|
||||
- scotch_6.0.9
|
||||
- kahip-2.12
|
||||
|
||||
|
||||
# OpenFOAM-2006
|
||||
|
||||
- ADIOS2-2.4.0
|
||||
- CGAL-4.12.2 *update*
|
||||
- ParaView-v5.6.3
|
||||
- boost_1_66_0 *update*
|
||||
- fftw-3.3.7
|
||||
- openmpi-4.0.3 *update*
|
||||
- scotch_6.0.9
|
||||
- kahip-2.12
|
||||
|
||||
|
||||
# OpenFOAM-1912
|
||||
|
||||
- ADIOS2-2.4.0 *new*
|
||||
- CGAL-4.9.1
|
||||
- ParaView-v5.6.3 *minor*
|
||||
- boost_1_64_0
|
||||
- fftw-3.3.7
|
||||
- openmpi-1.10.7 *minor*
|
||||
- scotch_6.0.9 *minor*
|
||||
- kahip-2.12 *update*
|
||||
|
||||
|
||||
# OpenFOAM-1906
|
||||
|
||||
- CGAL-4.9.1
|
||||
- ParaView-v5.6.0
|
||||
- boost_1_64_0
|
||||
- fftw-3.3.7
|
||||
- openmpi-1.10.7 *minor*
|
||||
- scotch_6.0.6
|
||||
- kahip-2.00d
|
||||
|
||||
|
||||
# OpenFOAM-1812
|
||||
|
||||
- CGAL-4.9.1
|
||||
- ParaView-v5.6.0 *update*
|
||||
- boost_1_64_0
|
||||
- fftw-3.3.7
|
||||
- openmpi-1.10.4
|
||||
- scotch_6.0.6 *minor*
|
||||
- kahip-2.00d
|
||||
|
||||
|
||||
# OpenFOAM-1806
|
||||
|
||||
- CGAL-4.9.1
|
||||
- ParaView-v5.5.2 *update*
|
||||
- boost_1_64_0
|
||||
- fftw-3.3.7
|
||||
- openmpi-1.10.4
|
||||
- scotch_6.0.3
|
||||
- kahip-2.00d
|
||||
|
||||
|
||||
# OpenFOAM-1712
|
||||
|
||||
- CGAL-4.9.1
|
||||
- ParaView-v5.4.1 *minor*
|
||||
- boost_1_64_0
|
||||
- fftw-3.3.7 *minor*
|
||||
- openmpi-1.10.4
|
||||
- scotch_6.0.3
|
||||
- kahip-2.00d *new*
|
||||
|
||||
|
||||
# OpenFOAM-1706
|
||||
|
||||
- CGAL-4.9.1 *minor*
|
||||
- ParaView-v5.4.0 *update*
|
||||
- boost_1_64_0 *update*
|
||||
- fftw-3.3.6-pl1 *minor*
|
||||
- openmpi-1.10.4
|
||||
- scotch_6.0.3
|
||||
|
||||
|
||||
# OpenFOAM-1612
|
||||
|
||||
- CGAL-4.9 *update*
|
||||
- ParaView-v5.0.1 *update*
|
||||
- boost_1_62_0 *update*
|
||||
- fftw-3.3.5 *minor*
|
||||
- openmpi-1.10.4 *minor*
|
||||
- scotch_6.0.3
|
||||
|
||||
|
||||
# OpenFOAM-1606
|
||||
|
||||
- CGAL-4.8 *update*
|
||||
- ParaView-v5.0.1 *update*
|
||||
- boost_1_61_0 *new*
|
||||
- fftw-3.3.4 *new*
|
||||
- openmpi-1.10.2 *minor*
|
||||
- scotch_6.0.3
|
||||
|
||||
|
||||
# OpenFOAM-1601 (3.0+)
|
||||
|
||||
- CGAL-4.7 *update*
|
||||
- ParaView-v4.4.0 *update*
|
||||
- openmpi-1.10.0 *update*
|
||||
- scotch_6.0.3
|
||||
|
||||
|
||||
# OpenFOAM-2.4
|
||||
|
||||
- CGAL-4.6 *update*
|
||||
- ParaView-v4.1.0
|
||||
- openmpi-1.8.5 *update*
|
||||
- scotch_6.0.3 *update*
|
||||
|
||||
|
||||
# OpenFOAM-2.3
|
||||
|
||||
- CGAL-4.3
|
||||
- ParaView-v4.1.0
|
||||
- openmpi-1.6.5
|
||||
- scotch_6.0.0
|
||||
|
||||
|
||||
---
|
||||
130
SOURCES.txt
130
SOURCES.txt
@ -1,130 +0,0 @@
|
||||
Third-party software versions for recent OpenFOAM versions
|
||||
|
||||
OpenFOAM-2006
|
||||
---------------
|
||||
|
||||
ADIOS-2.4.0
|
||||
CGAL-4.12.2 *update*
|
||||
ParaView-5.6.3
|
||||
boost_1_66_0 *update*
|
||||
fftw-3.3.7
|
||||
openmpi-4.0.3 *update*
|
||||
scotch_6.0.9
|
||||
kahip-2.12
|
||||
|
||||
|
||||
OpenFOAM-1912
|
||||
---------------
|
||||
|
||||
ADIOS-2.4.0 *new*
|
||||
CGAL-4.9.1
|
||||
ParaView-5.6.3 *minor*
|
||||
boost_1_64_0
|
||||
fftw-3.3.7
|
||||
openmpi-1.10.7 *minor*
|
||||
scotch_6.0.9 *minor*
|
||||
kahip-2.12 *update*
|
||||
|
||||
|
||||
OpenFOAM-1906
|
||||
---------------
|
||||
|
||||
CGAL-4.9.1
|
||||
ParaView-5.6.0
|
||||
boost_1_64_0
|
||||
fftw-3.3.7
|
||||
openmpi-1.10.7 *minor*
|
||||
scotch_6.0.6
|
||||
kahip-2.00d
|
||||
|
||||
|
||||
OpenFOAM-1812
|
||||
---------------
|
||||
|
||||
CGAL-4.9.1
|
||||
ParaView-5.6.0 *update*
|
||||
boost_1_64_0
|
||||
fftw-3.3.7
|
||||
openmpi-1.10.4
|
||||
scotch_6.0.6 *minor*
|
||||
kahip-2.00d
|
||||
|
||||
|
||||
OpenFOAM-1806
|
||||
---------------
|
||||
CGAL-4.9.1
|
||||
ParaView-5.5.2 *update*
|
||||
boost_1_64_0
|
||||
fftw-3.3.7
|
||||
openmpi-1.10.4
|
||||
scotch_6.0.3
|
||||
kahip-2.00d
|
||||
|
||||
|
||||
OpenFOAM-1712
|
||||
---------------
|
||||
CGAL-4.9.1
|
||||
ParaView-5.4.1 *minor*
|
||||
boost_1_64_0
|
||||
fftw-3.3.7 *minor*
|
||||
openmpi-1.10.4
|
||||
scotch_6.0.3
|
||||
kahip-2.00d *new*
|
||||
|
||||
|
||||
OpenFOAM-1706
|
||||
---------------
|
||||
CGAL-4.9.1 *minor*
|
||||
ParaView-5.4.0 *update*
|
||||
boost_1_64_0 *update*
|
||||
fftw-3.3.6-pl1 *minor*
|
||||
openmpi-1.10.4
|
||||
scotch_6.0.3
|
||||
|
||||
|
||||
OpenFOAM-1612
|
||||
---------------
|
||||
CGAL-4.9 *update*
|
||||
ParaView-5.0.1 *update*
|
||||
boost_1_62_0 *update*
|
||||
fftw-3.3.5 *minor*
|
||||
openmpi-1.10.4 *minor*
|
||||
scotch_6.0.3
|
||||
|
||||
|
||||
OpenFOAM-1606
|
||||
---------------
|
||||
CGAL-4.8 *update*
|
||||
ParaView-5.0.1 *update*
|
||||
boost_1_61_0 *new*
|
||||
fftw-3.3.4 *new*
|
||||
openmpi-1.10.2 *minor*
|
||||
scotch_6.0.3
|
||||
|
||||
|
||||
OpenFOAM-1601 (3.0+)
|
||||
---------------
|
||||
CGAL-4.7 *update*
|
||||
ParaView-4.4.0 *update*
|
||||
openmpi-1.10.0 *update*
|
||||
scotch_6.0.3
|
||||
|
||||
|
||||
OpenFOAM-2.4
|
||||
---------------
|
||||
CGAL-4.6 *update*
|
||||
ParaView-4.1.0
|
||||
openmpi-1.8.5 *update*
|
||||
scotch_6.0.3 *update*
|
||||
|
||||
|
||||
---------------
|
||||
OpenFOAM-2.3
|
||||
---------------
|
||||
CGAL-4.3
|
||||
ParaView-4.1.0
|
||||
openmpi-1.6.5
|
||||
scotch_6.0.0
|
||||
|
||||
|
||||
---------------
|
||||
86
etc/list-available
Executable file
86
etc/list-available
Executable file
@ -0,0 +1,86 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
#
|
||||
# Script
|
||||
# etc/list-available
|
||||
#
|
||||
# Description
|
||||
# List available unpacked source versions
|
||||
#
|
||||
# checks:
|
||||
# - ThirdParty/PACKAGE
|
||||
# - ThirdParty/sources/PACKAGE
|
||||
# - ThirdParty/sources/canonical/PACKAGE
|
||||
#
|
||||
# Example usage
|
||||
# etc/list-available paraview
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} [OPTION] [package1 .. [packageN]]
|
||||
Options:
|
||||
-dirs List with relative source directories
|
||||
-names List names only [default]
|
||||
-full List with absolute source directories
|
||||
-help Display usage help
|
||||
|
||||
List available (unpacked) source packages.
|
||||
|
||||
USAGE
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
optOutput="-names"
|
||||
|
||||
# Process options/arguments
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help*) printHelp;;
|
||||
|
||||
# Resolve with (relative) dirs
|
||||
-dir*)
|
||||
optOutput="-dirs"
|
||||
;;
|
||||
|
||||
# Resolve packages names only (without directory)
|
||||
-name*)
|
||||
optOutput="-names"
|
||||
;;
|
||||
|
||||
# Resolve with full (absolute) dirs
|
||||
-full | -long)
|
||||
optOutput="-long"
|
||||
;;
|
||||
|
||||
-*) echo "Ignore unknown option" 1>&2 ;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "$#" -gt 0 ]
|
||||
then
|
||||
listPackageVersions $optOutput "$@"
|
||||
else
|
||||
die "Did not specify any package(s)"
|
||||
fi
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
62
etc/list-download
Executable file
62
etc/list-download
Executable file
@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
#
|
||||
# Script
|
||||
# etc/list-download
|
||||
#
|
||||
# Description
|
||||
# List known download hints. Required BUILD.md
|
||||
#
|
||||
# Example usage
|
||||
# etc/list-download paraview
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} [OPTION] [package1 .. [packageN]]
|
||||
Options:
|
||||
-help Display usage help
|
||||
|
||||
List known download hints.
|
||||
|
||||
USAGE
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Process options/arguments
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help*) printHelp;;
|
||||
|
||||
-*) echo "Ignore unknown option" 1>&2 ;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "$#" -gt 0 ]
|
||||
then
|
||||
showDownloadHint "$@"
|
||||
else
|
||||
die "Did not specify any package(s)"
|
||||
fi
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
167
etc/list-sources
Executable file
167
etc/list-sources
Executable file
@ -0,0 +1,167 @@
|
||||
#!/bin/sh
|
||||
#------------------------------------------------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
#
|
||||
# Script
|
||||
# etc/list-sources
|
||||
#
|
||||
# Description
|
||||
# Extract package names from SOURCES.md and resolve their respective
|
||||
# (unpacked) directory paths.
|
||||
#
|
||||
# The input source file is assumed to be Markdown formatted with
|
||||
# sections for each OpenFOAM version, followed by a '-' bulleted
|
||||
# list of the software package/versions.
|
||||
#
|
||||
# Example,
|
||||
# # OpenFOAM-2106
|
||||
#
|
||||
# - ADIOS2-2.6.0
|
||||
# - CGAL-4.12.2
|
||||
# ...
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} [OPTION]
|
||||
Options:
|
||||
-dirs Resolve source directories (relative dir names)
|
||||
-full Resolve source directories (absolute dir names)
|
||||
-file=FILE Alternative file to process (default: SOURCES.md)
|
||||
-vDIGITS | -DIGITS
|
||||
OpenFOAM version (eg, -v2106, -2106) to process.
|
||||
The default is to process the first (latest) section.
|
||||
-help
|
||||
|
||||
Extract package names from SOURCES.md and optionally
|
||||
resolve their respective (unpacked) directory paths.
|
||||
|
||||
USAGE
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
inputFile="SOURCES.md"
|
||||
unset version optResolve
|
||||
|
||||
# Process options/arguments
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help*) printHelp;;
|
||||
|
||||
# Resolve (relative) directories
|
||||
-dir*)
|
||||
: "${optResolve:=-relative}"
|
||||
;;
|
||||
|
||||
# Resolve (full) directories
|
||||
-full)
|
||||
optResolve="-absolute"
|
||||
;;
|
||||
-file=*)
|
||||
inputFile="${1#*=}"
|
||||
;;
|
||||
|
||||
-[0-9]*) version="${1#*-}" ;;
|
||||
-v[0-9]*) version="${1#*-v}" ;;
|
||||
|
||||
-*) echo "Ignore unknown option" 1>&2 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Resolve file (if necessary)
|
||||
file="$inputFile"
|
||||
|
||||
if [ ! -f "$file" ]
|
||||
then
|
||||
file="$WM_THIRD_PARTY_DIR/$inputFile"
|
||||
[ -f "$file" ] || die "No such file: $inputFile"
|
||||
fi
|
||||
|
||||
## echo "processing: $file" 1>&2
|
||||
|
||||
# Parse this type of input:
|
||||
#
|
||||
# # OpenFOAM-2106
|
||||
#
|
||||
# - ADIOS2-2.6.0
|
||||
# - CGAL-4.12.2
|
||||
# - ParaView-v5.9.1 *update*
|
||||
# - boost_1_66_0
|
||||
# - fftw-3.3.7
|
||||
# - openmpi-4.0.3
|
||||
# - scotch_6.1.0 *update*
|
||||
# - kahip-2.12
|
||||
|
||||
# By default use the top section, unless '$version' is specified
|
||||
|
||||
unset active section
|
||||
while read -r line
|
||||
do
|
||||
case "$line" in
|
||||
('#'*)
|
||||
# A markdown section
|
||||
if [ -n "$active" ]
|
||||
then
|
||||
break # Done
|
||||
elif [ -z "$version" ]
|
||||
then
|
||||
active=true # No version: take the first section
|
||||
else
|
||||
# Match version (eg, '2106') vs these types of input:
|
||||
# - '## OpenFOAM-2106'
|
||||
# - '## OpenFOAM-v2106 update1'
|
||||
|
||||
item="$(echo "$line" | sed 's/^#*.*-v*//')"
|
||||
case "$item" in
|
||||
("$version"*) active=true;;
|
||||
esac
|
||||
fi
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
# Strip leading space
|
||||
line="$(echo "$line" | sed 's/^ *//')"
|
||||
|
||||
case "$line" in
|
||||
([-*]' '*)
|
||||
# A markdown list item. Extract first after the bullet
|
||||
item="$(echo "$line" | sed 's/^[-*] *//;s/ .*$//')"
|
||||
if [ "$active" != true ] || [ -z "$item" ]
|
||||
then
|
||||
continue
|
||||
elif [ -n "$optResolve" ]
|
||||
then
|
||||
dir="$(findSourceDir "$optResolve" "$item" 2>/dev/null)"
|
||||
if [ -n "$dir" ]
|
||||
then
|
||||
echo "$dir"
|
||||
else
|
||||
echo "missing: $item" 1>&2
|
||||
fi
|
||||
else
|
||||
echo "$item" # Report item without resolving
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done < "$file"
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -1,4 +1,6 @@
|
||||
/* NOTE: make any changes to this file in etc/wmakeFiles/ */
|
||||
/*
|
||||
* NOTE: make any changes to this file in ThirdParty etc/wmakeFiles/
|
||||
*/
|
||||
|
||||
interface/kaHIP_interface.cpp
|
||||
|
||||
@ -66,5 +68,4 @@ algorithms/cycle_search.cpp
|
||||
partition/uncoarsening/refinement/cycle_improvements/cycle_refinement.cpp
|
||||
partition/uncoarsening/refinement/tabu_search/tabu_search.cpp
|
||||
|
||||
|
||||
LIB = $(FOAM_EXT_LIBBIN)/libkahip
|
||||
LIB = $(KAHIP_LIB_DIR)/libkahip
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* NOTE: make any changes to this file in etc/wmakeFiles/
|
||||
* NOTE: make any changes to this file in ThirdParty etc/wmakeFiles/
|
||||
* Must use -DNDEBUG to disable kahip debug mode.
|
||||
* Using -DMODE_NODESEP is not strictly required for building the library.
|
||||
*/
|
||||
@ -9,10 +9,13 @@ EXE_INC = \
|
||||
${COMP_OPENMP} \
|
||||
-DNDEBUG -DMODE_NODESEP \
|
||||
-I. \
|
||||
-I$(KAHIP_LIB_SRC) \
|
||||
-I$(KAHIP_LIB_SRC)/partition \
|
||||
-I$(KAHIP_LIB_SRC)/partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement
|
||||
-I./partition \
|
||||
-I./partition/uncoarsening/refinement/quotient_graph_refinement/flow_refinement
|
||||
|
||||
LIB_LIBS =
|
||||
|
||||
PROJECT_LIBS =
|
||||
|
||||
/* failsafe location */
|
||||
ifeq (,$(strip $(KAHIP_LIB_DIR)))
|
||||
KAHIP_LIB_DIR = $(FOAM_EXT_LIBBIN)
|
||||
endif
|
||||
|
||||
@ -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_internals.c
|
||||
@ -19,4 +21,4 @@ libccmio/ccmioversion.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.
|
||||
LIB_LIBS =
|
||||
PROJECT_LIBS =
|
||||
|
||||
/* failsafe location */
|
||||
ifeq (,$(strip $(CCMIO_LIB_DIR)))
|
||||
CCMIO_LIB_DIR = $(FOAM_EXT_LIBBIN)
|
||||
endif
|
||||
|
||||
@ -29,19 +29,28 @@ CCS ?= $(CC)
|
||||
CCP ?= mpicc
|
||||
CCD = $(CCP)
|
||||
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
|
||||
-DCOMMON_FILE_COMPRESS_GZ \
|
||||
-UCOMMON_FILE_COMPRESS \
|
||||
-DCOMMON_RANDOM_FIXED_SEED \
|
||||
-DSCOTCH_DETERMINISTIC \
|
||||
-DSCOTCH_RENAME \
|
||||
-DIDXSIZE64 \
|
||||
-Drestrict=__restrict
|
||||
|
||||
# 32-bit vs. 64-bit labels
|
||||
# Use 32/64-bit integers
|
||||
# ---------------
|
||||
# Unfortunately -DINT32 seems to fail when openmpi is build without
|
||||
# Fortran! The MPI_INT32_T is interpreted as MPI_INTEGER4 which does
|
||||
# not exist
|
||||
# ---------------
|
||||
# ifeq ($(WM_LABEL_SIZE),32)
|
||||
# CFLAGS += -DINTSIZE32
|
||||
# endif
|
||||
ifeq ($(WM_LABEL_SIZE),64)
|
||||
CFLAGS += -DINTSIZE64
|
||||
endif
|
||||
|
||||
CLIBFLAGS =
|
||||
LDFLAGS = $(WM_LDFLAGS) -lz -lm
|
||||
LDFLAGS = $(WM_LDFLAGS) -lm
|
||||
|
||||
MAKE = make
|
||||
CP = cp
|
||||
@ -50,7 +59,10 @@ LN = ln
|
||||
MKDIR = mkdir
|
||||
MV = mv
|
||||
RANLIB = echo
|
||||
LEX = flex -Pscotchyy -olex.yy.c
|
||||
YACC = bison -pscotchyy -y -b y
|
||||
|
||||
FLEX = flex "-Pscotchyy$(SCOTCH_NAME_SUFFIX)" -olex.yy.c
|
||||
BISON = bison "-pscotchyy$(SCOTCH_NAME_SUFFIX)" -y -b y
|
||||
LEX = $(FLEX)
|
||||
YACC = $(BISON)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -26,7 +26,8 @@ OBJ = .o
|
||||
# Separate the cross-compilation flags from regular CFLAGS to ensure that
|
||||
# system gcc does not use them for the scotch build toolchain
|
||||
|
||||
CFLAGS_CROSS = -DCOMMON_WINDOWS -DCOMMON_STUB_FORK
|
||||
# cross-compile broken for scotch-v7
|
||||
CFLAGS_CROSS = -DCOMMON_STUB_FORK -DCOMMON_WINDOWS
|
||||
|
||||
# Flags for including windows MPI information (MSMPI)
|
||||
CFLAGS_WINMPI = -I$(MPI_ARCH_PATH)/include \
|
||||
@ -40,15 +41,23 @@ CCS = x86_64-w64-mingw32-gcc $(CFLAGS_WINMPI)
|
||||
CCP = x86_64-w64-mingw32-gcc $(CFLAGS_WINMPI)
|
||||
CCD = gcc $(CFLAGS_WINMPI)
|
||||
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
|
||||
-DCOMMON_PTHREAD_FILE \
|
||||
-DCOMMON_PTHREAD_FILE -DSCOTCH_PTHREAD \
|
||||
-UCOMMON_FILE_COMPRESS \
|
||||
-DCOMMON_RANDOM_FIXED_SEED \
|
||||
-DSCOTCH_DETERMINISTIC \
|
||||
-DSCOTCH_RENAME \
|
||||
-DSCOTCH_PTHREAD \
|
||||
-DIDXSIZE64 \
|
||||
-Drestrict=__restrict
|
||||
|
||||
# 32-bit vs. 64-bit labels
|
||||
# Use 32/64-bit integers
|
||||
# ---------------
|
||||
# Unfortunately -DINT32 seems to fail when openmpi is build without
|
||||
# Fortran! The MPI_INT32_T is interpreted as MPI_INTEGER4 which does
|
||||
# not exist
|
||||
# ---------------
|
||||
# ifeq ($(WM_LABEL_SIZE),32)
|
||||
# CFLAGS += -DINTSIZE32
|
||||
# endif
|
||||
ifeq ($(WM_LABEL_SIZE),64)
|
||||
CFLAGS += -DINTSIZE64
|
||||
endif
|
||||
@ -67,7 +76,10 @@ LN = ln
|
||||
MKDIR = mkdir
|
||||
MV = mv
|
||||
RANLIB = echo
|
||||
LEX = flex -Pscotchyy -olex.yy.c
|
||||
YACC = bison -pscotchyy -y -b y
|
||||
|
||||
FLEX = flex "-Pscotchyy$(SCOTCH_NAME_SUFFIX)" -olex.yy.c
|
||||
BISON = bison "-pscotchyy$(SCOTCH_NAME_SUFFIX)" -y -b y
|
||||
LEX = $(FLEX)
|
||||
YACC = $(BISON)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -29,19 +29,28 @@ CCS ?= $(CC)
|
||||
CCP ?= mpicc
|
||||
CCD = $(CCP)
|
||||
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
|
||||
-DCOMMON_FILE_COMPRESS_GZ \
|
||||
-UCOMMON_FILE_COMPRESS \
|
||||
-DCOMMON_RANDOM_FIXED_SEED \
|
||||
-DSCOTCH_DETERMINISTIC \
|
||||
-DSCOTCH_RENAME \
|
||||
-DIDXSIZE64 \
|
||||
-Drestrict=__restrict
|
||||
|
||||
# 32-bit vs. 64-bit labels
|
||||
# Use 32/64-bit integers
|
||||
# ---------------
|
||||
# Unfortunately -DINT32 seems to fail when openmpi is build without
|
||||
# Fortran! The MPI_INT32_T is interpreted as MPI_INTEGER4 which does
|
||||
# not exist
|
||||
# ---------------
|
||||
# ifeq ($(WM_LABEL_SIZE),32)
|
||||
# CFLAGS += -DINTSIZE32
|
||||
# endif
|
||||
ifeq ($(WM_LABEL_SIZE),64)
|
||||
CFLAGS += -DINTSIZE64
|
||||
endif
|
||||
|
||||
CLIBFLAGS = -shared
|
||||
LDFLAGS = -Xlinker --no-as-needed $(WM_LDFLAGS) -lz -lm -lrt
|
||||
LDFLAGS = -Xlinker --no-as-needed $(WM_LDFLAGS) -lm -lrt
|
||||
|
||||
MAKE = make
|
||||
CP = cp
|
||||
@ -50,7 +59,10 @@ LN = ln
|
||||
MKDIR = mkdir
|
||||
MV = mv
|
||||
RANLIB = echo
|
||||
LEX = flex -Pscotchyy -olex.yy.c
|
||||
YACC = bison -pscotchyy -y -b y
|
||||
|
||||
FLEX = flex "-Pscotchyy$(SCOTCH_NAME_SUFFIX)" -olex.yy.c
|
||||
BISON = bison "-pscotchyy$(SCOTCH_NAME_SUFFIX)" -y -b y
|
||||
LEX = $(FLEX)
|
||||
YACC = $(BISON)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
48
etc/patches/scotch-v7.0.1
Normal file
48
etc/patches/scotch-v7.0.1
Normal file
@ -0,0 +1,48 @@
|
||||
--- scotch_6.0.6/src/libscotch/Makefile.orig 2019-04-29 14:59:53.957103493 +0200
|
||||
+++ scotch_6.0.6/src/libscotch/Makefile 2019-04-29 18:50:42.560080675 +0200
|
||||
@@ -51,6 +51,12 @@
|
||||
|
||||
.PHONY : ptscotch scotch ptinstall install clean realclean
|
||||
|
||||
+ifeq ($(WM_OSTYPE),MSwindows)
|
||||
+
|
||||
+libscotch : libscotch$(LIB) scotch.h
|
||||
+
|
||||
+endif
|
||||
+
|
||||
scotch :
|
||||
$(MAKE) CC="$(CCS)" CCD="$(CCS)" \
|
||||
scotch.h \
|
||||
@@ -438,6 +444,11 @@
|
||||
wgraph_part_zr$(OBJ) \
|
||||
wgraph_store$(OBJ)
|
||||
|
||||
+ifeq ($(WM_OSTYPE),MSwindows)
|
||||
+## Add into libscotch instead of having a separate library
|
||||
+LIBSCOTCHDEPS += library_error_exit$(OBJ)
|
||||
+endif
|
||||
+
|
||||
##
|
||||
## Todo list.
|
||||
##
|
||||
--- scotch_6.0.6/src/Makefile.orig 2018-07-14 17:24:49.000000000 +0200
|
||||
+++ scotch_6.0.6/src/Makefile 2019-04-29 18:39:16.365132864 +0200
|
||||
@@ -89,9 +89,18 @@
|
||||
$(mandir)/man1 : $(mandir)
|
||||
-$(MKDIR) $(mandir)/man1
|
||||
|
||||
+ifeq ($(WM_OSTYPE),MSwindows)
|
||||
+
|
||||
+libscotch : required
|
||||
+ (cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) libscotch && $(MAKE) install)
|
||||
+
|
||||
+else
|
||||
+
|
||||
libscotch : required
|
||||
(cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
|
||||
|
||||
+endif
|
||||
+
|
||||
scotch : libscotch
|
||||
(cd scotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
|
||||
(cd libscotchmetis ; $(MAKE) scotch && $(MAKE) install)
|
||||
48
etc/patches/scotch_6.1.0
Normal file
48
etc/patches/scotch_6.1.0
Normal file
@ -0,0 +1,48 @@
|
||||
--- scotch_6.0.6/src/libscotch/Makefile.orig 2019-04-29 14:59:53.957103493 +0200
|
||||
+++ scotch_6.0.6/src/libscotch/Makefile 2019-04-29 18:50:42.560080675 +0200
|
||||
@@ -51,6 +51,12 @@
|
||||
|
||||
.PHONY : ptscotch scotch ptinstall install clean realclean
|
||||
|
||||
+ifeq ($(WM_OSTYPE),MSwindows)
|
||||
+
|
||||
+libscotch : libscotch$(LIB) scotch.h
|
||||
+
|
||||
+endif
|
||||
+
|
||||
scotch :
|
||||
$(MAKE) CC="$(CCS)" CCD="$(CCS)" \
|
||||
scotch.h \
|
||||
@@ -438,6 +444,11 @@
|
||||
wgraph_part_zr$(OBJ) \
|
||||
wgraph_store$(OBJ)
|
||||
|
||||
+ifeq ($(WM_OSTYPE),MSwindows)
|
||||
+## Add into libscotch instead of having a separate library
|
||||
+LIBSCOTCHDEPS += library_error_exit$(OBJ)
|
||||
+endif
|
||||
+
|
||||
##
|
||||
## Todo list.
|
||||
##
|
||||
--- scotch_6.0.6/src/Makefile.orig 2018-07-14 17:24:49.000000000 +0200
|
||||
+++ scotch_6.0.6/src/Makefile 2019-04-29 18:39:16.365132864 +0200
|
||||
@@ -89,9 +89,18 @@
|
||||
$(mandir)/man1 : $(mandir)
|
||||
-$(MKDIR) $(mandir)/man1
|
||||
|
||||
+ifeq ($(WM_OSTYPE),MSwindows)
|
||||
+
|
||||
+libscotch : required
|
||||
+ (cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) libscotch && $(MAKE) install)
|
||||
+
|
||||
+else
|
||||
+
|
||||
libscotch : required
|
||||
(cd libscotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
|
||||
|
||||
+endif
|
||||
+
|
||||
scotch : libscotch
|
||||
(cd scotch ; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) PATCHLEVEL=$(PATCHLEVEL) scotch && $(MAKE) install)
|
||||
(cd libscotchmetis ; $(MAKE) scotch && $(MAKE) install)
|
||||
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -40,23 +40,21 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [directory1 [... directoryN]]
|
||||
Usage: ${0##*/} [OPTION] [dir1 [... dirN]]
|
||||
options:
|
||||
-help
|
||||
|
||||
Adjust pkgconfig files after relocating third-party files.
|
||||
Locates pkgconfig files under the lib/ or lib64/ directories and adjusts them
|
||||
to use '${prefix}' instead of absolute directory paths where possible.
|
||||
to use '\${prefix}' instead of absolute directory paths where possible.
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -65,7 +63,8 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help*) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-*) echo "Ignore unknown option" 1>&2 ;;
|
||||
|
||||
*)
|
||||
pkgconfigAdjust "$1"
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -38,14 +38,12 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [directory1 [... directoryN]]
|
||||
Usage: ${0##*/} [OPTION] [dir1 [... dirN]]
|
||||
options:
|
||||
-help
|
||||
|
||||
@ -53,7 +51,7 @@ Set the 'prefix=' entry for pkgconfig files.
|
||||
The pkgconfig files are located under lib/pkgconfig or lib64/pkgconfig.
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -62,7 +60,7 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help*) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
|
||||
*)
|
||||
pkgconfigNewPrefix "$1"
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -27,15 +27,13 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
. etc/tools/QtFunctions
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/QtFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [qt-VERSION]
|
||||
Usage: ${0##*/} [OPTION] [qt-VERSION]
|
||||
options:
|
||||
-force Create qt.conf and edit pkgconfig to use \${prefix}
|
||||
-help
|
||||
@ -46,7 +44,7 @@ with a QT installation.
|
||||
* adjust relocation prefix for $qtVERSION
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
unset optForce
|
||||
@ -56,7 +54,7 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help*) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
|
||||
-f | -force)
|
||||
optForce=true
|
||||
@ -74,16 +72,17 @@ do
|
||||
done
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
QT_ARCH_PATH=$installBASE/qt-$qtVERSION
|
||||
|
||||
[ -n "$qtVERSION" ] || die "No QT version specified"
|
||||
[ -d "$QT_ARCH_PATH" ] || die "No QT installation"
|
||||
PKG_PREFIX="$installBASE/qt-$qtVERSION"
|
||||
|
||||
[ -n "$qtVERSION" ] || die "No QT version specified"
|
||||
[ -d "$PKG_PREFIX" ] || die "No QT installation"
|
||||
|
||||
if [ "${optForce:-false}" = true ]
|
||||
then
|
||||
# Create qt.conf and adjust locations to use '${prefix}' internally
|
||||
finalizeQt
|
||||
finalizeQt "$PKG_PREFIX"
|
||||
fi
|
||||
pkgconfigNewPrefix "$QT_ARCH_PATH"
|
||||
pkgconfigNewPrefix "$PKG_PREFIX"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
@ -6,13 +6,13 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2019 OpenCFD Ltd.
|
||||
# Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
#
|
||||
# Script
|
||||
# testThirdPartyFunctions
|
||||
# etc/testThirdPartyFunctions
|
||||
#
|
||||
# Description
|
||||
# Simple ad hoc tests of etc/tools/ThirdPartyFunctions
|
||||
@ -26,7 +26,7 @@ echo "CXX=$CXX"
|
||||
echo
|
||||
echo ========================================
|
||||
|
||||
. "$WM_THIRD_PARTY_DIR/etc/tools/ThirdPartyFunctions"
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -49,43 +49,62 @@ BUILD_TYPE=Release # The cmake build type
|
||||
# Where things are or should be put
|
||||
# ParaView_VERSION and ParaView_MAJOR should already have been set
|
||||
#
|
||||
# ParaView_SOURCE_DIR : location of the original sources
|
||||
# ParaView_BUILD_DIR : location of the build
|
||||
# ParaView_DIR : location of the installed program
|
||||
# PARAVIEW_SOURCEDIR : location of the original sources
|
||||
# PARAVIEW_BUILDDIR : location of the build
|
||||
# ParaView_DIR : location of the installed program
|
||||
#
|
||||
setParaViewDirs()
|
||||
{
|
||||
set -- "ParaView-$ParaView_VERSION" "ParaView-v$ParaView_VERSION"
|
||||
unset PARAVIEW_SOURCEDIR PARAVIEW_BUILDDIR
|
||||
|
||||
unset ParaView_SOURCE_DIR
|
||||
for i
|
||||
# search
|
||||
# - ThirdParty/PACKAGE
|
||||
# - ThirdParty/sources/PACKAGE
|
||||
# - ThirdParty/sources/paraview/PACKAGE
|
||||
# - ThirdParty/sources/vtk/PACKAGE
|
||||
for package in "$@"
|
||||
do
|
||||
ParaView_SOURCE_DIR="$sourceBASE/$i"
|
||||
[ -d "$ParaView_SOURCE_DIR" ] && break
|
||||
for check in \
|
||||
"$package" \
|
||||
"sources/$package" \
|
||||
"sources/paraview/$package" \
|
||||
"sources/vtk/$package" \
|
||||
;
|
||||
do
|
||||
if [ -d "$sourceBASE/$check" ]
|
||||
then
|
||||
echo "Found sources: $check" 1>&2
|
||||
PARAVIEW_SOURCEDIR="$sourceBASE/$check"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
[ -d "$ParaView_SOURCE_DIR" ] || {
|
||||
[ -d "$PARAVIEW_SOURCEDIR" ] || {
|
||||
echo "Did not locate ParaView version:"
|
||||
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
||||
echo
|
||||
echo "In the directory:"
|
||||
echo " $sourceBASE"
|
||||
echo " \-- sources/paraview"
|
||||
echo " |-- paraview"
|
||||
echo " \\-- vtk"
|
||||
echo
|
||||
echo "abort build"
|
||||
exit 1
|
||||
}
|
||||
|
||||
ParaView_BUILD_DIR=$buildBASE/ParaView-$ParaView_VERSION$BUILD_SUFFIX
|
||||
ParaView_DIR=$installBASE/ParaView-$ParaView_VERSION$BUILD_SUFFIX
|
||||
PARAVIEW_BUILDDIR="$buildBASE/ParaView-$ParaView_VERSION$BUILD_SUFFIX"
|
||||
ParaView_DIR="$installBASE/ParaView-$ParaView_VERSION$BUILD_SUFFIX"
|
||||
export GIT_DIR="$PARAVIEW_SOURCEDIR/.git" # Avoid seeing our own git-repo
|
||||
|
||||
export ParaView_SOURCE_DIR ParaView_BUILD_DIR ParaView_DIR
|
||||
export PARAVIEW_SOURCEDIR PARAVIEW_BUILDDIR ParaView_DIR
|
||||
|
||||
echo
|
||||
echo "ParaView_SOURCE_DIR=$ParaView_SOURCE_DIR"
|
||||
echo "ParaView_BUILD_DIR=$ParaView_BUILD_DIR"
|
||||
echo "ParaView_DIR=$ParaView_DIR"
|
||||
|
||||
export GIT_DIR="$ParaView_SOURCE_DIR/.git" # Mask seeing our own git-repo
|
||||
echo "PARAVIEW_SOURCEDIR=$PARAVIEW_SOURCEDIR"
|
||||
echo "PARAVIEW_BUILDDIR=$PARAVIEW_BUILDDIR"
|
||||
}
|
||||
|
||||
|
||||
@ -114,18 +133,38 @@ setParaViewVersion()
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Set CMake cache variables
|
||||
# Set CMake cache variables.
|
||||
# Automatically adds -D prefix it needed
|
||||
#
|
||||
addCMakeVariable()
|
||||
{
|
||||
local i
|
||||
for i
|
||||
do
|
||||
[ -n "$i" ] && CMAKE_VARIABLES="$CMAKE_VARIABLES -D$i"
|
||||
case "$i" in
|
||||
('') ;; # empty
|
||||
(-*) CMAKE_VARIABLES="${CMAKE_VARIABLES} ${i}" ;;
|
||||
(*) CMAKE_VARIABLES="${CMAKE_VARIABLES} -D${i}" ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# General settings (version-dependent)
|
||||
#
|
||||
addGeneral()
|
||||
{
|
||||
if printf "${ParaView_MAJOR}"'\n%s\n' 5.6 | sort -V -C
|
||||
then
|
||||
# Paraview 5.6 and older
|
||||
addCMakeVariable "BUILD_SHARED_LIBS=ON"
|
||||
else
|
||||
addCMakeVariable "PARAVIEW_BUILD_SHARED_LIBS=ON"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Verbose makefiles
|
||||
#
|
||||
@ -153,6 +192,10 @@ addMpiSupport()
|
||||
then
|
||||
addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
|
||||
fi
|
||||
|
||||
echo "----"
|
||||
echo "MPI information:"
|
||||
echo " home : $MPI_HOME"
|
||||
}
|
||||
|
||||
|
||||
@ -244,7 +287,13 @@ addPythonSupport()
|
||||
exit 1
|
||||
}
|
||||
|
||||
addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON"
|
||||
if printf "${ParaView_MAJOR}"'\n%s\n' 5.7 | sort -V -C
|
||||
then
|
||||
# Paraview 5.7 and older
|
||||
addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON"
|
||||
else
|
||||
addCMakeVariable "PARAVIEW_USE_PYTHON=ON"
|
||||
fi
|
||||
addCMakeVariable "PYTHON_INCLUDE_DIRS=$PYTHON_INCLUDE"
|
||||
addCMakeVariable "PYTHON_LIBRARY=$PYTHON_LIBRARY"
|
||||
|
||||
@ -304,20 +353,27 @@ addQtSupport()
|
||||
QT_VERSION=none
|
||||
: ${withQT:=true} # default is on
|
||||
|
||||
local qmake qtLib
|
||||
local cmakeVarName="PARAVIEW_USE_QT"
|
||||
|
||||
if printf "${ParaView_MAJOR}"'\n%s\n' 5.7 | sort -V -C
|
||||
then
|
||||
# Paraview 5.7 and older
|
||||
cmakeVarName="PARAVIEW_BUILD_QT_GUI"
|
||||
fi
|
||||
|
||||
if [ "$withQT" = false ]
|
||||
then
|
||||
# Explicitly disabled
|
||||
addCMakeVariable "PARAVIEW_BUILD_QT_GUI=OFF"
|
||||
addCMakeVariable "$cmakeVarName=OFF"
|
||||
return
|
||||
fi
|
||||
|
||||
local qmake qtLib
|
||||
|
||||
# Check qmake can be found and handle version differences
|
||||
qmake=$(findQMake)
|
||||
if QT_VERSION=$($qmake -query QT_VERSION 2>/dev/null)
|
||||
then
|
||||
addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON"
|
||||
addCMakeVariable "$cmakeVarName=ON"
|
||||
|
||||
case "$QT_VERSION" in
|
||||
(3.* | 4.[0-4]*)
|
||||
@ -374,7 +430,7 @@ ERROR
|
||||
#
|
||||
patchParaView()
|
||||
{
|
||||
applyPatch "paraview-$ParaView_VERSION" "$ParaView_SOURCE_DIR"
|
||||
applyPatch "paraview-$ParaView_VERSION" "$PARAVIEW_SOURCEDIR"
|
||||
}
|
||||
|
||||
|
||||
@ -386,17 +442,17 @@ configParaView()
|
||||
local cmake=$(findCMake)
|
||||
|
||||
# Remove any existing build folder and recreate
|
||||
if [ -d $ParaView_BUILD_DIR ]
|
||||
if [ -d "$PARAVIEW_BUILDDIR" ]
|
||||
then
|
||||
echo "removing old build directory"
|
||||
echo " $ParaView_BUILD_DIR"
|
||||
rm -rf $ParaView_BUILD_DIR
|
||||
echo " $PARAVIEW_BUILDDIR"
|
||||
rm -rf "$PARAVIEW_BUILDDIR"
|
||||
fi
|
||||
mkdir -p $ParaView_BUILD_DIR
|
||||
mkdir -p "$PARAVIEW_BUILDDIR"
|
||||
|
||||
addCMakeVariable "CMAKE_BUILD_TYPE=$BUILD_TYPE"
|
||||
|
||||
cd "$ParaView_BUILD_DIR" || exit # Change to build folder
|
||||
cd "$PARAVIEW_BUILDDIR" || exit # Change to build folder
|
||||
|
||||
echo "----"
|
||||
echo "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)"
|
||||
@ -405,26 +461,26 @@ configParaView()
|
||||
echo " MESA support : ${withMESA:-false}"
|
||||
echo " GL2 rendering : ${withGL2:-false}"
|
||||
echo " QT dev support : ${withQT:-true}"
|
||||
echo " Source : $ParaView_SOURCE_DIR"
|
||||
echo " Build : $ParaView_BUILD_DIR"
|
||||
echo " Source : $PARAVIEW_SOURCEDIR"
|
||||
echo " Build : $PARAVIEW_BUILDDIR"
|
||||
echo " Target : $ParaView_DIR"
|
||||
echo " cmake : $cmake"
|
||||
echo " Build suffix : ${BUILD_SUFFIX:-none}"
|
||||
echo "----"
|
||||
echo
|
||||
echo "$cmake" \
|
||||
-DCMAKE_INSTALL_PREFIX=$ParaView_DIR \
|
||||
-DCMAKE_INSTALL_PREFIX="$ParaView_DIR" \
|
||||
$CMAKE_VARIABLES \
|
||||
$ParaView_SOURCE_DIR
|
||||
"$PARAVIEW_SOURCEDIR"
|
||||
echo
|
||||
echo "----"
|
||||
echo
|
||||
|
||||
# Run cmake to create Makefiles
|
||||
$cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=$ParaView_DIR \
|
||||
-DCMAKE_INSTALL_PREFIX="$ParaView_DIR" \
|
||||
$CMAKE_VARIABLES \
|
||||
$ParaView_SOURCE_DIR
|
||||
"$PARAVIEW_SOURCEDIR"
|
||||
}
|
||||
|
||||
|
||||
@ -434,7 +490,7 @@ configParaView()
|
||||
#
|
||||
makeParaView()
|
||||
{
|
||||
cd "$ParaView_BUILD_DIR" || exit # Change to build folder
|
||||
cd "$PARAVIEW_BUILDDIR" || exit # Change to build folder
|
||||
echo " Starting make"
|
||||
time make -j $WM_NCOMPPROCS
|
||||
echo " Done make"
|
||||
@ -453,7 +509,7 @@ makeParaView()
|
||||
#
|
||||
installParaView()
|
||||
{
|
||||
cd "$ParaView_BUILD_DIR" || exit # Change to build folder
|
||||
cd "$PARAVIEW_BUILDDIR" || exit # Change to build folder
|
||||
echo " Installing ParaView to $ParaView_DIR"
|
||||
|
||||
make install
|
||||
@ -495,7 +551,9 @@ INFO
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Start with these general settings
|
||||
addCMakeVariable "BUILD_SHARED_LIBS=ON" "BUILD_TESTING=OFF"
|
||||
|
||||
# No testing
|
||||
addCMakeVariable "BUILD_TESTING=OFF"
|
||||
|
||||
# Include development files in "make install"
|
||||
addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -33,18 +33,17 @@ unset qtVERSION # No default version
|
||||
#
|
||||
createQtConf()
|
||||
{
|
||||
local confFile="$QT_ARCH_PATH/bin/qt.conf"
|
||||
|
||||
if [ -n "$QT_ARCH_PATH" ] && [ -d "$QT_ARCH_PATH/bin" ]
|
||||
local prefix="$1"
|
||||
if [ -n "$prefix" ] && [ -d "$prefix/bin" ]
|
||||
then
|
||||
/bin/cat << QT_CONF > $confFile
|
||||
/bin/cat << QT_CONF > "$prefix/bin/qt.conf"
|
||||
[Paths]
|
||||
Prefix=$QT_ARCH_PATH
|
||||
Prefix="$prefix"
|
||||
QT_CONF
|
||||
echo " created qt.conf"
|
||||
|
||||
else
|
||||
echo "Error: QT_ARCH_PATH not correctly set"
|
||||
echo "Error: qt-prefix <$prefix> not correctly set"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -56,9 +55,10 @@ QT_CONF
|
||||
#
|
||||
finalizeQt()
|
||||
{
|
||||
local prefix="$1"
|
||||
echo "Create/Edit files to ease later relocation of a QT installation"
|
||||
createQtConf
|
||||
pkgconfigAdjust $QT_ARCH_PATH
|
||||
createQtConf "$prefix"
|
||||
pkgconfigAdjust "$prefix"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -28,18 +28,95 @@
|
||||
# CMAKE_ARCH_PATH that may specify a possible cmake/bin directory.
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
umask 0022 # Created files to be readable by all
|
||||
|
||||
# The normal locations for source, build and installation (prefix-dir)
|
||||
sourceBASE="$WM_THIRD_PARTY_DIR"
|
||||
buildBASE="$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER"
|
||||
installBASE="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
|
||||
|
||||
# Commonly used names
|
||||
unset sourceDIR buildDIR prefixDIR binDIR incDIR libDIR
|
||||
|
||||
# Synthetic value combining precision and label size (Eg, DPInt32)
|
||||
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)
|
||||
EXT_SO="$(wmake -show-ext-so 2>/dev/null)"
|
||||
if [ -z "$EXT_SO" ]
|
||||
@ -55,6 +132,13 @@ then
|
||||
esac
|
||||
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
|
||||
# WM_CFLAGS and WM_LDFLAGS for arch information
|
||||
@ -70,6 +154,7 @@ fi
|
||||
|
||||
unset BUILD_SUFFIX
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Check for existence of shared library (without .so extension)
|
||||
#
|
||||
@ -211,6 +296,16 @@ useGcc()
|
||||
export CXX=g++
|
||||
}
|
||||
|
||||
|
||||
# Force use of system gcc/g++ (wmake compilation) without changing the
|
||||
# WM_OPTIONS or output directories
|
||||
useGccWmake()
|
||||
{
|
||||
export WM_COMPILER=Gcc
|
||||
export WM_COMPILER_TYPE=system
|
||||
}
|
||||
|
||||
|
||||
# Scan arguments for a '-gcc' option, forcing gcc/g++ when found
|
||||
useGccFlag()
|
||||
{
|
||||
@ -229,15 +324,29 @@ useGccFlag()
|
||||
# Final fallback is <gcc>
|
||||
whichCC()
|
||||
{
|
||||
local fallback='gcc'
|
||||
local comp="$CC"
|
||||
local warn
|
||||
|
||||
if [ -z "$comp" ]
|
||||
then
|
||||
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
|
||||
else
|
||||
warn="No C compiler found via wmake."
|
||||
fi
|
||||
if [ -n "$warn" ]
|
||||
then
|
||||
echo "${warn} Defaulting to '${fallback}'" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${comp:-gcc}"
|
||||
echo "${comp:-$fallback}"
|
||||
}
|
||||
|
||||
|
||||
@ -246,25 +355,47 @@ whichCC()
|
||||
# Final fallback is <g++>
|
||||
whichCXX()
|
||||
{
|
||||
local fallback='g++'
|
||||
local comp="$CXX"
|
||||
local warn
|
||||
|
||||
if [ -z "$comp" ]
|
||||
then
|
||||
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
|
||||
else
|
||||
warn="No CXX compiler found via wmake."
|
||||
fi
|
||||
if [ -n "$warn" ]
|
||||
then
|
||||
echo "${warn} Defaulting to '${fallback}'" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${comp:-g++}"
|
||||
echo "${comp:-$fallback}"
|
||||
}
|
||||
|
||||
|
||||
# Return <mpicc> by default or <mpiicc> if possible for INTELMPI.
|
||||
# Return
|
||||
# <mpicc> by default
|
||||
# <mpifcc> for FJMPI (if possible)
|
||||
# <mpiicc> for INTELMPI (if possible)
|
||||
#
|
||||
# Cray doesn't have <mpicc>, but its <cc> manages mpi paths directly.
|
||||
# NOTE: could further refine based on "wmake -show-c", but not yet needed
|
||||
whichMpicc()
|
||||
{
|
||||
local comp="$(command -v mpicc)"
|
||||
local fallback='mpicc'
|
||||
local comp="$(command -v $fallback)"
|
||||
case "$WM_MPLIB" in
|
||||
(FJMPI)
|
||||
comp="$(command -v mpifcc)" # Fujitsu <mpifcc> available?
|
||||
;;
|
||||
(INTELMPI)
|
||||
comp="$(command -v mpiicc)" # Intel <mpiicc> available?
|
||||
;;
|
||||
@ -272,25 +403,33 @@ whichMpicc()
|
||||
: "${comp:=cc}" # Cray <cc> if there is no <mpicc>
|
||||
;;
|
||||
esac
|
||||
echo "${comp:-mpicc}"
|
||||
echo "${comp:-$fallback}"
|
||||
}
|
||||
|
||||
|
||||
# Return <mpicxx> by default or <mpiicpc> if possible for INTELMPI.
|
||||
# Return
|
||||
# <mpicxx> by default
|
||||
# <mpiFCC> for FJMPI (if possible)
|
||||
# <mpiicpc> for INTELMPI (if possible)
|
||||
#
|
||||
# Cray doesn't have <mpicxx>, but its <CC> manages mpi paths directly.
|
||||
# NOTE: could further refine based on "wmake -show-cxx", but not yet needed
|
||||
whichMpicxx()
|
||||
{
|
||||
local comp="$(command -v mpicxx)"
|
||||
local fallback='mpicxx'
|
||||
local comp="$(command -v $fallback)"
|
||||
case "$WM_MPLIB" in
|
||||
(FJMPI)
|
||||
comp="$(command -v mpiFCC)" # Fujitsu <mpiFCC> available?
|
||||
;;
|
||||
(INTELMPI)
|
||||
comp="$(command -v mpiicpc)" # Intel <mpiicpc> available?
|
||||
;;
|
||||
(CRAY-MPI*)
|
||||
: "${comp:=CC}" # Cray <CC> if there is no <mpicc>
|
||||
: "${comp:=CC}" # Cray <CC> if there is no <mpicxx>
|
||||
;;
|
||||
esac
|
||||
echo "${comp:-mpicxx}"
|
||||
echo "${comp:-$fallback}"
|
||||
}
|
||||
|
||||
# Require wmkdepend etc when building with wmake
|
||||
@ -344,18 +483,164 @@ requireExtLibBin()
|
||||
# Should be of the form "[link xx]: http://..."
|
||||
showDownloadHint()
|
||||
{
|
||||
local package="$1"
|
||||
local package
|
||||
|
||||
if [ -n "$package" ]
|
||||
if [ -f "$WM_THIRD_PARTY_DIR/BUILD.md" ]
|
||||
then
|
||||
echo "Possible download locations for $package :"
|
||||
for package in "$@"
|
||||
do
|
||||
echo "Possible download locations for $package :" 1>&2
|
||||
|
||||
if [ -f "$WM_THIRD_PARTY_DIR/BUILD.md" ]
|
||||
then
|
||||
grep -i "$package" "$WM_THIRD_PARTY_DIR/BUILD.md" | \
|
||||
grep -E '(http|ftp)' | sed -ne 's/^ *\[.*\]: */ /p' | \
|
||||
uniq
|
||||
fi
|
||||
if [ -f "$WM_THIRD_PARTY_DIR/BUILD.md" ]
|
||||
then
|
||||
grep -i "$package" "$WM_THIRD_PARTY_DIR/BUILD.md" | \
|
||||
grep -E '(http|ftp)' | sed -ne 's/^ *\[.*\]: */ /p' | \
|
||||
uniq
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "No BUILD.md available" 1>&2
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Resolve the appropriate source directory for the given PACKAGE
|
||||
#
|
||||
# checks:
|
||||
# - ThirdParty/PACKAGE
|
||||
# - ThirdParty/sources/PACKAGE
|
||||
# - ThirdParty/sources/canonical/PACKAGE
|
||||
#
|
||||
# Where the 'canonical' name is simply the lowercase version of PACKAGE
|
||||
# without any version information.
|
||||
# Eg, "ParaView-5.9.0" -> "paraview"
|
||||
# but also accept "0config-v1.2" -> "0config"
|
||||
#
|
||||
# Optional flags:
|
||||
# -absolute : report absolute path [default]
|
||||
# -relative : report path relative to sourceBASE (ThirdParty)
|
||||
#
|
||||
findSourceDir()
|
||||
{
|
||||
local package subdir optRelative
|
||||
|
||||
case "$1" in
|
||||
(-abs*)
|
||||
optRelative=false
|
||||
shift
|
||||
;;
|
||||
(-rel*)
|
||||
optRelative=true
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
|
||||
for package in "$@"
|
||||
do
|
||||
subdir="$(basename "$package" | tr '[:upper:]' '[:lower:]' |\
|
||||
sed -ne 's#^\([0-9]*[a-z]*\).*#\1#p')"
|
||||
|
||||
for check in \
|
||||
"$package" \
|
||||
"$subdir/$package" \
|
||||
"sources/$package" \
|
||||
"sources/$subdir/$package" \
|
||||
;
|
||||
do
|
||||
if [ -d "$sourceBASE/$check" ]
|
||||
then
|
||||
echo "Found sources: $check" 1>&2
|
||||
|
||||
if [ "${optRelative:-false}" = true ]
|
||||
then
|
||||
echo "$check"
|
||||
else
|
||||
echo "$sourceBASE/$check"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# Fallback. Report if missing (unless none or system)
|
||||
case "${1##*-}" in
|
||||
(none | system)
|
||||
;;
|
||||
(*)
|
||||
echo "Did not find ... $@" 1>&2
|
||||
esac
|
||||
|
||||
echo "$sourceBASE/${1:-missing-package-name}"
|
||||
}
|
||||
|
||||
|
||||
# List available unpacked source versions
|
||||
#
|
||||
# checks:
|
||||
# - ThirdParty/PACKAGE
|
||||
# - ThirdParty/sources/PACKAGE
|
||||
# - ThirdParty/sources/canonical/PACKAGE
|
||||
#
|
||||
# Output style
|
||||
# -dirs : report the names with relative directory
|
||||
# -names : report the names only (without directory)
|
||||
# -long : report the names with full (absolute) directory
|
||||
listPackageVersions()
|
||||
{
|
||||
local package
|
||||
|
||||
local optOutput=short
|
||||
case "$1" in
|
||||
(-long | -full)
|
||||
optOutput=long
|
||||
shift
|
||||
;;
|
||||
(-dirs | -short)
|
||||
optOutput=dirs
|
||||
shift
|
||||
;;
|
||||
(-names)
|
||||
optOutput=names
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$#" -gt 0 ]
|
||||
then
|
||||
(
|
||||
cd "$sourceBASE" 2>/dev/null || exit
|
||||
|
||||
for package in "$@"
|
||||
do
|
||||
# Canonical short name
|
||||
package="$(basename "$package" | tr '[:upper:]' '[:lower:]' |\
|
||||
sed -ne 's#^\([0-9]*[a-z]*\).*$#\1#p')"
|
||||
|
||||
[ -n "$package" ] || continue
|
||||
|
||||
for dir in . ./"$package" sources sources/"$package"
|
||||
do
|
||||
# Find package-version (ie, when it has separators)
|
||||
find "$dir" -maxdepth 1 \
|
||||
-iname "${package}*[-_]*" -type d 2>/dev/null | \
|
||||
sed -e 's#^[./]*##' | sort
|
||||
done | \
|
||||
case "$optOutput" in
|
||||
(long)
|
||||
sed -e "s#^#$sourceBASE/#" # Add source-dir prefix
|
||||
;;
|
||||
(names)
|
||||
# Basenames only. Squash out potential duplicates
|
||||
sed -e 's#^.*/##' | sort | uniq
|
||||
;;
|
||||
(*)
|
||||
# Relative - no change
|
||||
sed -e ''
|
||||
;;
|
||||
esac
|
||||
done
|
||||
)
|
||||
fi
|
||||
}
|
||||
|
||||
@ -406,12 +691,15 @@ setBuildSuffix()
|
||||
#
|
||||
# Mostly building without wmake
|
||||
# - disable wmakeScheduler variables
|
||||
# - use max number of cores for building
|
||||
# - use max number of cores for building, unless already defined
|
||||
#
|
||||
unset WM_HOSTS WM_SCHEDULER
|
||||
|
||||
WM_NCOMPPROCS=$(getconf _NPROCESSORS_ONLN 2>/dev/null) || WM_NCOMPPROCS=1
|
||||
: ${WM_NCOMPPROCS:=1}
|
||||
if [ -z "$WM_NCOMPPROCS" ]
|
||||
then
|
||||
WM_NCOMPPROCS=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
|
||||
: "${WM_NCOMPPROCS:=1}"
|
||||
fi
|
||||
export WM_NCOMPPROCS
|
||||
|
||||
|
||||
@ -767,23 +1055,23 @@ downloadFile()
|
||||
# $2 = TARGET DIRECTORY (optional)
|
||||
cpMakeFiles()
|
||||
{
|
||||
[ "$#" -eq 1 -o "$#" -eq 2 ] || {
|
||||
[ "$#" -eq 1 ] || [ "$#" -eq 2 ] || {
|
||||
echo "cpMakeFiles called with incorrect number of arguments $@"
|
||||
return 1
|
||||
}
|
||||
|
||||
local pkg=$1
|
||||
local pkg="$1"
|
||||
local dst="${2:-.}"
|
||||
echo "cpMakeFiles" $pkg $dst
|
||||
echo "cpMakeFiles" "$pkg" "$dst"
|
||||
|
||||
wmakeFiles=$WM_THIRD_PARTY_DIR/etc/makeFiles/$pkg
|
||||
wmakeFiles="$WM_THIRD_PARTY_DIR/etc/makeFiles/$pkg"
|
||||
|
||||
for i in $(cd $wmakeFiles && find . -type f)
|
||||
do
|
||||
d=${i%/*} # dirname
|
||||
b=${i##*/} # basename
|
||||
d="${i%/*}" # dirname
|
||||
b="${i##*/}" # basename
|
||||
|
||||
mkdir -p $dst/$d/Make 2>/dev/null
|
||||
mkdir -p "$dst/$d"/Make 2>/dev/null
|
||||
|
||||
# NOTE the behaviour of '-nt' can cause problems
|
||||
#
|
||||
@ -793,9 +1081,9 @@ cpMakeFiles()
|
||||
# - dash, zsh (and maybe others)
|
||||
# False, if file1 or file2 does not exist
|
||||
#
|
||||
if [ ! -e $dst/$d/Make/$b -o $wmakeFiles/$i -nt $dst/$d/Make/$b ]
|
||||
if [ ! -e "$dst/$d/Make/$b" -o "$wmakeFiles/$i" -nt "$dst/$d/Make/$b" ]
|
||||
then
|
||||
cp $wmakeFiles/$i $dst/$d/Make/$b
|
||||
cp "$wmakeFiles/$i" "$dst/$d/Make/$b"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -30,43 +30,62 @@ unset CMAKE_VARIABLES
|
||||
# Where things are or should be put
|
||||
# VTK_VERSION and VTK_MAJOR should already have been set
|
||||
#
|
||||
# VTK_SOURCE_DIR : location of the original sources
|
||||
# VTK_BUILD_DIR : location of the build
|
||||
# VTK_DIR : location of the installed program
|
||||
# VTK_SOURCEDIR : location of the original sources
|
||||
# VTK_BUILDDIR : location of the build
|
||||
# VTK_DIR : location of the installed program
|
||||
#
|
||||
setVtkDirs()
|
||||
{
|
||||
set -- "VTK-$VTK_VERSION" "VTK-v$VTK_VERSION"
|
||||
unset VTK_SOURCE_DIR
|
||||
unset VTK_SOURCEDIR VTK_BUILDDIR
|
||||
|
||||
for i
|
||||
# search
|
||||
# - ThirdParty/PACKAGE
|
||||
# - ThirdParty/sources/PACKAGE
|
||||
# - ThirdParty/sources/vtk/PACKAGE
|
||||
# - ThirdParty/sources/paraview/PACKAGE
|
||||
for package in "$@"
|
||||
do
|
||||
VTK_SOURCE_DIR="$sourceBASE/$i"
|
||||
[ -d "$VTK_SOURCE_DIR" ] && break
|
||||
for check in \
|
||||
"$package" \
|
||||
"sources/$package" \
|
||||
"sources/vtk/$package" \
|
||||
"sources/paraview/$package" \
|
||||
;
|
||||
do
|
||||
if [ -d "$sourceBASE/$check" ]
|
||||
then
|
||||
echo "Found sources: $check" 1>&2
|
||||
VTK_SOURCEDIR="$sourceBASE/$check"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
[ -d "$VTK_SOURCE_DIR" ] || {
|
||||
[ -d "$VTK_SOURCEDIR" ] || {
|
||||
echo "Did not locate VTK version:"
|
||||
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
||||
echo
|
||||
echo "In the directory:"
|
||||
echo " $sourceBASE"
|
||||
echo " \-- sources/paraview"
|
||||
echo " |-- vtk"
|
||||
echo " \\-- paraview"
|
||||
echo
|
||||
echo "abort build"
|
||||
exit 1
|
||||
}
|
||||
|
||||
VTK_BUILD_DIR=$buildBASE/VTK-$VTK_VERSION$BUILD_SUFFIX
|
||||
VTK_DIR=$installBASE/VTK-$VTK_VERSION$BUILD_SUFFIX
|
||||
VTK_BUILDDIR="$buildBASE/VTK-$VTK_VERSION$BUILD_SUFFIX"
|
||||
VTK_DIR="$installBASE/VTK-$VTK_VERSION$BUILD_SUFFIX"
|
||||
export GIT_DIR="$VTK_SOURCEDIR/.git" # Avoid seeing our own git-repo
|
||||
|
||||
export VTK_SOURCE_DIR VTK_BUILD_DIR VTK_DIR
|
||||
export VTK_SOURCEDIR VTK_BUILDDIR VTK_DIR
|
||||
|
||||
echo
|
||||
echo "VTK_SOURCE_DIR=$VTK_SOURCE_DIR"
|
||||
echo "VTK_BUILD_DIR=$VTK_BUILD_DIR"
|
||||
echo "VTK_DIR=$VTK_DIR"
|
||||
|
||||
export GIT_DIR="$VTK_SOURCE_DIR/.git" # Mask seeing our own git-repo
|
||||
echo "VTK_SOURCEDIR=$VTK_SOURCEDIR"
|
||||
echo "VTK_BUILDDIR=$VTK_BUILDDIR"
|
||||
}
|
||||
|
||||
|
||||
@ -99,7 +118,7 @@ setVtkVersion()
|
||||
#
|
||||
patchVTK()
|
||||
{
|
||||
applyPatch "vtk-$VTK_VERSION" "$VTK_SOURCE_DIR"
|
||||
applyPatch "vtk-$VTK_VERSION" "$VTK_SOURCEDIR"
|
||||
}
|
||||
|
||||
|
||||
@ -111,41 +130,41 @@ configVTK()
|
||||
local cmake=$(findCMake)
|
||||
|
||||
# Remove any existing build folder and recreate
|
||||
if [ -d $VTK_BUILD_DIR ]
|
||||
if [ -d "$VTK_BUILDDIR" ]
|
||||
then
|
||||
echo "removing old build directory"
|
||||
echo " $VTK_BUILD_DIR"
|
||||
rm -rf $VTK_BUILD_DIR
|
||||
echo " $VTK_BUILDDIR"
|
||||
rm -rf "$VTK_BUILDDIR"
|
||||
fi
|
||||
mkdir -p $VTK_BUILD_DIR
|
||||
mkdir -p "$VTK_BUILDDIR"
|
||||
|
||||
addCMakeVariable "CMAKE_BUILD_TYPE=$BUILD_TYPE"
|
||||
|
||||
cd "$VTK_BUILD_DIR" || exit # change to build folder
|
||||
cd "$VTK_BUILDDIR" || exit # Change to build folder
|
||||
|
||||
echo "----"
|
||||
echo "Configuring VTK-$VTK_VERSION"
|
||||
echo " MESA support : ${withMESA:-false}"
|
||||
echo " Source : $VTK_SOURCE_DIR"
|
||||
echo " Build : $VTK_BUILD_DIR"
|
||||
echo " Source : $VTK_SOURCEDIR"
|
||||
echo " Build : $VTK_BUILDDIR"
|
||||
echo " Target : $VTK_DIR"
|
||||
echo " cmake : $cmake"
|
||||
echo " Build suffix : ${BUILD_SUFFIX:-none}"
|
||||
echo "----"
|
||||
echo
|
||||
echo "$cmake" \
|
||||
-DCMAKE_INSTALL_PREFIX=$VTK_DIR \
|
||||
-DCMAKE_INSTALL_PREFIX="$VTK_DIR" \
|
||||
$CMAKE_VARIABLES \
|
||||
$VTK_SOURCE_DIR
|
||||
"$VTK_SOURCEDIR"
|
||||
echo
|
||||
echo "----"
|
||||
echo
|
||||
|
||||
# Run cmake to create Makefiles
|
||||
$cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=$VTK_DIR \
|
||||
-DCMAKE_INSTALL_PREFIX="$VTK_DIR" \
|
||||
$CMAKE_VARIABLES \
|
||||
$VTK_SOURCE_DIR
|
||||
"$VTK_SOURCEDIR"
|
||||
}
|
||||
|
||||
|
||||
@ -168,6 +187,10 @@ addMpiSupport()
|
||||
then
|
||||
addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
|
||||
fi
|
||||
|
||||
echo "----"
|
||||
echo "MPI information:"
|
||||
echo " home : $MPI_HOME"
|
||||
}
|
||||
|
||||
|
||||
@ -177,7 +200,7 @@ addMpiSupport()
|
||||
#
|
||||
makeVTK()
|
||||
{
|
||||
cd "$VTK_BUILD_DIR" || exit # Change to build folder
|
||||
cd "$VTK_BUILDDIR" || exit # Change to build folder
|
||||
echo " Starting make"
|
||||
time make -j $WM_NCOMPPROCS
|
||||
|
||||
@ -194,7 +217,7 @@ makeVTK()
|
||||
#
|
||||
installVTK()
|
||||
{
|
||||
cd "$VTK_BUILD_DIR" || exit # Change to build folder
|
||||
cd "$VTK_BUILDDIR" || exit # Change to build folder
|
||||
echo " Installing VTK to $VTK_DIR"
|
||||
|
||||
make install
|
||||
|
||||
173
makeAdios2
173
makeAdios2
@ -5,7 +5,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -27,50 +27,70 @@ if [ "$1" = "-test" ]
|
||||
then
|
||||
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
|
||||
dir="${2%/}" # <- *_ARCH_PATH
|
||||
if [ -d "$dir/include" ] \
|
||||
&& [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
|
||||
then
|
||||
echo " adios2 include: $dir/include"
|
||||
echo " adios2 library: $dir/lib$WM_COMPILER_LIB_ARCH"
|
||||
exit 0
|
||||
else
|
||||
exit 2
|
||||
fi
|
||||
[ -d "$dir/include" ] || exit 2
|
||||
|
||||
package="adios2"
|
||||
libName="libadios2"
|
||||
libName2="libadios2_cxx11_mpi"
|
||||
for lib in \
|
||||
"$dir/lib/$libName$EXT_SO" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
|
||||
"$dir/lib/$libName2$EXT_SO" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName2$EXT_SO" \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo " $package include: $dir/include"
|
||||
echo " $package library: ${lib%/*}"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
exit 2
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
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
|
||||
|
||||
adiosPACKAGE=${adios2_version:-adios-none}
|
||||
PACKAGE="${adios2_version:-none}"
|
||||
|
||||
# Hint for cmake findMPI
|
||||
if [ -d "$MPI_ARCH_PATH" ]
|
||||
then
|
||||
export MPI_HOME="$MPI_ARCH_PATH"
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions adios; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [adios-VERSION]
|
||||
Usage: ${0##*/} [OPTION] [adios-VERSION]
|
||||
options:
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH With cmake from the given path
|
||||
-help
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH With cmake from the given path
|
||||
-mpi-home PATH With hint for MPI_HOME
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* Build ADIOS2
|
||||
$adiosPACKAGE
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint ADIOS2
|
||||
exit 1
|
||||
showDownloadHint adios2
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler minimal # Minimal compiler info for CMake/configure
|
||||
@ -82,7 +102,8 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
|
||||
@ -91,9 +112,17 @@ do
|
||||
CMAKE_PATH="${2%%/}"
|
||||
shift
|
||||
;;
|
||||
-mpi-home) # mpi with hint
|
||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||
export MPI_HOME="${2%%/}"
|
||||
case "${MPI_HOME:-none}" in (false|none) unset MPI_HOME;; esac
|
||||
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*)
|
||||
adiosPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -102,58 +131,71 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$adiosPACKAGE" ] || die "The adios2-VERSION was not specified"
|
||||
|
||||
# nothing to build
|
||||
if _foamIsNone "$adiosPACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using adios-none (skip ThirdParty build of ADIOS)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$adiosPACKAGE"
|
||||
die "The ADIOS package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using adios-system"
|
||||
echo "Using none/system (skip ThirdParty build of ADIOS)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Known build issues for mingw (various things)
|
||||
case "$WM_COMPILER" in
|
||||
(Mingw*)
|
||||
if [ "$optForce" = true ]
|
||||
then
|
||||
echo "Warning: adios2 - known compilation issues with $WM_COMPILER"
|
||||
else
|
||||
echo "Skipping adios2 - known compilation issues with $WM_COMPILER"
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build ADIOS
|
||||
# ADIOS2_SOURCE_DIR : location of the original sources
|
||||
# ADIOS2_ARCH_PATH : installation directory
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
ADIOS2_SOURCE_DIR=$sourceBASE/$adiosPACKAGE
|
||||
ADIOS2_ARCH_PATH=$installBASE/$adiosPACKAGE
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
: ${FOAM_MPI:=dummy}
|
||||
: "${FOAM_MPI:=dummy}"
|
||||
|
||||
echo
|
||||
echo ========================================
|
||||
echo "Build adios library $adiosPACKAGE for $FOAM_MPI"
|
||||
echo "Build adios library $PACKAGE for $FOAM_MPI"
|
||||
echo
|
||||
|
||||
# Needs future adjustment
|
||||
# - for mpi-specific library locations
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -f "$ADIOS2_ARCH_PATH/include/adios2.h" ] \
|
||||
&& [ -r "$ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
|
||||
&& [ -f "$PKG_PREFIX/include/adios2.h" ] \
|
||||
&& {
|
||||
[ -r "$PKG_PREFIX/lib/libadios2$EXT_SO" ] \
|
||||
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
|
||||
}
|
||||
then
|
||||
echo " ADIOS2 header in $ADIOS2_ARCH_PATH/include"
|
||||
echo " ADIOS2 libs in $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
|
||||
echo " ADIOS2 already built : $PKG_PREFIX"
|
||||
else
|
||||
# CMake options often lag the configure ones
|
||||
echo "Starting build: $adiosPACKAGE (using cmake)"
|
||||
echo "Starting build: $PACKAGE (using cmake)"
|
||||
echo
|
||||
(
|
||||
buildDIR=$buildBASE/$adiosPACKAGE
|
||||
cd "$ADIOS2_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
cd "$PKG_SOURCE" || exit
|
||||
|
||||
applyPatch $adiosPACKAGE $ADIOS2_SOURCE_DIR
|
||||
applyPatch "$PACKAGE" "$PKG_SOURCE"
|
||||
|
||||
# Remove any existing build folder and recreate
|
||||
rm -rf $ADIOS2_ARCH_DIR
|
||||
rm -rf $buildDIR 2>/dev/null
|
||||
mkdir -p $buildDIR
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
# May not work properly with FOAM_MPI = dummy
|
||||
if [ "$FOAM_MPI" != dummy ]
|
||||
@ -164,19 +206,20 @@ else
|
||||
|
||||
cmake=$(findCMake)
|
||||
|
||||
# Install into lib64/
|
||||
cd $buildDIR && $cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=$ADIOS2_ARCH_PATH \
|
||||
# Installs into lib64/
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
${cmake:?} \
|
||||
-DCMAKE_INSTALL_PREFIX="$PKG_PREFIX" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DADIOS2_USE_Fortran=FALSE \
|
||||
-DADIOS2_BUILD_EXAMPLES=FALSE \
|
||||
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
||||
$ADIOS2_SOURCE_DIR \
|
||||
"$PKG_SOURCE" \
|
||||
&& make -j $WM_NCOMPPROCS all \
|
||||
&& make install \
|
||||
&& echo "Built: $adiosPACKAGE"
|
||||
&& echo "Built: $PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $adiosPACKAGE"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
109
makeCCMIO
109
makeCCMIO
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -21,49 +21,51 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# libccmio version from OpenFOAM etc/config.sh file:
|
||||
_foamConfig ccmio
|
||||
|
||||
ccmioPACKAGE=${ccmio_version:-libccmio-2.6.1}
|
||||
PACKAGE="${ccmio_version:-libccmio-2.6.1}"
|
||||
targetType=lib # Default is static linkage
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage()
|
||||
{
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
/bin/cat<<USAGE
|
||||
printVersions() { listPackageVersions ccmio libccmio; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} [OPTION] [lib|libso] [libccmio-VERSION]
|
||||
options:
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* Compile the proprietary libccmio library
|
||||
$ccmioPACKAGE
|
||||
$PACKAGE
|
||||
|
||||
Users wishing to obtain the library should contact Siemens PLM (cd-adapco)
|
||||
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.
|
||||
|
||||
USAGE
|
||||
showDownloadHint CCMIO
|
||||
exit 1
|
||||
showDownloadHint ccmio
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -72,14 +74,17 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-gcc) useGcc ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGccWmake ;;
|
||||
|
||||
lib|libso)
|
||||
targetType="$1"
|
||||
;;
|
||||
|
||||
libccmio/* | sources/libccmio* | \
|
||||
libccmio-[0-9]*)
|
||||
ccmioPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -94,54 +99,62 @@ requireExtLibBin
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build LIBCCMIO
|
||||
#
|
||||
CCMIO_SOURCE_DIR=$sourceBASE/$ccmioPACKAGE
|
||||
CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
|
||||
# *PACKAGE : name-version of the package
|
||||
# *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"
|
||||
|
||||
# Sources must be available
|
||||
[ -d "$CCMIO_SOURCE_DIR" ] || die "Missing sources: '$ccmioPACKAGE'"
|
||||
[ -d "$PKG_SOURCE" ] || die "Missing sources: '$PACKAGE'"
|
||||
|
||||
#
|
||||
# Manual installation
|
||||
#
|
||||
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
|
||||
|
||||
local incdir=$CCMIO_ARCH_PATH/include/libccmio
|
||||
echo
|
||||
echo "Adjusting installation"
|
||||
echo "Installing headers: $incdir"
|
||||
|
||||
# Make headers available:
|
||||
mkdir -m 0755 -p $incdir
|
||||
|
||||
/bin/cp -pv libccmio/ccmio*.h $incdir
|
||||
# Make headers available
|
||||
mkdir -m 0755 -p "$incdir"
|
||||
/bin/cp -pv "$PKG_SOURCE"/libccmio/ccmio*.h "$incdir"
|
||||
}
|
||||
|
||||
echo "Starting build: $ccmioPACKAGE ($targetType)"
|
||||
echo "Starting build: $PACKAGE ($targetType)"
|
||||
echo
|
||||
(
|
||||
cd "$CCMIO_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
|
||||
rm -rf $CCMIO_ARCH_PATH
|
||||
rm -f $FOAM_EXT_LIBBIN/libccmio$EXT_SO
|
||||
|
||||
libdir=$CCMIO_ARCH_PATH/lib
|
||||
cd "$PKG_SOURCE" || exit
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -f "$FOAM_EXT_LIBBIN/libccmio$EXT_SO"
|
||||
|
||||
cpMakeFiles libccmio 2>/dev/null
|
||||
|
||||
# Place static libraries in sub-directory:
|
||||
if [ "$targetType" = lib ]
|
||||
# Static libraries in sub-directory
|
||||
export CCMIO_LIB_DIR="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||
|
||||
# Dynamic libraries directly into FOAM_EXT_LIBBIN
|
||||
if [ "$targetType" = libso ]
|
||||
then
|
||||
mkdir -m 0755 -p $libdir 2>/dev/null
|
||||
export FOAM_EXT_LIBBIN=$libdir
|
||||
CCMIO_LIB_DIR="$FOAM_EXT_LIBBIN"
|
||||
fi
|
||||
mkdir -m 0755 -p "$CCMIO_LIB_DIR" 2>/dev/null
|
||||
|
||||
wmake -j $WM_NCOMPPROCS -s $targetType \
|
||||
&& echo "Built: ccmio" \
|
||||
&& echo "Built: $PACKAGE" \
|
||||
&& install
|
||||
) || {
|
||||
echo "Error building: ccmio"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
525
makeCGAL
525
makeCGAL
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -35,70 +35,111 @@ if [ "$1" = "-test" ]
|
||||
then
|
||||
[ "$#" -eq 3 ] || { echo "${0##*/} -test : needs 2 argument"; exit 1; }
|
||||
dir="${2%/}" # <- *_ARCH_PATH
|
||||
if [ -d "$dir/include" ] && [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libCGAL$EXT_SO" ]
|
||||
[ -d "$dir/include" ] || exit 2
|
||||
|
||||
# CGAL
|
||||
[ -f "$dir"/include/CGAL/version.h ] || exit 2
|
||||
|
||||
unset _my_cgal_libdir
|
||||
_cacheinfo="$dir"/share/openfoam-build
|
||||
if [ -f "$_cacheinfo" ]
|
||||
then
|
||||
echo " CGAL include: $dir/include"
|
||||
echo " CGAL library: $dir/lib$WM_COMPILER_LIB_ARCH"
|
||||
# Additional information about boost
|
||||
dir="${3%/}" # <- BOOST_ARCH_PATH
|
||||
for root in "$dir" /usr
|
||||
_my_cgal_libdir="$(sed -ne 's#^CGAL_HEADER_ONLY=##p' "$_cacheinfo" 2>/dev/null)"
|
||||
if [ "$_my_cgal_libdir" = true ]
|
||||
then
|
||||
_my_cgal_libdir=header
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$_my_cgal_libdir" != header ]
|
||||
then
|
||||
unset _my_cgal_libdir
|
||||
libName="libCGAL"
|
||||
for libdirName in "lib$WM_COMPILER_LIB_ARCH" lib
|
||||
do
|
||||
if [ -d "$root/include/boost" ] \
|
||||
&& [ -r "$root/lib$WM_COMPILER_LIB_ARCH/libboost_system$EXT_SO" ]
|
||||
if [ -r "$dir/$libdirName/$libName$EXT_SO" ]
|
||||
then
|
||||
echo " boost include: $root/include"
|
||||
echo " boost library: $root/lib$WM_COMPILER_LIB_ARCH"
|
||||
_my_cgal_libdir="$dir/$libdirName"
|
||||
break
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
else
|
||||
exit 2
|
||||
fi
|
||||
[ -n "$_my_cgal_libdir" ] || exit 2
|
||||
|
||||
echo " CGAL include: $dir/include"
|
||||
echo " CGAL library: $_my_cgal_libdir"
|
||||
|
||||
# Additional information about boost
|
||||
dir="${3%/}" # <- BOOST_ARCH_PATH
|
||||
libName="libboost_system"
|
||||
for root in "$dir" /usr
|
||||
do
|
||||
[ -d "$root/include/boost" ] || continue
|
||||
for libdirName in "lib$WM_COMPILER_LIB_ARCH" lib
|
||||
do
|
||||
if [ -r "$root/$libdirName/$libName$EXT_SO" ]
|
||||
then
|
||||
echo " boost include: $root/include"
|
||||
echo " boost library: $root/$libdirName"
|
||||
exit 0 # Success
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
exit 2
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
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.
|
||||
# Get compiler first and let CGAL config override GMP and MPFR
|
||||
_foamConfig compiler
|
||||
_foamConfig CGAL
|
||||
|
||||
boostPACKAGE=${boost_version:-boost-system}
|
||||
gmpPACKAGE=${gmp_version:-gmp-system}
|
||||
mpfrPACKAGE=${mpfr_version:-mpfr-system}
|
||||
cgalPACKAGE=$cgal_version
|
||||
BOOST_PACKAGE="${boost_version:-boost-system}"
|
||||
GMP_PACKAGE="${gmp_version:-gmp-system}"
|
||||
MPFR_PACKAGE="${mpfr_version:-mpfr-system}"
|
||||
CGAL_PACKAGE="$cgal_version"
|
||||
|
||||
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||
then
|
||||
unset BOOST_ARCH_PATH CGAL_ARCH_PATH
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions boost cgal; exit 0; }
|
||||
printHelp() {
|
||||
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:
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH Use cmake from the given path
|
||||
-no-lib Configure CGAL for headers-only mode (default OpenFOAM >= 2006)
|
||||
-with-lib Configure CGAL with library
|
||||
-toolset=NAME Use named toolset in bootstrap
|
||||
(use 'none' to let boost determine everything).
|
||||
-system Use system versions for boost/gmp/mpfr
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build CGAL with
|
||||
${cgalPACKAGE:-'unspecified CGAL version'}
|
||||
$boostPACKAGE
|
||||
$gmpPACKAGE
|
||||
$mpfrPACKAGE
|
||||
${CGAL_PACKAGE:-[cgal unspecified]}
|
||||
${BOOST_PACKAGE:-[boost unspecified]}
|
||||
${GMP_PACKAGE:-[gmp unspecified]}
|
||||
${MPFR_PACKAGE:-[mpfr unspecified]}
|
||||
|
||||
Normally builds against ThirdParty boost and gmp/mpfr when possible.
|
||||
To override this behaviour (and use the system boost and/or gmp/mpfr),
|
||||
@ -108,22 +149,24 @@ simply specify a 'system' version. For example,
|
||||
Use gmp-none to disable use of gmp/mpfr (eg, not available)
|
||||
|
||||
USAGE
|
||||
showDownloadHint BOOST
|
||||
showDownloadHint CGAL
|
||||
exit 1
|
||||
showDownloadHint boost
|
||||
showDownloadHint cgal
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
|
||||
unset optHeadersOnly optToolset
|
||||
unset optForce optHeadersOnly optToolset
|
||||
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
|
||||
-cmake)
|
||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||
@ -134,9 +177,9 @@ do
|
||||
optToolset="${1#*=}"
|
||||
;;
|
||||
-sys*)
|
||||
gmpPACKAGE="gmp-system"
|
||||
mpfrPACKAGE="mpfr-system"
|
||||
boostPACKAGE="boost-system"
|
||||
GMP_PACKAGE="gmp-system"
|
||||
MPFR_PACKAGE="mpfr-system"
|
||||
BOOST_PACKAGE="boost-system"
|
||||
unset BOOST_ARCH_PATH GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||
;;
|
||||
-no-lib)
|
||||
@ -146,19 +189,23 @@ do
|
||||
optHeadersOnly=false
|
||||
;;
|
||||
gmp-[0-9]* | gmp-system | gmp-none)
|
||||
gmpPACKAGE="${1%%/}"
|
||||
GMP_PACKAGE="${1%%/}"
|
||||
unset GMP_ARCH_PATH
|
||||
;;
|
||||
mpfr-[0-9]* | mpfr-system | mpfr-none)
|
||||
mpfrPACKAGE="${1%%/}"
|
||||
MPFR_PACKAGE="${1%%/}"
|
||||
unset MPFR_ARCH_PATH
|
||||
;;
|
||||
|
||||
boost/* | sources/boost* | \
|
||||
boost-[0-9]* | boost_[0-9]* | boost-system )
|
||||
boostPACKAGE="${1%%/}"
|
||||
BOOST_PACKAGE="${1%%/}"
|
||||
unset BOOST_ARCH_PATH
|
||||
;;
|
||||
|
||||
cgal/* | sources/cgal* | \
|
||||
CGAL-[0-9]*)
|
||||
cgalPACKAGE="${1%%/}"
|
||||
CGAL_PACKAGE="${1%%/}"
|
||||
unset CGAL_ARCH_PATH
|
||||
;;
|
||||
*)
|
||||
@ -168,15 +215,15 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$cgalPACKAGE" ] || die "The cgal-VERSION was not specified"
|
||||
[ -n "$CGAL_PACKAGE" ] || die "The cgal-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$boostPACKAGE"
|
||||
if _foamIsNone "$BOOST_PACKAGE"
|
||||
then
|
||||
echo "Using boost-none (skip ThirdParty build of BOOST/CGAL)"
|
||||
exit 0
|
||||
fi
|
||||
if _foamIsNone "$cgalPACKAGE"
|
||||
if _foamIsNone "$CGAL_PACKAGE"
|
||||
then
|
||||
echo "Using cgal-none (skip ThirdParty build of CGAL)"
|
||||
exit 0
|
||||
@ -196,29 +243,36 @@ fi
|
||||
# Headers-only - might be able to avoid gmp/mpfr?
|
||||
## if [ "${optHeadersOnly:-false}" = true ]
|
||||
## then
|
||||
## gmpPACKAGE=none
|
||||
## mpfrPACKAGE=none
|
||||
## GMP_PACKAGE=none
|
||||
## MPFR_PACKAGE=none
|
||||
## unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||
## fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# 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:
|
||||
# - system is normally built into 'lib64'
|
||||
# - use Third-Party 'lib64' for consistency.
|
||||
# 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_ARCH_PATH:=$installBASE/$boostPACKAGE}"
|
||||
BOOST_SOURCE="$(findSourceDir "$BOOST_PACKAGE")"
|
||||
BOOST_PACKAGE="$(basename "$BOOST_PACKAGE")"
|
||||
BOOST_PREFIX="$installBASE/$BOOST_PACKAGE"
|
||||
|
||||
boostInc="$BOOST_ARCH_PATH/include"
|
||||
boostLib="$BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
|
||||
# Override as per config file (if any)
|
||||
[ -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
|
||||
echo "Using boost-system (skip ThirdParty build of BOOST)"
|
||||
|
||||
@ -226,16 +280,16 @@ then
|
||||
|
||||
if [ -d "$boostInc" ]
|
||||
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
|
||||
boostPACKAGE="${BOOST_ARCH_PATH##*/}"
|
||||
BOOST_PACKAGE="$(basename "$BOOST_PREFIX")"
|
||||
else
|
||||
echo "ERROR: bad path for BOOST_ARCH_PATH"
|
||||
echo "ERROR: bad path for BOOST_PREFIX"
|
||||
echo "stopping build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
libdir="$BOOST_ARCH_PATH/lib"
|
||||
libdir="$BOOST_PREFIX/lib"
|
||||
else
|
||||
boostInc="/usr/include"
|
||||
boostLib="/usr/lib$WM_COMPILER_LIB_ARCH"
|
||||
@ -243,86 +297,147 @@ then
|
||||
fi
|
||||
|
||||
# Use lib/ when lib64/ does not exist
|
||||
[ ! -d "$boostLib" -a -d "$libdir" ] && boostLib="$libdir"
|
||||
[ -d "$libdir" -a ! -d "$boostLib" ] && boostLib="$libdir"
|
||||
|
||||
elif [ -f "$boostInc/boost/version.hpp" ]
|
||||
elif [ -z "$optForce" ] \
|
||||
&& [ -f "$boostInc/boost/version.hpp" ]
|
||||
then
|
||||
echo "Using $boostPACKAGE"
|
||||
echo "Using $BOOST_PACKAGE"
|
||||
|
||||
libdir="$BOOST_ARCH_PATH/lib"
|
||||
libdir="$BOOST_PREFIX/lib"
|
||||
|
||||
# Use lib when lib64 does not exist
|
||||
[ ! -d "$boostLib" -a -d "$libdir" ] && boostLib="$libdir"
|
||||
[ -d "$libdir" -a ! -d "$boostLib" ] && boostLib="$libdir"
|
||||
|
||||
else
|
||||
echo "Starting build: $boostPACKAGE"
|
||||
echo "Starting build: $BOOST_PACKAGE"
|
||||
echo
|
||||
# Absolute path for --libdir
|
||||
|
||||
(
|
||||
# Write user-config.jam into source directory
|
||||
# this is not great, but project-config.jam is written there too
|
||||
cd "$BOOST_SOURCE" || exit
|
||||
export GIT_DIR="$PWD/.git" # Avoid seeing our own git-repo
|
||||
|
||||
# Configuration options:
|
||||
unset buildOpt
|
||||
|
||||
cd "$BOOST_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
if [ "$optToolset" = none ]
|
||||
then
|
||||
# Let boost determine everything
|
||||
unset optToolset
|
||||
|
||||
rm -rf $BOOST_ARCH_PATH
|
||||
|
||||
case "$WM_COMPILER" in
|
||||
(Arm*)
|
||||
# Toolset for bootstrap
|
||||
optToolset="gcc"
|
||||
|
||||
echo "using clang : arm : $(whichCC) ;" > user-config.jam
|
||||
echo "using mpi ;" >> user-config.jam
|
||||
|
||||
# Toolset for build
|
||||
buildOpt="--user-config=user-config.jam toolset=clang"
|
||||
;;
|
||||
|
||||
(Mingw*)
|
||||
# Toolset for bootstrap
|
||||
optToolset="gcc"
|
||||
|
||||
echo "using gcc : mingw : $(whichCC) ;" > user-config.jam
|
||||
|
||||
# Toolset for build
|
||||
buildOpt="--user-config=user-config.jam toolset=gcc"
|
||||
buildOpt="$buildOpt target-os=windows release"
|
||||
;;
|
||||
|
||||
(*)
|
||||
# Toolset for bootstrap and build
|
||||
if [ -z "$optToolset" ]
|
||||
then
|
||||
optToolset="$(whichCC)"
|
||||
# Base names for gcc-8, clang-9 etc.
|
||||
case "$optToolset" in
|
||||
(clang*) optToolset=clang;;
|
||||
(gcc*) optToolset=gcc;;
|
||||
esac
|
||||
fi
|
||||
elif [ -n "$optToolset" ]
|
||||
then
|
||||
# Assume same toolset for bootstrap and build
|
||||
buildOpt="toolset=$optToolset"
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
# No toolset specified, attempt some guesses
|
||||
c_compiler="$(whichCC)"
|
||||
|
||||
# Compiler-specific adjustments
|
||||
case "$WM_COMPILER" in
|
||||
(Arm*)
|
||||
optToolset=gcc # For boostrap
|
||||
|
||||
# For build
|
||||
echo "using clang : arm : ${c_compiler} ;" > user-config.jam
|
||||
echo "using mpi ;" >> user-config.jam
|
||||
buildOpt="--user-config=user-config.jam toolset=clang"
|
||||
;;
|
||||
|
||||
(Mingw*)
|
||||
optToolset=gcc # For boostrap
|
||||
|
||||
# For build
|
||||
echo "using gcc : mingw : ${c_compiler} ;" > user-config.jam
|
||||
buildOpt="--user-config=user-config.jam toolset=gcc"
|
||||
buildOpt="$buildOpt address-model=64 target-os=windows release"
|
||||
;;
|
||||
|
||||
(*)
|
||||
# For gcc-8, clang-9 etc.
|
||||
|
||||
case "${c_compiler}" in
|
||||
(clang*)
|
||||
optToolset=clang # For boostrap
|
||||
|
||||
# For build
|
||||
echo "using clang : : ${c_compiler} ;" > user-config.jam
|
||||
buildOpt="--user-config=user-config.jam toolset=clang"
|
||||
;;
|
||||
(gcc* | g++*)
|
||||
optToolset=gcc # For boostrap
|
||||
|
||||
# For build
|
||||
echo "using gcc : : ${c_compiler} ;" > user-config.jam
|
||||
buildOpt="--user-config=user-config.jam toolset=gcc"
|
||||
;;
|
||||
(ic[cx]* | icp[cx]*) # intel
|
||||
optToolset=gcc # For boostrap
|
||||
|
||||
# For build
|
||||
echo "using intel : : ${c_compiler} ;" > user-config.jam
|
||||
buildOpt="--user-config=user-config.jam toolset=intel"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# End of configuration options
|
||||
# ----------------------------
|
||||
|
||||
rm -rf "$BOOST_PREFIX"
|
||||
|
||||
./bootstrap.sh \
|
||||
--prefix="$BOOST_ARCH_PATH" \
|
||||
--prefix="$BOOST_PREFIX" \
|
||||
--libdir="$boostLib" \
|
||||
--with-libraries=thread \
|
||||
--with-libraries=system \
|
||||
--with-toolset="$optToolset" \
|
||||
${optToolset:+--with-toolset="$optToolset"} \
|
||||
&& ./b2 $buildOpt -j $WM_NCOMPPROCS install \
|
||||
&& echo "Built: boost"
|
||||
&& echo "Built: $BOOST_PACKAGE"
|
||||
) || {
|
||||
echo "Error building: boost"
|
||||
echo "Error building: $BOOST_PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Cleanup in-source build artifacts
|
||||
(
|
||||
set +e # Ignore errors
|
||||
cd "$BOOST_SOURCE" 2>/dev/null || exit 0
|
||||
|
||||
echo "Cleanup in-source build artifacts: $BOOST_PACKAGE"
|
||||
rm -f project-config.jam* user-config.jam*
|
||||
rm -f b2 bjam bootstrap.log
|
||||
rm -rf \
|
||||
bin.v2 stage \
|
||||
libs/config/checks/architecture/bin \
|
||||
tools/build/src/engine/bootstrap \
|
||||
tools/build/src/engine/bin.* \
|
||||
;
|
||||
true
|
||||
)
|
||||
|
||||
# Unneeded generated files
|
||||
for dir in share/doc share/info share/man
|
||||
do
|
||||
if [ -d "$BOOST_PREFIX/$dir" ]
|
||||
then
|
||||
echo "Discard $dir files to save space: $BOOST_PACKAGE"
|
||||
rm -rf "$BOOST_PREFIX/$dir"
|
||||
fi
|
||||
done
|
||||
rmdir "$BOOST_PREFIX"/share 2>/dev/null || true
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# Nothing left to build
|
||||
if _foamIsSystem "$cgalPACKAGE"
|
||||
if _foamIsSystem "$CGAL_PACKAGE"
|
||||
then
|
||||
echo "Using cgal-system (skip ThirdParty build of CGAL)"
|
||||
exit 0
|
||||
@ -350,23 +465,28 @@ fi
|
||||
# - use Third-Party 'lib64' for consistency.
|
||||
# CGAL-4.9 normally builds into 'lib64', older versions into 'lib'.
|
||||
#
|
||||
# CGAL_SOURCE_DIR : location of the original sources
|
||||
# CGAL_BUILD_DIR : location of the build
|
||||
# CGAL_ARCH_PATH : installation directory
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *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/$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
|
||||
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
|
||||
if _foamIsNone "$gmpPACKAGE" || _foamIsNone "$mpfrPACKAGE"
|
||||
if _foamIsNone "$GMP_PACKAGE" || _foamIsNone "$MPFR_PACKAGE"
|
||||
then
|
||||
GMP_ARCH_PATH=none
|
||||
MPFR_ARCH_PATH=none
|
||||
elif _foamIsSystem "$gmpPACKAGE" || _foamIsSystem "$mpfrPACKAGE"
|
||||
elif _foamIsSystem "$GMP_PACKAGE" || _foamIsSystem "$MPFR_PACKAGE"
|
||||
then
|
||||
# May really be system, but could also by a central installation
|
||||
# Ensure everything is accurately recorded. Resolve paths etc.
|
||||
@ -375,7 +495,7 @@ then
|
||||
then
|
||||
if GMP_ARCH_PATH=$(cd "$GMP_ARCH_PATH" 2>/dev/null && pwd -P)
|
||||
then
|
||||
gmpPACKAGE="${GMP_ARCH_PATH##*/}"
|
||||
GMP_PACKAGE="${GMP_ARCH_PATH##*/}"
|
||||
else
|
||||
echo "ERROR: bad path for GMP_ARCH_PATH"
|
||||
echo "stopping build"
|
||||
@ -389,7 +509,7 @@ then
|
||||
then
|
||||
if MPFR_ARCH_PATH=$(cd "$MPFR_ARCH_PATH" 2>/dev/null && pwd -P)
|
||||
then
|
||||
mpfrPACKAGE="${MPFR_ARCH_PATH##*/}"
|
||||
MPFR_PACKAGE="${MPFR_ARCH_PATH##*/}"
|
||||
else
|
||||
echo "ERROR: bad path for MPFR_ARCH_PATH"
|
||||
echo "stopping build"
|
||||
@ -399,8 +519,10 @@ then
|
||||
MPFR_ARCH_PATH=system
|
||||
fi
|
||||
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
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -408,34 +530,56 @@ fi
|
||||
cat<<SUMMARY
|
||||
CGAL configuration
|
||||
------------------
|
||||
CGAL = $cgalPACKAGE
|
||||
BOOST = $boostPACKAGE
|
||||
GMP = $gmpPACKAGE
|
||||
MPFR = $mpfrPACKAGE
|
||||
CGAL = $CGAL_PACKAGE
|
||||
BOOST = $BOOST_PACKAGE
|
||||
GMP = $GMP_PACKAGE
|
||||
MPFR = $MPFR_PACKAGE
|
||||
------------------
|
||||
SUMMARY
|
||||
|
||||
#
|
||||
# build information recorded for later use
|
||||
#
|
||||
buildInfoFile=$CGAL_ARCH_PATH/share/openfoam-build
|
||||
buildInfoFile="$CGAL_PREFIX"/share/openfoam-build
|
||||
|
||||
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
|
||||
# which libdirName?
|
||||
_my_cgal_libdir=unknown
|
||||
for libdirName in "lib$WM_COMPILER_LIB_ARCH" lib
|
||||
do
|
||||
if [ -d "$CGAL_PREFIX/$libdirName" ]
|
||||
then
|
||||
_my_cgal_libdir="$libdirName"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# which libdirName?
|
||||
_my_boost_libdir=unknown
|
||||
for libdirName in "lib$WM_COMPILER_LIB_ARCH" lib
|
||||
do
|
||||
if [ -d "$BOOST_PREFIX/$libdirName" ]
|
||||
then
|
||||
_my_boost_libdir="$libdirName"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
cat<<BUILD_INFO > "$buildInfoFile"
|
||||
# Information from OpenFOAM build on '$(date)'
|
||||
#
|
||||
CGAL=${CGAL_ARCH_PATH##*/}
|
||||
BOOST=${BOOST_ARCH_PATH##*/}
|
||||
CGAL=${CGAL_PREFIX##*/}
|
||||
BOOST=${BOOST_PREFIX##*/}
|
||||
GMP=${GMP_ARCH_PATH##*/}
|
||||
MPFR=${MPFR_ARCH_PATH##*/}
|
||||
CGAL_VERSION=$CGAL_VERSION
|
||||
BOOST_VERSION=$BOOST_VERSION
|
||||
|
||||
CGAL_lib=lib$WM_COMPILER_LIB_ARCH
|
||||
BOOST_lib=lib$WM_COMPILER_LIB_ARCH
|
||||
CGAL_lib=$_my_cgal_libdir
|
||||
BOOST_lib=$_my_boost_libdir
|
||||
CGAL_HEADER_ONLY=${optHeadersOnly:-default}
|
||||
BUILD_INFO
|
||||
}
|
||||
@ -464,13 +608,16 @@ cgalIsCurrent()
|
||||
local info=$(sed -n -e '/^[A-Z]/p' $buildInfoFile 2>/dev/null)
|
||||
[ -n "$info" ] || return 1
|
||||
|
||||
# Check of lib/ vs lib64/ could be spurious...
|
||||
local libDirName="lib$WM_COMPILER_LIB_ARCH"
|
||||
|
||||
echo "checking information from existing build ..."
|
||||
echo " ${CGAL_ARCH_PATH}"
|
||||
echo " ${CGAL_PREFIX}"
|
||||
|
||||
infoValueEq CGAL "${CGAL_ARCH_PATH##*/}" "$info" || return 1
|
||||
infoValueEq BOOST "${BOOST_ARCH_PATH##*/}" "$info" || return 1
|
||||
[ -f "$CGAL_PREFIX"/include/CGAL/version.h ] || return 1
|
||||
|
||||
infoValueEq CGAL "${CGAL_PREFIX##*/}" "$info" || return 1
|
||||
infoValueEq BOOST "${BOOST_PREFIX##*/}" "$info" || return 1
|
||||
infoValueEq GMP "${GMP_ARCH_PATH##*/}" "$info" || return 1
|
||||
infoValueEq MPFR "${MPFR_ARCH_PATH##*/}" "$info" || return 1
|
||||
infoValueEq BOOST_VERSION "${BOOST_VERSION}" "$info" || return 1
|
||||
@ -481,51 +628,47 @@ cgalIsCurrent()
|
||||
}
|
||||
|
||||
|
||||
if cgalIsCurrent
|
||||
if [ -z "$optForce" ] \
|
||||
&& cgalIsCurrent
|
||||
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
|
||||
exit 0
|
||||
fi
|
||||
|
||||
else
|
||||
(
|
||||
# Remove any existing build folder and recreate
|
||||
if [ -d "$CGAL_BUILD_DIR" ]
|
||||
then
|
||||
echo "removing old build directory"
|
||||
echo " $CGAL_BUILD_DIR"
|
||||
rm -rf "$CGAL_BUILD_DIR"
|
||||
fi
|
||||
mkdir -p "$CGAL_BUILD_DIR"
|
||||
export GIT_DIR="$CGAL_SOURCE/.git"
|
||||
PKG_BUILD="$buildBASE/$CGAL_PACKAGE"
|
||||
|
||||
cd "$CGAL_BUILD_DIR" || exit
|
||||
export GIT_DIR="$CGAL_SOURCE_DIR/.git" # Mask seeing our own git-repo
|
||||
# Remove existing build
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
cd "$PKG_BUILD" || exit
|
||||
|
||||
unset configBoost configGmp configMpfr
|
||||
echo "----"
|
||||
echo "Configuring $cgalPACKAGE with boost $BOOST_VERSION"
|
||||
echo " Source : $CGAL_SOURCE_DIR"
|
||||
echo " Build : $CGAL_BUILD_DIR"
|
||||
echo " Target : $CGAL_ARCH_PATH"
|
||||
echo "Configuring $CGAL_PACKAGE with boost $BOOST_VERSION"
|
||||
echo " Source : $CGAL_SOURCE"
|
||||
echo " Build : $CGAL_BUILD"
|
||||
echo " Target : $CGAL_PREFIX"
|
||||
|
||||
|
||||
# See http://doc.cgal.org/latest/Manual/installation.html
|
||||
if _foamIsSystem "$boostPACKAGE"
|
||||
if _foamIsSystem "$BOOST_PACKAGE"
|
||||
then
|
||||
# Tagged as 'system' but could actually point to a central location
|
||||
if [ -d "$BOOST_ARCH_PATH/include" ]
|
||||
if [ -d "$BOOST_PREFIX/include" ]
|
||||
then
|
||||
echo " boost : ${BOOST_ARCH_PATH##*/}"
|
||||
configBoost="-DBOOST_ROOT=$BOOST_ARCH_PATH"
|
||||
echo " boost : ${BOOST_PREFIX##*/}"
|
||||
configBoost="-DBOOST_ROOT=$BOOST_PREFIX"
|
||||
else
|
||||
echo " boost : system"
|
||||
fi
|
||||
|
||||
## For system - possible that /usr/lib64 not being found?
|
||||
## configBoost="-DBoost_LIBRARY_DIRS=$boostLib"
|
||||
elif [ -d "$BOOST_ARCH_PATH" ]
|
||||
elif [ -d "$BOOST_PREFIX" ]
|
||||
then
|
||||
echo " boost : $boostPACKAGE"
|
||||
echo " boost : $BOOST_PACKAGE"
|
||||
configBoost=$(cat <<CMAKE_OPTIONS
|
||||
-DBoost_INCLUDE_DIR=$boostInc
|
||||
-DBoost_LIBRARY_DIRS=$boostLib
|
||||
@ -547,11 +690,12 @@ CMAKE_OPTIONS
|
||||
configGmp="-DCGAL_DISABLE_GMP=TRUE" # Also used for mpfr
|
||||
elif [ -d "$GMP_ARCH_PATH" ]
|
||||
then
|
||||
echo " gmp : $gmpPACKAGE"
|
||||
echo " gmp : $GMP_PACKAGE"
|
||||
|
||||
# Alternative: export GMP_DIR=... hint
|
||||
for libdir in \
|
||||
$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
||||
$GMP_ARCH_PATH/lib \
|
||||
"$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" \
|
||||
"$GMP_ARCH_PATH"/lib \
|
||||
;
|
||||
do
|
||||
if [ -f "$libdir/libgmp$EXT_SO" ]
|
||||
@ -578,11 +722,12 @@ CMAKE_OPTIONS
|
||||
configGmp="-DCGAL_DISABLE_GMP=TRUE" # Also used for mpfr
|
||||
elif [ -d "$MPFR_ARCH_PATH" ]
|
||||
then
|
||||
echo " mpfr : $mpfrPACKAGE"
|
||||
echo " mpfr : $MPFR_PACKAGE"
|
||||
|
||||
# Alternative: export MPFR_DIR=... hint
|
||||
for libdir in \
|
||||
$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
||||
$MPFR_ARCH_PATH/lib \
|
||||
"$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" \
|
||||
"$MPFR_ARCH_PATH/lib" \
|
||||
;
|
||||
do
|
||||
if [ -f "$libdir/libmpfr$EXT_SO" ]
|
||||
@ -604,6 +749,7 @@ CMAKE_OPTIONS
|
||||
|
||||
unset cmakeDefs
|
||||
|
||||
# Compiler-specific adjustments
|
||||
case "$WM_COMPILER" in
|
||||
(Mingw*)
|
||||
cmakeDefs="$cmakeDefs -DCMAKE_SYSTEM_NAME=Windows"
|
||||
@ -622,10 +768,11 @@ CMAKE_OPTIONS
|
||||
# For CGAL < 4.9, for installation into lib64/, not lib/
|
||||
# Name only (not path) for CGAL_INSTALL_LIB_DIR
|
||||
echo "----"
|
||||
set -x
|
||||
$cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=$CGAL_ARCH_PATH \
|
||||
-DCGAL_INSTALL_LIB_DIR=lib$WM_COMPILER_LIB_ARCH \
|
||||
rm -rf "$CGAL_PREFIX"
|
||||
set -x && \
|
||||
${cmake:?} \
|
||||
-DCMAKE_INSTALL_PREFIX="$CGAL_PREFIX" \
|
||||
-DCGAL_INSTALL_LIB_DIR="lib$WM_COMPILER_LIB_ARCH" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DWITH_CGAL_Core=OFF \
|
||||
-DWITH_CGAL_ImageIO=OFF \
|
||||
@ -633,30 +780,42 @@ CMAKE_OPTIONS
|
||||
$cmakeDefs \
|
||||
$configBoost $configGmp $configMpfr \
|
||||
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
||||
$CGAL_SOURCE_DIR \
|
||||
&& set +x \
|
||||
"$CGAL_SOURCE" \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& set +x \
|
||||
&& make install || exit 1
|
||||
|
||||
echo "----"
|
||||
echo "create '\$CGAL_ARCH_PATH/share/files'"
|
||||
echo "----"
|
||||
mkdir -p $CGAL_ARCH_PATH/share/src
|
||||
rm -f $CGAL_ARCH_PATH/share/files
|
||||
mkdir -p "$CGAL_PREFIX"/share/src
|
||||
rm -f "$CGAL_PREFIX"/share/files
|
||||
|
||||
for i in assertions.cpp io.cpp MP_Float.cpp Random.cpp
|
||||
do
|
||||
if [ -e "$CGAL_SOURCE_DIR/src/CGAL/$i" ]
|
||||
if [ -e "$CGAL_SOURCE/src/CGAL/$i" ]
|
||||
then
|
||||
\cp $CGAL_SOURCE_DIR/src/CGAL/$i $CGAL_ARCH_PATH/share/src/
|
||||
echo "\${CGAL_ARCH_PATH}/share/src/$i" >> $CGAL_ARCH_PATH/share/files
|
||||
\cp "$CGAL_SOURCE/src/CGAL/$i" "$CGAL_PREFIX"/share/src/
|
||||
echo "\${CGAL_PREFIX}/share/src/$i" >> "$CGAL_PREFIX"/share/files
|
||||
fi
|
||||
done
|
||||
|
||||
# Unneeded generated files
|
||||
for dir in share/doc share/info share/man
|
||||
do
|
||||
if [ -d "$CGAL_PREFIX/$dir" ]
|
||||
then
|
||||
echo "Discard $dir files to save space: $CGAL_PACKAGE"
|
||||
rm -rf "$CGAL_PREFIX/$dir"
|
||||
fi
|
||||
done
|
||||
## Leave: rmdir "$CGAL_PREFIX"/share 2>/dev/null || true
|
||||
|
||||
# Record our build-status
|
||||
recordCGALinfo
|
||||
|
||||
echo "Done CGAL"
|
||||
)
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
107
makeCmake
107
makeCmake
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -24,38 +24,40 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Special purpose script - no default version.
|
||||
unset cmakePACKAGE
|
||||
# Special purpose script - no default version
|
||||
unset PACKAGE
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions cmake; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] cmake-VERSION
|
||||
Usage: ${0##*/} [OPTION] cmake-VERSION
|
||||
options:
|
||||
-force Force compilation, even if binary already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-link Create additional symlink as 'cmake-system'
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build cmake
|
||||
${cmakePACKAGE:-'unspecified'}
|
||||
* Build cmake
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint CMAKE
|
||||
exit 1
|
||||
showDownloadHint cmake
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
@ -67,13 +69,15 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
-link) optLink=true ;;
|
||||
|
||||
cmake/* | sources/cmake* | \
|
||||
cmake-[0-9]*)
|
||||
cmakePACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -82,55 +86,60 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$cmakePACKAGE" ] || die "The cmake-VERSION was not specified"
|
||||
|
||||
if _foamIsSystem "$cmakePACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
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
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build CMAKE
|
||||
# CMAKE_SOURCE_DIR : location of the original sources
|
||||
# CMAKE_ARCH_PATH : installation directory
|
||||
# *PACKAGE : name-version of the package
|
||||
# *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" ] \
|
||||
&& [ -d "$CMAKE_ARCH_PATH" ] \
|
||||
&& [ -r "$CMAKE_ARCH_PATH/bin/cmake" ]
|
||||
&& [ -d "$PKG_PREFIX" ] \
|
||||
&& [ -r "$PKG_PREFIX/bin/cmake" ]
|
||||
then
|
||||
echo "Already built: $cmakePACKAGE"
|
||||
echo "Already built: $PACKAGE"
|
||||
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
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
make distclean 2>/dev/null
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
|
||||
$CMAKE_SOURCE_DIR/bootstrap \
|
||||
--prefix=$CMAKE_ARCH_PATH \
|
||||
cd "$PKG_BUILD" && \
|
||||
"$PKG_SOURCE"/bootstrap \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
&& time make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $cmakePACKAGE"
|
||||
&& echo "Built: $PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $cmakePACKAGE"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
if [ "$optLink" = true ] && [ -x "$CMAKE_ARCH_PATH/bin/cmake" ]
|
||||
if [ "$optLink" = true ] && [ -x "$PKG_PREFIX/bin/cmake" ]
|
||||
then
|
||||
(
|
||||
cd "${CMAKE_ARCH_PATH%/*}" || exit
|
||||
cd "${PKG_PREFIX%/*}" || exit
|
||||
if [ -L cmake-system ]
|
||||
then
|
||||
rm cmake-system
|
||||
@ -138,7 +147,7 @@ then
|
||||
then
|
||||
exit 2
|
||||
fi
|
||||
ln -svf "$cmakePACKAGE" cmake-system
|
||||
ln -svf "$PACKAGE" cmake-system
|
||||
)
|
||||
fi
|
||||
|
||||
|
||||
164
makeFFTW
164
makeFFTW
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -28,50 +28,59 @@ if [ "$1" = "-test" ]
|
||||
then
|
||||
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
|
||||
dir="${2%/}" # <- *_ARCH_PATH
|
||||
if [ -d "$dir/include" ] \
|
||||
&& [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ]
|
||||
then
|
||||
echo " fftw include: $dir/include"
|
||||
echo " fftw library: $dir/lib$WM_COMPILER_LIB_ARCH"
|
||||
exit 0
|
||||
else
|
||||
exit 2
|
||||
fi
|
||||
[ -d "$dir/include" ] || exit 2
|
||||
|
||||
package="fftw"
|
||||
libName="libfftw3"
|
||||
for lib in \
|
||||
"$dir/lib/$libName$EXT_SO" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo " $package include: $dir/include"
|
||||
echo " $package library: ${lib%/*}"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
exit 2
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# FFTW version from OpenFOAM etc/config.sh file:
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
_foamConfig FFTW
|
||||
|
||||
fftwPACKAGE=${fftw_version:-fftw-system}
|
||||
PACKAGE="${fftw_version:-none}"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions fftw; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [fftw-VERSION] [-- configure-options]
|
||||
Usage: ${0##*/} [OPTION] [fftw-VERSION] [-- configure-options]
|
||||
options:
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build FFTW with
|
||||
${fftwPACKAGE:-'unspecified FFTW version'}
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint FFTW
|
||||
exit 1
|
||||
showDownloadHint fftw
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
@ -84,12 +93,14 @@ do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
|
||||
fftw/* | sources/fftw* | \
|
||||
fftw-[0-9]* | fftw_[0-9]* | fftw-system )
|
||||
fftwPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -98,46 +109,61 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$fftwPACKAGE" ] || die "The fftw-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$fftwPACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using fftw-none (skip ThirdParty build of FFTW)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$fftwPACKAGE"
|
||||
die "The FFTW package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using fftw-system (skip ThirdParty build of FFTW)"
|
||||
echo "Using none/system (skip ThirdParty build of FFTW)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build FFTW
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
#
|
||||
# For 64-bit
|
||||
# - FFTW itself will normally build into 'lib64',
|
||||
# but provide --libdir on configure to be 100% certain
|
||||
# - Third-Party builds 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
|
||||
FFTW_ARCH_PATH=$installBASE/$fftwPACKAGE
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PKG_SOURCE")"
|
||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ]
|
||||
&& {
|
||||
[ -r "$PKG_PREFIX/lib/libfftw3$EXT_SO" ] \
|
||||
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ] \
|
||||
|| [ -r "$PKG_PREFIX/bin/libfftw3-3$EXT_SO" ] # Windows
|
||||
}
|
||||
then
|
||||
echo "Already has FFTW shared library"
|
||||
echo "FFTW already built : $PKG_PREFIX"
|
||||
else
|
||||
echo "Starting build: FFTW ($fftwPACKAGE)"
|
||||
echo "Starting build: FFTW ($PACKAGE)"
|
||||
echo
|
||||
|
||||
(
|
||||
# Configuration options:
|
||||
unset configOpt
|
||||
|
||||
# Compiler-specific adjustments
|
||||
case "$WM_COMPILER" in
|
||||
(Mingw*)
|
||||
# Cross-compiling
|
||||
# See http://www.fftw.org/install/windows.html
|
||||
configOpt="
|
||||
--host=x86_64-w64-mingw32
|
||||
--with-our-malloc
|
||||
--enable-threads --with-combined-threads
|
||||
--enable-sse2
|
||||
--with-incoming-stack-boundary=2
|
||||
"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Additional configure options
|
||||
if [ "$1" = "--" ]
|
||||
then
|
||||
@ -147,32 +173,40 @@ else
|
||||
|
||||
# End of configuration options
|
||||
# ----------------------------
|
||||
buildDIR=$buildBASE/$fftwPACKAGE
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
cd "$PKG_SOURCE" || exit
|
||||
|
||||
cd "$FFTW_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
rm -rf $FFTW_ARCH_PATH
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
|
||||
set -x
|
||||
$FFTW_SOURCE_DIR/configure \
|
||||
--prefix=$FFTW_ARCH_PATH \
|
||||
--libdir=$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
--enable-shared --disable-static \
|
||||
--disable-fortran \
|
||||
$configOpt \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built $fftwPACKAGE" \
|
||||
&& pkgconfigAdjust $FFTW_ARCH_PATH
|
||||
&& echo "Built: $PACKAGE" \
|
||||
&& pkgconfigAdjust "$PKG_PREFIX"
|
||||
) || {
|
||||
echo "Error building: FFTW"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Unneeded generated files
|
||||
for dir in share/doc share/info share/man
|
||||
do
|
||||
if [ -d "$PKG_PREFIX/$dir" ]
|
||||
then
|
||||
echo "Discard $dir files to save space: $PACKAGE"
|
||||
rm -rf "$PKG_PREFIX/$dir"
|
||||
fi
|
||||
done
|
||||
rmdir "$PKG_PREFIX"/share 2>/dev/null || true
|
||||
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
302
makeGcc
302
makeGcc
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -33,14 +33,16 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
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:
|
||||
_foamConfig compiler
|
||||
|
||||
gmpPACKAGE=${gmp_version:-gmp-system}
|
||||
mpfrPACKAGE=${mpfr_version:-mpfr-system}
|
||||
mpcPACKAGE=${mpc_version:-mpc-system}
|
||||
gccPACKAGE=$gcc_version
|
||||
GMP_PACKAGE="${gmp_version:-gmp-system}"
|
||||
MPFR_PACKAGE="${mpfr_version:-mpfr-system}"
|
||||
MPC_PACKAGE="${mpc_version:-mpc-system}"
|
||||
GCC_PACKAGE="$gcc_version"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions gcc gmp mpfr mpc; exit 0; }
|
||||
printHelp() {
|
||||
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:
|
||||
-clang Force clang/clang++ for building
|
||||
-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-threadsafe disable mpfr thread-safe (default is auto-detect)
|
||||
-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
|
||||
$gmpPACKAGE
|
||||
$mpfrPACKAGE
|
||||
$mpcPACKAGE
|
||||
${gccPACKAGE:-'unspecified GCC version'}
|
||||
* Build combinations of gmp, mpfr, mpc and gcc
|
||||
${GMP_PACKAGE:-[gmp unspecified]}
|
||||
${MPFR_PACKAGE:-[mpfr unspecified]}
|
||||
${MPC_PACKAGE:-[mpc unspecified]}
|
||||
${GCC_PACKAGE:-[gcc unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint GCC
|
||||
showDownloadHint GMP
|
||||
showDownloadHint MPFR
|
||||
showDownloadHint MPC
|
||||
exit 1
|
||||
showDownloadHint gcc
|
||||
showDownloadHint gmp
|
||||
showDownloadHint mpfr
|
||||
showDownloadHint mpc
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
optArch=64 # Use 64-bit ABI
|
||||
@ -96,7 +98,8 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-clang) # Force use of clang/clang++ for building
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
@ -115,27 +118,35 @@ do
|
||||
optThreadSafe=disable
|
||||
;;
|
||||
-sys*)
|
||||
gmpPACKAGE="gmp-system"
|
||||
mpfrPACKAGE="mpfr-system"
|
||||
mpcPACKAGE="mpc-system"
|
||||
GMP_PACKAGE="gmp-system"
|
||||
MPFR_PACKAGE="mpfr-system"
|
||||
MPC_PACKAGE="mpc-system"
|
||||
unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||
;;
|
||||
|
||||
gmp/* | sources/gmp* |\
|
||||
gmp-[0-9]* | gmp-system)
|
||||
gmpPACKAGE="${1%%/}"
|
||||
GMP_PACKAGE="${1%%/}"
|
||||
unset GMP_ARCH_PATH
|
||||
;;
|
||||
|
||||
mpfr/* | sources/mpfr* |\
|
||||
mpfr-[0-9]* | mpfr-system)
|
||||
mpfrPACKAGE="${1%%/}"
|
||||
MPFR_PACKAGE="${1%%/}"
|
||||
unset MPFR_ARCH_PATH
|
||||
;;
|
||||
|
||||
mpc/* | sources/mpc* |\
|
||||
mpc-[0-9]* | mpc-system)
|
||||
mpcPACKAGE="${1%%/}"
|
||||
MPC_PACKAGE="${1%%/}"
|
||||
;;
|
||||
|
||||
gcc/* | sources/gcc* |\
|
||||
gcc-[0-9]* | gcc-system)
|
||||
gccPACKAGE="${1%%/}"
|
||||
GCC_PACKAGE="${1%%/}"
|
||||
;;
|
||||
[0-9]*)
|
||||
gccPACKAGE="gcc-${1%%/}"
|
||||
GCC_PACKAGE="gcc-${1%%/}"
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -144,37 +155,58 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$gccPACKAGE" ] || die "The gcc-VERSION was not specified"
|
||||
[ -n "$GCC_PACKAGE" ] || die "The gcc-VERSION was not specified"
|
||||
|
||||
cat<<SUMMARY
|
||||
GCC configuration
|
||||
------------------
|
||||
GCC = $gccPACKAGE
|
||||
ABI = $optArch
|
||||
GMP = $gmpPACKAGE
|
||||
MPFR = $mpfrPACKAGE
|
||||
MPC = $mpcPACKAGE
|
||||
GCC = $GCC_PACKAGE
|
||||
GMP = $GMP_PACKAGE
|
||||
MPFR = $MPFR_PACKAGE
|
||||
MPC = $MPC_PACKAGE
|
||||
------------------
|
||||
Using CC = $CC $CFLAGS
|
||||
Using CXX = $CXX $CXXFLAGS
|
||||
SUMMARY
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Build/install without compiler name
|
||||
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
|
||||
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
# !Build/install locations with arch name only (NO compiler name)!
|
||||
buildBASE="$(dirname "$buildBASE")/$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
|
||||
addLib()
|
||||
{
|
||||
if [ -d "$1" ]
|
||||
then
|
||||
export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
@ -186,47 +218,47 @@ addLib()
|
||||
# Build GMP
|
||||
# ================
|
||||
echo "---------------"
|
||||
if [ -d "$GMP_ARCH_PATH" ]
|
||||
if [ -d "$GMP_PREFIX" ]
|
||||
then
|
||||
echo "Already built: $gmpPACKAGE"
|
||||
elif _foamIsSystem $GMP_ARCH_PATH
|
||||
echo "Already built: $GMP_PREFIX"
|
||||
elif _foamIsSystem "$GMP_PREFIX"
|
||||
then
|
||||
echo "Using gmp-system"
|
||||
echo "Using system gmp"
|
||||
else
|
||||
echo "Starting build: $gmpPACKAGE"
|
||||
echo "Starting build: $GMP_PACKAGE"
|
||||
echo
|
||||
(
|
||||
sourceDIR=$sourceBASE/$gmpPACKAGE
|
||||
buildDIR=$buildBASE/$gmpPACKAGE
|
||||
PKG_SOURCE="$GMP_SOURCE"
|
||||
PKG_PREFIX="$GMP_PREFIX"
|
||||
PKG_BUILD="$buildBASE/$GMP_PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
cd "$sourceDIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
make distclean 2>/dev/null
|
||||
cd "$PKG_SOURCE" || exit
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
set -x
|
||||
$sourceDIR/configure ABI=$optArch \
|
||||
--prefix=$GMP_ARCH_PATH \
|
||||
--libdir=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure ABI="$optArch" \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||
--enable-cxx \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $gmpPACKAGE"
|
||||
&& echo "Built: $GMP_PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $gmpPACKAGE"
|
||||
echo "Error building: $GMP_PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
if addLib "$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
|
||||
if addLib "$GMP_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||
then
|
||||
configGMP=$(cat <<CONFIG_OPTIONS
|
||||
--with-gmp-include=$GMP_ARCH_PATH/include
|
||||
--with-gmp-lib=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
--with-gmp-include=$GMP_PREFIX/include
|
||||
--with-gmp-lib=$GMP_PREFIX/lib$WM_COMPILER_LIB_ARCH
|
||||
CONFIG_OPTIONS
|
||||
)
|
||||
else
|
||||
@ -238,51 +270,51 @@ fi
|
||||
# Build MPFR
|
||||
# ================
|
||||
echo "---------------"
|
||||
if [ -d "$MPFR_ARCH_PATH" ]
|
||||
if [ -d "$MPFR_PREFIX" ]
|
||||
then
|
||||
echo "Already built: $mpfrPACKAGE"
|
||||
elif _foamIsSystem $MPFR_ARCH_PATH
|
||||
echo "Already built: $MPFR_PACKAGE"
|
||||
elif _foamIsSystem "$MPFR_PREFIX"
|
||||
then
|
||||
echo "Using mpfr-system"
|
||||
echo "Using system mpfr"
|
||||
else
|
||||
echo "Starting build: $mpfrPACKAGE"
|
||||
echo "Starting build: $MPFR_PACKAGE"
|
||||
echo
|
||||
(
|
||||
sourceDIR=$sourceBASE/$mpfrPACKAGE
|
||||
buildDIR=$buildBASE/$mpfrPACKAGE
|
||||
PKG_SOURCE="$MPFR_SOURCE"
|
||||
PKG_PREFIX="$MPFR_PREFIX"
|
||||
PKG_BUILD="$buildBASE/$MPFR_PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
cd "$sourceDIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
make distclean 2>/dev/null
|
||||
cd "$PKG_SOURCE" || exit
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
unset configOpt
|
||||
# explicitly enable/disable thread-safe
|
||||
[ -n "$optThreadSafe" ] && configOpt="--${optThreadSafe}-thread-safe"
|
||||
|
||||
set -x
|
||||
$sourceDIR/configure ABI=$optArch \
|
||||
--prefix=$MPFR_ARCH_PATH \
|
||||
--libdir=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure ABI="$optArch" \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||
$configGMP $configOpt \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $mpfrPACKAGE"
|
||||
&& echo "Built: $MPFR_PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $mpfrPACKAGE"
|
||||
echo "Error building: $MPFR_PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
if addLib "$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
|
||||
if addLib "$MPFR_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||
then
|
||||
configMPFR=$(cat <<CONFIG_OPTIONS
|
||||
--with-mpfr-include=$MPFR_ARCH_PATH/include \
|
||||
--with-mpfr-lib=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
--with-mpfr-include=$MPFR_PREFIX/include \
|
||||
--with-mpfr-lib=$MPFR_PREFIX/lib$WM_COMPILER_LIB_ARCH
|
||||
CONFIG_OPTIONS
|
||||
)
|
||||
else
|
||||
@ -294,47 +326,47 @@ fi
|
||||
# Build MPC
|
||||
# ================
|
||||
echo "---------------"
|
||||
if [ -d "$MPC_ARCH_PATH" ]
|
||||
if [ -d "$MPC_PREFIX" ]
|
||||
then
|
||||
echo "Already built: $mpcPACKAGE"
|
||||
elif _foamIsSystem $MPC_ARCH_PATH
|
||||
echo "Already built: $MPC_PACKAGE"
|
||||
elif _foamIsSystem "$MPC_PREFIX"
|
||||
then
|
||||
echo "Using mpc-system"
|
||||
echo "Using system mpc"
|
||||
else
|
||||
echo "Starting build: $mpcPACKAGE"
|
||||
echo "Starting build: $MPC_PACKAGE"
|
||||
echo
|
||||
(
|
||||
sourceDIR=$sourceBASE/$mpcPACKAGE
|
||||
buildDIR=$buildBASE/$mpcPACKAGE
|
||||
PKG_SOURCE="$MPC_SOURCE"
|
||||
PKG_PREFIX="$MPC_PREFIX"
|
||||
PKG_BUILD="$buildBASE/$MPC_PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
cd "$sourceDIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
make distclean 2>/dev/null
|
||||
cd "$PKG_SOURCE" || exit
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
set -x
|
||||
$sourceDIR/configure ABI=$optArch \
|
||||
--prefix=$MPC_ARCH_PATH \
|
||||
--libdir=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure ABI="$optArch" \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
--libdir="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH" \
|
||||
$configGMP $configMPFR \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $mpcPACKAGE"
|
||||
&& echo "Built: $MPC_PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $mpcPACKAGE"
|
||||
echo "Error building: $MPC_PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
if addLib "$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
|
||||
if addLib "$MPC_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||
then
|
||||
configMPC=$(cat <<CONFIG_OPTIONS
|
||||
--with-mpc-include=$MPC_ARCH_PATH/include \
|
||||
--with-mpc-lib=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
--with-mpc-include=$MPC_PREFIX/include \
|
||||
--with-mpc-lib=$MPC_PREFIX/lib$WM_COMPILER_LIB_ARCH
|
||||
CONFIG_OPTIONS
|
||||
)
|
||||
else
|
||||
@ -350,35 +382,35 @@ fi
|
||||
# or specify -no-multilib on the command-line
|
||||
#
|
||||
echo "---------------"
|
||||
if [ -d "$GCC_ARCH_PATH" ]
|
||||
if [ -d "$GCC_PREFIX" ]
|
||||
then
|
||||
echo "Already built: $gccPACKAGE"
|
||||
elif _foamIsSystem $GCC_ARCH_PATH
|
||||
echo "Already built: $GCC_PACKAGE"
|
||||
elif _foamIsSystem "$GCC_PREFIX"
|
||||
then
|
||||
echo "Using gcc-system"
|
||||
echo "Using system gcc"
|
||||
else
|
||||
echo "Starting build: $gccPACKAGE"
|
||||
echo "Starting build: $GCC_PACKAGE"
|
||||
echo
|
||||
(
|
||||
sourceDIR=$sourceBASE/$gccPACKAGE
|
||||
buildDIR=$buildBASE/$gccPACKAGE
|
||||
PKG_SOURCE="$GCC_SOURCE"
|
||||
PKG_PREFIX="$GCC_PREFIX"
|
||||
PKG_BUILD="$buildBASE/$GCC_PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
cd "$sourceDIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
make distclean 2>/dev/null
|
||||
cd "$PKG_SOURCE" || exit
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
unset configOpt
|
||||
# with/without multi-lib (32-bit support on 64-bit systems)
|
||||
[ -n "$optMultilib" ] && configOpt="--${optMultilib}-multilib"
|
||||
|
||||
set -x
|
||||
$sourceDIR/configure \
|
||||
--prefix=$GCC_ARCH_PATH \
|
||||
--with-pkgversion=OpenFOAM \
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
--with-pkgversion=www.openfoam.com \
|
||||
--enable-languages=c,c++ \
|
||||
--enable-__cxa_atexit \
|
||||
--enable-libstdcxx-allocator=new \
|
||||
@ -388,9 +420,9 @@ else
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $gccPACKAGE"
|
||||
&& echo "Built: $GCC_PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $gccPACKAGE"
|
||||
echo "Error building: $GCC_PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
119
makeGperftools
119
makeGperftools
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2012 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -21,52 +21,59 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Gperftools version from OpenFOAM etc/config.sh file:
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
_foamConfig gperftools
|
||||
|
||||
gperftoolsPACKAGE=${gperftools_version:-gperftools-system}
|
||||
PACKAGE="${gperftools_version:-none}"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions gperf; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [gperftools-VERSION]
|
||||
Usage: ${0##*/} [gperftools-VERSION]
|
||||
options:
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build gperftools
|
||||
$gperftoolsPACKAGE
|
||||
* Build gperftools
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint GPERFTOOLS
|
||||
exit 1
|
||||
showDownloadHint gperftools
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
|
||||
unset optForce
|
||||
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
|
||||
gperftools/* | sources/gperftools* |\
|
||||
gperftools-[0-9]* | gperftools-svn* | gperftools-git)
|
||||
gperftoolsPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -75,55 +82,67 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$gperftoolsPACKAGE" ] || die "The gperftools-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone $gperftoolsPACKAGE
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using gperftools-none (skip ThirdParty build of gperftools)"
|
||||
exit 0
|
||||
elif _foamIsSystem $gperftoolsPACKAGE
|
||||
die "The GPERFTOOLS package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using gperftools-system (skip ThirdParty build of gperftools)"
|
||||
echo "Using none/system (skip ThirdParty build of GPERFTOOLS)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build gperftools
|
||||
#
|
||||
GPERFTOOLS_SOURCE_DIR=$sourceBASE/$gperftoolsPACKAGE
|
||||
GPERFTOOLS_ARCH_PATH=$installBASE/$gperftoolsPACKAGE
|
||||
# *PACKAGE : name-version of the package
|
||||
# *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"
|
||||
|
||||
echo "---------------"
|
||||
if [ -d "$GPERFTOOLS_ARCH_PATH" ]
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -d "$PKG_PREFIX" ]
|
||||
then
|
||||
echo "Already built: $gperftoolsPACKAGE"
|
||||
echo "Already built: $PACKAGE"
|
||||
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
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
[ -e Makefile ] && make distclean 2>/dev/null
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
rm -rf $GPERFTOOLS_ARCH_PATH
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
set -x
|
||||
$GPERFTOOLS_SOURCE_DIR/configure \
|
||||
--prefix=$GPERFTOOLS_ARCH_PATH \
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $gperftoolsPACKAGE" \
|
||||
&& echo "Built: $PACKAGE" \
|
||||
) || {
|
||||
echo "Error building: $gperftoolsPACKAGE"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Unneeded generated files
|
||||
for dir in share/doc share/info share/man
|
||||
do
|
||||
if [ -d "$PKG_PREFIX/$dir" ]
|
||||
then
|
||||
echo "Discard $dir files to save space: $PACKAGE"
|
||||
rm -rf "$PKG_PREFIX/$dir"
|
||||
fi
|
||||
done
|
||||
rmdir "$PKG_PREFIX"/share 2>/dev/null || true
|
||||
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
105
makeHYPRE
105
makeHYPRE
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -20,39 +20,46 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
# Obtain version from etc/config.sh file:
|
||||
_foamConfig hypre
|
||||
|
||||
hyprePACKAGE="${hypre_version:-hypre-system}"
|
||||
PACKAGE="${hypre_version:-none}"
|
||||
targetType=libso
|
||||
|
||||
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||
then
|
||||
unset HYPRE_ARCH_PATH
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions hypre; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [-- configure-options]
|
||||
Usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [-- configure-options]
|
||||
options:
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build HYPRE with
|
||||
${hyprePACKAGE:-'unspecified hypre version'}
|
||||
* Build HYPRE with
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint HYPRE
|
||||
exit 1
|
||||
showDownloadHint hypre
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
@ -64,7 +71,9 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
|
||||
@ -72,8 +81,9 @@ do
|
||||
targetType="$1"
|
||||
;;
|
||||
|
||||
hypre/* | sources/hypre* |\
|
||||
hypre-[0-9]* | hypre-git)
|
||||
hyprePACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
||||
;;
|
||||
*)
|
||||
@ -83,16 +93,12 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$hyprePACKAGE" ] || die "The hypre-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$hyprePACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using hypre-none (skip ThirdParty build of HYPRE)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$hyprePACKAGE"
|
||||
die "The HYPRE package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using hypre-system"
|
||||
echo "Using none/system (skip ThirdParty build of HYPRE)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -100,15 +106,23 @@ fi
|
||||
#
|
||||
# Build HYPRE
|
||||
#
|
||||
# HYPRE_ARCH_PATH : installation directory
|
||||
# HYPRE_SOURCE_DIR : location of the original sources
|
||||
# HYPRE_ARCH_PATH : installation directory (as per config file)
|
||||
#
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
HYPRE_SOURCE_DIR="$sourceBASE/$hyprePACKAGE"
|
||||
: "${HYPRE_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$hyprePACKAGE}"
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
[ -d "$HYPRE_SOURCE_DIR" ] || {
|
||||
echo "Missing sources: '$hyprePACKAGE'"
|
||||
showDownloadHint HYPRE
|
||||
# Override as per config file (if any)
|
||||
[ -n "$HYPRE_ARCH_PATH" ] && PKG_PREFIX="$HYPRE_ARCH_PATH"
|
||||
|
||||
[ -d "$PKG_SOURCE" ] || {
|
||||
echo "Missing sources: '$PACKAGE'"
|
||||
showDownloadHint hypre
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -117,7 +131,7 @@ HYPRE_SOURCE_DIR="$sourceBASE/$hyprePACKAGE"
|
||||
CC="$(whichMpicc)"
|
||||
CXX="$(whichMpicxx)"
|
||||
|
||||
echo "Starting build: $hyprePACKAGE ($targetType)"
|
||||
echo "Starting build: $PACKAGE ($targetType)"
|
||||
echo
|
||||
(
|
||||
# Configuration options
|
||||
@ -130,25 +144,24 @@ echo
|
||||
configOpt="$configOpt $@"
|
||||
fi
|
||||
|
||||
cd "$HYPRE_SOURCE_DIR/src" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
cd "$PKG_SOURCE/src" || exit
|
||||
|
||||
rm -rf "$HYPRE_ARCH_PATH"
|
||||
[ -e Makefile ] && make distclean 2>/dev/null
|
||||
rm -rf "$PKG_PREFIX"
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
set -x && \
|
||||
./configure \
|
||||
--prefix="$HYPRE_ARCH_PATH" \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
--disable-fortran \
|
||||
--enable-shared \
|
||||
$configOpt \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& echo "Built: hypre" \
|
||||
&& make install \
|
||||
&& echo "Installed: hypre"
|
||||
&& echo "Installed: $PACKAGE"
|
||||
) || {
|
||||
echo "Error building: hypre"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
437
makeKAHIP
437
makeKAHIP
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -28,88 +28,122 @@ if [ "$1" = "-test" ]
|
||||
then
|
||||
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
|
||||
dir="${2%/}" # <- *_ARCH_PATH
|
||||
if [ -d "$dir/include" ]
|
||||
then
|
||||
for lib in \
|
||||
$FOAM_EXT_LIBBIN/libkahip$EXT_SO \
|
||||
$dir/lib/libkahip.a \
|
||||
$dir/lib/libkahip$EXT_SO \
|
||||
$dir/lib$WM_COMPILER_LIB_ARCH/libkahip.a \
|
||||
$dir/lib$WM_COMPILER_LIB_ARCH/libkahip$EXT_SO \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo " kahip include: $dir/include"
|
||||
echo " kahip library: ${lib%/*}"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
[ -d "$dir/include" ] || exit 2
|
||||
|
||||
package="kahip"
|
||||
libName="libkahip"
|
||||
for lib in \
|
||||
"$FOAM_EXT_LIBBIN/$libName$EXT_SO" \
|
||||
"$dir/lib/$libName.a" \
|
||||
"$dir/lib/$libName$EXT_SO" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo " $package include: $dir/include"
|
||||
echo " $package library: ${lib%/*}"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
exit 2
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
_foamConfig kahip
|
||||
|
||||
kahipPACKAGE=${KAHIP_VERSION:-kahip-system}
|
||||
PACKAGE="${KAHIP_VERSION:-system}"
|
||||
targetType=libso
|
||||
|
||||
# Hint for cmake findMPI
|
||||
if [ -d "$MPI_ARCH_PATH" ]
|
||||
then
|
||||
export MPI_HOME="$MPI_ARCH_PATH"
|
||||
fi
|
||||
|
||||
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||
then
|
||||
unset KAHIP_ARCH_PATH
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage()
|
||||
{
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions kahip; exit 0; }
|
||||
printHelp() {
|
||||
/bin/cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} [OPTION] [lib|libso] [kahip-VERSION]
|
||||
options:
|
||||
-gcc Force use of gcc/g++
|
||||
-force Force build attempt (mingw)
|
||||
-cmake PATH With cmake from the given path
|
||||
-help
|
||||
-gcc Force use of gcc/g++
|
||||
-force Force build attempt (mingw)
|
||||
-cmake PATH With cmake from the given path
|
||||
-bin Create kahip binaries as well
|
||||
-no-bin Suppress creation of kahip binaries (default)
|
||||
-mpi-home PATH With hint for MPI_HOME
|
||||
-no-mpi Compile without MPI
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* Compile KaHIP
|
||||
$kahipPACKAGE
|
||||
* Build kahip (int32_t only)
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint KAHIP
|
||||
exit 1
|
||||
showDownloadHint kahip
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler minimal # Minimal compiler info for CMake/configure
|
||||
|
||||
unset optForce
|
||||
unset optForce optNoExtlib
|
||||
optBinaries=false
|
||||
optWithMPI=true
|
||||
optLabelSize="${WM_LABEL_SIZE:-32}"
|
||||
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-gcc) useGcc ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGccWmake ;;
|
||||
-force) optForce=true ;;
|
||||
-int32 | -int64) echo "ignoring $1" ;;
|
||||
-bin) optBinaries=true ;;
|
||||
-no-bin) optBinaries=false ;;
|
||||
-no-mpi) optWithMPI=false ;;
|
||||
-no-extlib) optNoExtlib=true ;; # Hidden option (experimental)
|
||||
|
||||
-cmake)
|
||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||
CMAKE_PATH="${2%%/}"
|
||||
shift
|
||||
;;
|
||||
-mpi-home) # mpi with hint
|
||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||
export MPI_HOME="${2%%/}"
|
||||
case "${MPI_HOME:-none}" in (false|none) unset MPI_HOME;; esac
|
||||
shift
|
||||
;;
|
||||
|
||||
lib|libso)
|
||||
targetType="$1"
|
||||
;;
|
||||
|
||||
kahip/* | sources/kahip* | sources/KaHIP* |\
|
||||
kahip-[0-9]* | kahip-git | KaHIP_* | KaHIP-[0-9]*)
|
||||
kahipPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
unset KAHIP_ARCH_PATH # Avoid inconsistency
|
||||
;;
|
||||
*)
|
||||
@ -119,16 +153,12 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$kahipPACKAGE" ] || die "The kahip-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone $kahipPACKAGE
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using kahip-none (skip ThirdParty build of KAHIP)"
|
||||
exit 0
|
||||
elif _foamIsSystem $kahipPACKAGE
|
||||
die "The KAHIP package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using kahip-system"
|
||||
echo "Using none/system (skip ThirdParty build of KAHIP)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -145,65 +175,286 @@ case "$WM_COMPILER" in
|
||||
;;
|
||||
esac
|
||||
|
||||
requireWMakeToolchain
|
||||
requireExtLibBin
|
||||
if [ "$optNoExtlib" = true ]
|
||||
then
|
||||
unset FOAM_EXT_LIBBIN
|
||||
else
|
||||
requireExtLibBin
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build KaHIP
|
||||
#
|
||||
# KAHIP_ARCH_PATH : installation directory
|
||||
# KAHIP_SOURCE_DIR : location of the original sources
|
||||
# KAHIP_ARCH_PATH : installation directory (as per config file)
|
||||
#
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
KAHIP_SOURCE_DIR=$sourceBASE/$kahipPACKAGE
|
||||
KAHIP_ARCH_PATH=$installBASE/$kahipPACKAGE
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
# Future: PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
[ -d "$KAHIP_SOURCE_DIR" ] || {
|
||||
echo "Missing sources: '$kahipPACKAGE'"
|
||||
showDownloadHint KAHIP
|
||||
# Override as per config file (if any)
|
||||
[ -n "$KAHIP_ARCH_PATH" ] && PKG_PREFIX="$KAHIP_ARCH_PATH"
|
||||
|
||||
[ -d "$PKG_SOURCE" ] || {
|
||||
echo "Missing sources: '$PACKAGE'"
|
||||
showDownloadHint kahip
|
||||
exit 2
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# - newer versions use CMake.
|
||||
# - intermediate versions (eg, kahip-2.11) had CMakeLists but didn't install
|
||||
# include/ which means the scons workaround is probably better.
|
||||
# - very old versions only had scons.
|
||||
|
||||
# NB: the flags for 64bit indices in the header seem to be missing.
|
||||
|
||||
unset useWmakeWorkaround
|
||||
if [ -f "$PKG_SOURCE/SConstruct" ]
|
||||
then
|
||||
# Use wmake for old scons builds
|
||||
echo "Using wmake for the build..."
|
||||
useWmakeWorkaround=true
|
||||
requireWMakeToolchain
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Manual installation of serial libraries
|
||||
# from libdir to -> $FOAM_EXT_LIBBIN
|
||||
#
|
||||
install()
|
||||
{
|
||||
local bindir="$PKG_PREFIX"/bin
|
||||
local libdir_source="$1"
|
||||
local libdir_serial="$FOAM_EXT_LIBBIN"
|
||||
local libdir_parallel="$FOAM_EXT_LIBBIN/$FOAM_MPI"
|
||||
local libname_suffix="-int$WM_LABEL_SIZE"
|
||||
|
||||
[ -n "$FOAM_EXT_LIBBIN" ] || unset libdir_serial libdir_parallel
|
||||
[ -n "$WM_LABEL_SIZE" ] || unset libname_suffix
|
||||
|
||||
echo
|
||||
echo "Adjusting installation"
|
||||
|
||||
if [ "$optBinaries" = false ]
|
||||
then
|
||||
echo "Removing binaries: $bindir"
|
||||
rm -rf "$bindir" 2>/dev/null # Failed removal is uncritical
|
||||
fi
|
||||
|
||||
if [ -z "$libdir_source" ]
|
||||
then
|
||||
libdir_source="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||
if [ ! -d "$libdir_source" ]
|
||||
then
|
||||
libdir_source="$PKG_PREFIX/lib"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Before kahip-v3.12 built 'libinterface'. Rename this to 'libkahip'
|
||||
(
|
||||
cd "$libdir_source" || exit
|
||||
libname="libkahip"
|
||||
|
||||
for name in libinterface
|
||||
do
|
||||
if [ -f "$name$EXT_SO" ]
|
||||
then
|
||||
rm -f "$libname$EXT_SO" "$libname$libname_suffix$EXT_SO"
|
||||
mv "$name$EXT_SO" "$libname$EXT_SO"
|
||||
echo "Renamed $name -> $libname"
|
||||
break
|
||||
fi
|
||||
done
|
||||
)
|
||||
|
||||
# Rename lib as xxx-intNN qualified library names (non-windows)
|
||||
if [ -n "$libname_suffix" ] && [ "${EXT_SO:-.dll}" != ".dll" ]
|
||||
then
|
||||
(
|
||||
cd "$libdir_source" || exit
|
||||
echo "Tagging libraries with $libname_suffix"
|
||||
for name in libkahip libparhip_interface
|
||||
do
|
||||
if [ -f "$name$EXT_SO" ]
|
||||
then
|
||||
mv "$name$EXT_SO" "$name$libname_suffix$EXT_SO"
|
||||
ln -sf "$name$libname_suffix$EXT_SO" "$name$EXT_SO"
|
||||
fi
|
||||
done
|
||||
)
|
||||
fi
|
||||
|
||||
local libdir_target
|
||||
|
||||
# Serial
|
||||
libdir_target="$libdir_serial"
|
||||
if [ -n "$libdir_target" ]
|
||||
then
|
||||
# Remove old libraries/links
|
||||
for name in libkahip libkahip_interface libparhip_interface
|
||||
do
|
||||
rm -f "$libdir_target/$name$EXT_SO"
|
||||
rm -f "$libdir_target/$name$libname_suffix$EXT_SO"
|
||||
done
|
||||
mkdir -p "$libdir_target"
|
||||
echo "Relocating serial libraries"
|
||||
|
||||
# echo "Installing: $libdir_target/libkahip$libname_suffix"
|
||||
mv -f "$libdir_source"/libkahip*"$EXT_SO" "$libdir_target" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Parallel
|
||||
libdir_target="$libdir_parallel"
|
||||
if [ -n "$libdir_target" ]
|
||||
then
|
||||
# Remove old libraries/links
|
||||
for name in libkahip libkahip_interface libparhip_interface
|
||||
do
|
||||
rm -f "$libdir_target/$name$EXT_SO"
|
||||
rm -f "$libdir_target/$name$libname_suffix$EXT_SO"
|
||||
done
|
||||
mkdir -p "$libdir_target"
|
||||
echo "Relocating parallel libraries"
|
||||
|
||||
# echo "Installing: $libdir_target/libparhip$libname_suffix"
|
||||
mv -f "$libdir_source"/libparhip*"$EXT_SO" "$libdir_target" 2>/dev/null
|
||||
fi
|
||||
|
||||
rmdir "$libdir_source" 2>/dev/null # Failed rmdir is uncritical
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Manual installation
|
||||
#
|
||||
install()
|
||||
install_wmake()
|
||||
{
|
||||
# Ensure a clean build next time
|
||||
local bindir="$PKG_PREFIX"/bin
|
||||
local incdir="$PKG_PREFIX"/include
|
||||
local libdir_source="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||
local libdir_target="$FOAM_EXT_LIBBIN"
|
||||
local libname_suffix="-int$WM_LABEL_SIZE"
|
||||
|
||||
[ -n "$WM_LABEL_SIZE" ] || unset libname_suffix
|
||||
|
||||
# Leave static libraries in sub-directory
|
||||
if [ "$targetType" = lib ] || [ -z "$FOAM_EXT_LIBBIN" ]
|
||||
then
|
||||
unset libdir_target
|
||||
fi
|
||||
|
||||
# Remove build artifacts from the source directory
|
||||
# (for a clean build next time)
|
||||
wclean
|
||||
|
||||
local bindir=$KAHIP_ARCH_PATH/bin
|
||||
local incdir=$KAHIP_ARCH_PATH/include
|
||||
local libdir=$KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
|
||||
mkdir -m 0755 -p $incdir
|
||||
echo
|
||||
echo "Adjusting installation"
|
||||
echo "Installing headers: $incdir"
|
||||
|
||||
mkdir -m 0755 -p "$incdir"
|
||||
/bin/cp -pv \
|
||||
$KAHIP_SOURCE_DIR/interface/kaHIP_interface.h \
|
||||
$incdir
|
||||
"$PKG_SOURCE"/interface/kaHIP_interface.h \
|
||||
"$incdir"
|
||||
|
||||
# Rename lib as xxx-intNN qualified library names (non-windows)
|
||||
if [ -n "$libname_suffix" ] && [ "${EXT_SO:-.dll}" != ".dll" ]
|
||||
then
|
||||
(
|
||||
cd "$libdir_source" || exit
|
||||
echo "Tagging libraries with $libname_suffix"
|
||||
for name in libkahip libparhip_interface
|
||||
do
|
||||
if [ -f "$name$EXT_SO" ]
|
||||
then
|
||||
mv "$name$EXT_SO" "$name$libname_suffix$EXT_SO"
|
||||
ln -sf "$name$libname_suffix$EXT_SO" "$name$EXT_SO"
|
||||
fi
|
||||
done
|
||||
)
|
||||
fi
|
||||
|
||||
if [ -n "$libdir_target" ]
|
||||
then
|
||||
# Remove old libraries/links
|
||||
for name in libkahip libkahip_interface libparhip_interface
|
||||
do
|
||||
rm -f "$libdir_target/$name$EXT_SO"
|
||||
rm -f "$libdir_target/$name$libname_suffix$EXT_SO"
|
||||
done
|
||||
mkdir -p "$libdir_target"
|
||||
echo "Relocating serial libraries"
|
||||
|
||||
# echo "Installing: $libdir_target/libkahip$libname_suffix"
|
||||
mv -f "$libdir_source"/libkahip*"$EXT_SO" "$libdir_target" 2>/dev/null
|
||||
fi
|
||||
|
||||
rmdir "$libdir_source" 2>/dev/null # Failed rmdir is uncritical
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Newer KAHIP (>= 2.11) uses CMake,
|
||||
# but unfortunately does not install include/
|
||||
# nor pass through flags for 64bit indices in the header.
|
||||
withCmake=true
|
||||
version=$(echo "$kahipPACKAGE" | sed -e 's/^kahip[-_]*//i')
|
||||
case "$version" in 2.0*) unset withCmake;; esac
|
||||
|
||||
if true
|
||||
if [ "${useWmakeWorkaround:-false}" = false ]
|
||||
then
|
||||
(
|
||||
echo "Starting build: $kahipPACKAGE ($targetType) using wmake"
|
||||
echo "Starting build: $PACKAGE using cmake"
|
||||
echo
|
||||
|
||||
cd "$KAHIP_SOURCE_DIR/lib" || exit
|
||||
export GIT_DIR="$KAHIP_SOURCE_DIR/.git" # Mask seeing our own git-repo
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
cd "$PKG_SOURCE" || exit
|
||||
|
||||
rm -rf "$KAHIP_ARCH_PATH"
|
||||
rm -f "$FOAM_EXT_LIBBIN/libkahip$EXT_SO"
|
||||
# Remove any existing build folder and recreate
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
libdir=$KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
unset buildOpt
|
||||
if [ "$optWithMPI" = false ]
|
||||
then
|
||||
buildOpt="${buildOpt} -DPARHIP=OFF"
|
||||
fi
|
||||
|
||||
cmake=$(findCMake)
|
||||
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
${cmake:?} \
|
||||
-B "$PKG_BUILD" \
|
||||
-S "$PKG_SOURCE" \
|
||||
-DCMAKE_INSTALL_PREFIX="$PKG_PREFIX" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
$buildOpt \
|
||||
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& install \
|
||||
&& echo "Built: $PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
elif true
|
||||
then
|
||||
(
|
||||
echo "Starting build: $PACKAGE ($targetType) using wmake"
|
||||
echo
|
||||
|
||||
cd "$PKG_SOURCE/lib" || exit
|
||||
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -f "$FOAM_EXT_LIBBIN/libkahip"*
|
||||
|
||||
export KAHIP_LIB_DIR="$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH"
|
||||
mkdir -m 0755 -p "$KAHIP_LIB_DIR" 2>/dev/null
|
||||
|
||||
cpMakeFiles kahip 2>/dev/null
|
||||
|
||||
@ -212,21 +463,11 @@ then
|
||||
ln -s ../interface interface
|
||||
fi
|
||||
|
||||
# Place static libraries in sub-directory:
|
||||
if [ "$targetType" = lib ]
|
||||
then
|
||||
mkdir -m 0755 -p $libdir 2>/dev/null
|
||||
export FOAM_EXT_LIBBIN=$libdir
|
||||
fi
|
||||
|
||||
# Location of lib sources for wmake
|
||||
export KAHIP_LIB_SRC=$PWD
|
||||
|
||||
wmake -j $WM_NCOMPPROCS -s $targetType \
|
||||
&& echo "Built: kahip" \
|
||||
&& install
|
||||
&& echo "Built: $PACKAGE" \
|
||||
&& install_wmake
|
||||
) || {
|
||||
echo "Error building: kahip"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
135
makeLLVM
135
makeLLVM
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -39,14 +39,16 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
[ "${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:
|
||||
_foamConfig compiler
|
||||
|
||||
llvmPACKAGE=$clang_version
|
||||
PACKAGE="$clang_version"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions llvm; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [llvm-VERSION]
|
||||
Usage: ${0##*/} [OPTION] [llvm-VERSION]
|
||||
options:
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH with cmake from the given path
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build llvm/clang
|
||||
${llvmPACKAGE:-'unspecified LLVM version'}
|
||||
* Build llvm/clang
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint LLVM
|
||||
exit 1
|
||||
showDownloadHint llvm
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
@ -84,7 +86,8 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
|
||||
-cmake)
|
||||
@ -92,11 +95,13 @@ do
|
||||
CMAKE_PATH="${2%%/}"
|
||||
shift
|
||||
;;
|
||||
|
||||
llvm/* | sources/llvm* |\
|
||||
llvm-[0-9]* | llvm-svn*)
|
||||
llvmPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
[0-9]*)
|
||||
llvmPACKAGE="llvm-${1%%/}"
|
||||
PACKAGE="llvm-${1%%/}"
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -105,97 +110,97 @@ do
|
||||
shift
|
||||
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
|
||||
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
|
||||
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
# !Build/install locations with arch name only (NO compiler name)!
|
||||
buildBASE="$(dirname "$buildBASE")/$WM_ARCH$WM_COMPILER_ARCH"
|
||||
installBASE="$(dirname "$installBASE")/$WM_ARCH$WM_COMPILER_ARCH"
|
||||
|
||||
# Build LLVM (clang)
|
||||
# LLVM_SOURCE_DIR : location of the original sources
|
||||
# LLVM_BUILD_DIR : location of the build
|
||||
# LLVM_ARCH_PATH : location of the installed program
|
||||
# - Strip any trailing '.src' from the proper names
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCEDIR : location of original sources
|
||||
# *PREFIXDIR : installation directory
|
||||
# Note: strip trailing '.src' from package name
|
||||
|
||||
LLVM_SOURCE_DIR=$sourceBASE/$llvmPACKAGE
|
||||
LLVM_BUILD_DIR=$buildBASE/${llvmPACKAGE%%.src}
|
||||
LLVM_ARCH_PATH=$installBASE/${llvmPACKAGE%%.src}
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE" .src)" # Strip of trailing .src
|
||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git" # Avoid seeing our own git-repo
|
||||
|
||||
#
|
||||
# Build LLVM
|
||||
#
|
||||
|
||||
# Building...
|
||||
echo "---------------"
|
||||
if [ -d $LLVM_ARCH_PATH ]
|
||||
if [ -d "$PKG_PREFIX" ]
|
||||
then
|
||||
echo "Already built: $llvmPACKAGE"
|
||||
elif [ -z "$CMAKE_PATH" ] && $LLVM_SOURCE_DIR/configure -help >/dev/null 2>&1
|
||||
echo "Already built: $PACKAGE"
|
||||
elif [ -z "$CMAKE_PATH" ] && "$PKG_SOURCE"/configure -help >/dev/null 2>&1
|
||||
then
|
||||
# configure can be used prior to 3.9.0
|
||||
# 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
|
||||
(
|
||||
cd "$LLVM_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
make distclean 2>/dev/null
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
cd "$PKG_SOURCE" || exit
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
rm -rf $LLVM_BUILD_DIR
|
||||
mkdir -p $LLVM_BUILD_DIR
|
||||
cd $LLVM_BUILD_DIR
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
set -x
|
||||
$LLVM_SOURCE_DIR/configure \
|
||||
--prefix=$LLVM_ARCH_PATH \
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
--with-gcc-toolchain="$(command -v gcc | sed 's%/bin/gcc%%')" \
|
||||
--enable-optimized \
|
||||
--enable-shared \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $llvmPACKAGE"
|
||||
&& echo "Built: $PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $llvmPACKAGE"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
else
|
||||
# CMake used with 3.9.0 and later
|
||||
|
||||
echo "Starting build: $llvmPACKAGE (using cmake)"
|
||||
echo "Starting build: $PACKAGE (using cmake)"
|
||||
echo
|
||||
(
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
cd "$PKG_SOURCE" || exit
|
||||
|
||||
# Configuration options:
|
||||
unset configOpt
|
||||
|
||||
cd "$LLVM_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
|
||||
if [ -f tools/openmp/CMakeLists.txt ]
|
||||
then
|
||||
configOpt="$configOpt -DLLVM_TOOL_OPENMP_BUILD=ON"
|
||||
fi
|
||||
|
||||
rm -rf $LLVM_BUILD_DIR
|
||||
mkdir -p $LLVM_BUILD_DIR
|
||||
cd $LLVM_BUILD_DIR
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
cmake=$(findCMake)
|
||||
|
||||
set -x
|
||||
$cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=$LLVM_ARCH_PATH \
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
${cmake:?} \
|
||||
-DCMAKE_INSTALL_PREFIX="$PKG_PREFIX" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
$configOpt \
|
||||
$LLVM_SOURCE_DIR \
|
||||
"$PKG_SOURCE" \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $llvmPACKAGE"
|
||||
&& echo "Built: $PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $llvmPACKAGE"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
226
makeMETIS
226
makeMETIS
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -28,76 +28,102 @@ if [ "$1" = "-test" ]
|
||||
then
|
||||
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
|
||||
dir="${2%/}" # <- *_ARCH_PATH
|
||||
if [ -d "$dir/include" ]
|
||||
then
|
||||
for lib in \
|
||||
$FOAM_EXT_LIBBIN/libmetis$EXT_SO \
|
||||
$dir/lib/libmetis.a \
|
||||
$dir/lib/libmetis$EXT_SO \
|
||||
$dir/lib$WM_COMPILER_LIB_ARCH/libmetis.a \
|
||||
$dir/lib$WM_COMPILER_LIB_ARCH/libmetis$EXT_SO \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo " metis include: $dir/include"
|
||||
echo " metis library: ${lib%/*}"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
[ -d "$dir/include" ] || exit 2
|
||||
|
||||
package="metis"
|
||||
libName="libmetis"
|
||||
for lib in \
|
||||
"$FOAM_EXT_LIBBIN/$libName$EXT_SO" \
|
||||
"$dir/lib/$libName.a" \
|
||||
"$dir/lib/$libName$EXT_SO" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo " $package include: $dir/include"
|
||||
echo " $package library: ${lib%/*}"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
exit 2
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
_foamConfig metis
|
||||
|
||||
metisPACKAGE=${METIS_VERSION:-metis-system}
|
||||
PACKAGE="${METIS_VERSION:-system}"
|
||||
targetType=libso
|
||||
|
||||
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||
then
|
||||
unset METIS_ARCH_PATH
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
printVersions() { listPackageVersions metis; exit 0; }
|
||||
printHelp() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [lib|libso] [METIS-VERSION]
|
||||
Usage: ${0##*/} [OPTION] [lib|libso] [METIS-VERSION]
|
||||
options:
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
-int32 Use IDXTYPEWIDTH 32
|
||||
-int64 Use IDXTYPEWIDTH 64
|
||||
-bin Create metis binaries as well
|
||||
-no-bin Suppress creation of metis binaries (default)
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build METIS with
|
||||
${metisPACKAGE:-'unspecified metis version'}
|
||||
* Build METIS (default: -int${WM_LABEL_SIZE:-32}) with
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint METIS
|
||||
exit 1
|
||||
showDownloadHint metis
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
|
||||
unset optForce optNoExtlib
|
||||
optBinaries=false
|
||||
optLabelSize="${WM_LABEL_SIZE:-32}"
|
||||
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) echo "ignoring $1" ;;
|
||||
-int32 | -int64) optLabelSize="${1#-int}" ;;
|
||||
-bin) optBinaries=true ;;
|
||||
-no-bin) optBinaries=false ;;
|
||||
-no-extlib) optNoExtlib=true ;; # Hidden option (experimental)
|
||||
|
||||
lib|libso)
|
||||
targetType="$1"
|
||||
;;
|
||||
|
||||
metis/* | sources/metis* | \
|
||||
metis-[0-9]*)
|
||||
metisPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
unset METIS_ARCH_PATH # Avoid inconsistency
|
||||
;;
|
||||
*)
|
||||
@ -107,34 +133,53 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$metisPACKAGE" ] || die "The metis-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone $metisPACKAGE
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using metis-none (skip ThirdParty build of METIS)"
|
||||
exit 0
|
||||
elif _foamIsSystem $metisPACKAGE
|
||||
die "The METIS package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using metis-system"
|
||||
echo "Using none/system (skip ThirdParty build of METIS)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
requireExtLibBin
|
||||
# Known build issues for mingw (various things)
|
||||
case "$WM_COMPILER" in
|
||||
(Mingw*)
|
||||
if :
|
||||
then
|
||||
echo "Skipping metis - known compilation issues with $WM_COMPILER"
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$optNoExtlib" = true ]
|
||||
then
|
||||
unset FOAM_EXT_LIBBIN
|
||||
else
|
||||
requireExtLibBin
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build METIS
|
||||
# METIS_ARCH_PATH : installation directory (as per config file)
|
||||
#
|
||||
# METIS_ARCH_PATH : installation directory
|
||||
# METIS_SOURCE_DIR : location of the original sources
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
METIS_SOURCE_DIR=$sourceBASE/$metisPACKAGE
|
||||
: "${METIS_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$metisPACKAGE}"
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
[ -d "$METIS_SOURCE_DIR" ] || {
|
||||
echo "Missing sources: '$metisPACKAGE'"
|
||||
showDownloadHint METIS
|
||||
# Override as per config file (if any)
|
||||
[ -n "$METIS_ARCH_PATH" ] && PKG_PREFIX="$METIS_ARCH_PATH"
|
||||
|
||||
[ -d "$PKG_SOURCE" ] || {
|
||||
echo "Missing sources: '$PACKAGE'"
|
||||
showDownloadHint metis
|
||||
exit 2
|
||||
}
|
||||
|
||||
@ -143,19 +188,70 @@ METIS_SOURCE_DIR=$sourceBASE/$metisPACKAGE
|
||||
#
|
||||
install()
|
||||
{
|
||||
local libdir=$METIS_ARCH_PATH/lib
|
||||
local bindir="$PKG_PREFIX"/bin
|
||||
local libdir="$PKG_PREFIX"/lib
|
||||
local libdir_target="$FOAM_EXT_LIBBIN"
|
||||
local libname_suffix="-int$WM_LABEL_SIZE"
|
||||
|
||||
[ -n "$FOAM_EXT_LIBBIN" ] || unset libdir_target
|
||||
[ -n "$WM_LABEL_SIZE" ] || unset libname_suffix
|
||||
|
||||
echo
|
||||
echo "Adjusting installation"
|
||||
|
||||
if [ "$optBinaries" = false ]
|
||||
then
|
||||
echo "Removing binaries: $bindir"
|
||||
rm -rf "$bindir" 2>/dev/null # Failed removal is uncritical
|
||||
fi
|
||||
|
||||
if [ "$targetType" = libso ]
|
||||
then
|
||||
\mv $libdir/libmetis$EXT_SO $FOAM_EXT_LIBBIN
|
||||
rmdir $libdir 2>/dev/null # Failed rmdir is uncritical
|
||||
# Rename lib as xxx-intNN qualified library names (non-windows)
|
||||
if [ -n "$libname_suffix" ] && [ "${EXT_SO:-.dll}" != ".dll" ]
|
||||
then
|
||||
(
|
||||
cd "$libdir" || exit
|
||||
echo "Tagging libraries with $libname_suffix"
|
||||
for name in libmetis
|
||||
do
|
||||
if [ -f "$name$EXT_SO" ]
|
||||
then
|
||||
mv "$name$EXT_SO" "$name$libname_suffix$EXT_SO"
|
||||
ln -sf "$name$libname_suffix$EXT_SO" "$name$EXT_SO"
|
||||
fi
|
||||
done
|
||||
)
|
||||
fi
|
||||
|
||||
echo "Installing: $FOAM_EXT_LIBBIN/libmetis$EXT_SO"
|
||||
if [ -n "$libdir_target" ]
|
||||
then
|
||||
# Remove old libraries and links
|
||||
for name in libmetis
|
||||
do
|
||||
rm -f "$libdir_target/$name$EXT_SO"
|
||||
rm -f "$libdir_target/$name$libname_suffix$EXT_SO"
|
||||
done
|
||||
mkdir -p "$libdir_target"
|
||||
echo "Relocating serial libraries"
|
||||
|
||||
# echo "Installing: $libdir_target/libmetis"
|
||||
mv -f "$libdir"/libmetis* "$libdir_target"
|
||||
fi
|
||||
fi
|
||||
|
||||
rmdir "$libdir" 2>/dev/null # Failed rmdir is uncritical
|
||||
return 0
|
||||
}
|
||||
|
||||
echo "Starting build: $metisPACKAGE ($targetType)"
|
||||
|
||||
echo "Starting build: $PACKAGE ($targetType)"
|
||||
if [ "$optLabelSize" != "$WM_LABEL_SIZE" ]
|
||||
then
|
||||
echo "Using int-$optLabelSize instead of int-$WM_LABEL_SIZE"
|
||||
fi
|
||||
export WM_LABEL_SIZE="$optLabelSize"
|
||||
|
||||
echo
|
||||
(
|
||||
# Configuration options:
|
||||
@ -165,20 +261,18 @@ echo
|
||||
configOpt="shared=1"
|
||||
fi
|
||||
|
||||
cd "$METIS_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
cd "$PKG_SOURCE" || exit
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -f "$FOAM_EXT_LIBBIN"/libmetis*
|
||||
|
||||
rm -rf $METIS_ARCH_PATH
|
||||
rm -f $FOAM_EXT_LIBBIN/libmetis$EXT_SO
|
||||
|
||||
# Adjust metis integer size to match OpenFOAM label-size
|
||||
sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '$WM_LABEL_SIZE'=' \
|
||||
# Adjust metis IDXTYPEWIDTH (integer size)
|
||||
sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '"$optLabelSize"'=' \
|
||||
include/metis.h
|
||||
|
||||
# No config option for the library location.
|
||||
# - build normally and use mv to relocate it
|
||||
|
||||
make config $configOpt prefix=$METIS_ARCH_PATH \
|
||||
make config $configOpt prefix="$PKG_PREFIX" \
|
||||
&& make -j $WM_NCOMPPROCS install \
|
||||
&& echo "Built: metis" \
|
||||
&& install
|
||||
|
||||
122
makeMGridGen
122
makeMGridGen
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -20,40 +20,40 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from ThirdParty directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
|
||||
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
|
||||
echo " The environment variables are inconsistent with the installation."
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# mgridgen version from OpenFOAM etc/config.sh file:
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
_foamConfig mgridgen
|
||||
|
||||
mgridgenPACKAGE=${MGRIDGEN_VERSION:-mgridgen-none}
|
||||
PACKAGE="${MGRIDGEN_VERSION:-none}"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions mgridgen parmgridgen; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [mgridgen-VERSION]
|
||||
Usage: ${0##*/} [OPTION] [mgridgen-VERSION]
|
||||
options:
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* Build MGridGen
|
||||
$mgridgenPACKAGE
|
||||
* Build MGridGen with
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
# showDownloadHint GRIDGEN
|
||||
exit 1
|
||||
# showDownloadHint gridgen
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
@ -65,12 +65,15 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
|
||||
mgridgen-[0-9]* | MGridGen-[0-9]* | parmgridgen-[0-9]* | ParMGridGen-[0-9]*)
|
||||
mgridgenPACKAGE="${1%%/}"
|
||||
mgridgen/* | sources/*gridgen* | sources/*GridGen* | \
|
||||
mgridgen-[0-9]* | MGridGen-[0-9]* | \
|
||||
parmgridgen-[0-9]* | ParMGridGen-[0-9]*)
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -79,34 +82,32 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$mgridgenPACKAGE" ] || die "The mgridgen-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$mgridgenPACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using mgridgen-none (skip ThirdParty build of MGridGen)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$mgridgenPACKAGE"
|
||||
die "The MGRIDGEN package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using mgridgen-system"
|
||||
echo "Using none/system (skip ThirdParty build of MGRIDGEN)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build MGridGen
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
# MGRIDGEN_SOURCE_DIR : location of the original sources
|
||||
# MGRIDGEN_ARCH_PATH : installation directory
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
MGRIDGEN_SOURCE_DIR=$WM_THIRD_PARTY_DIR/$mgridgenPACKAGE
|
||||
MGRIDGEN_ARCH_PATH="$installBASE$WM_SIZE_OPTIONS/$mgridgenPACKAGE"
|
||||
|
||||
: ${FOAM_MPI:=dummy}
|
||||
: "${FOAM_MPI:=dummy}"
|
||||
|
||||
echo
|
||||
echo ========================================
|
||||
echo "Build mgridgen library $mgridgenPACKAGE"
|
||||
echo "Build mgridgen library $PACKAGE"
|
||||
echo
|
||||
|
||||
#
|
||||
@ -114,23 +115,23 @@ echo
|
||||
#
|
||||
install()
|
||||
{
|
||||
echo "Install into $MGRIDGEN_ARCH_PATH"
|
||||
echo "Install into $PKG_PREFIX"
|
||||
|
||||
local bindir=$MGRIDGEN_ARCH_PATH/bin
|
||||
local incdir=$MGRIDGEN_ARCH_PATH/include
|
||||
local libdir=$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
|
||||
local bindir="$PKG_PREFIX"/bin
|
||||
local incdir="$PKG_PREFIX"/include
|
||||
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
|
||||
mkdir -m 0755 -p $dir
|
||||
mkdir -m 0755 -p "$dir"
|
||||
done
|
||||
|
||||
cp -vf mgridgen.h $incdir
|
||||
cp -vf libmgrid.a $libdir
|
||||
cp -vf mgridgen $bindir
|
||||
cp -vf mgridgen.h "$incdir"
|
||||
cp -vf libmgrid.a "$libdir"
|
||||
cp -vf mgridgen "$bindir"
|
||||
|
||||
chmod -R 0644 $incdir/* $libdir/*
|
||||
chmod -R 0755 $bindir/*
|
||||
chmod -R 0644 "$incdir"/* "$libdir"/*
|
||||
chmod -R 0755 "$bindir"/*
|
||||
}
|
||||
|
||||
|
||||
@ -138,19 +139,20 @@ install()
|
||||
# - for shared library
|
||||
# - for mpi-specific library locations
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -f "$MGRIDGEN_ARCH_PATH/include/mgridgen.h" \
|
||||
&& [ -r "$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmgrid.a" ]
|
||||
&& [ -f "$PKG_PREFIX/include/mgridgen.h" ] \
|
||||
&& {
|
||||
[ -r "$PKG_PREFIX/lib/libmgrid.a" ] \
|
||||
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmgrid.a" ]
|
||||
}
|
||||
then
|
||||
echo " MGridGen header in $MGRIDGEN_ARCH_PATH/include"
|
||||
echo " MGridGen libs in $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static
|
||||
echo
|
||||
echo " MGridGen already built : $PKG_PREFIX"
|
||||
else
|
||||
(
|
||||
cd "$MGRIDGEN_SOURCE_DIR" || exit
|
||||
cd "$PKG_SOURCE" || exit
|
||||
[ -e Makefile ] && make realclean 2>/dev/null
|
||||
|
||||
# Remove any existing build folder and recreate
|
||||
rm -rf $MGRIDGEN_ARCH_PATH
|
||||
rm -rf "$PKG_PREFIX"
|
||||
|
||||
serial="$(whichCC)" # CC (serial compiler) default=gcc
|
||||
# parallel=$(whichMpicc) # PARCC (parallel compiler) default=mpicc
|
||||
@ -168,9 +170,9 @@ else
|
||||
make=make \
|
||||
serial \
|
||||
&& install \
|
||||
&& echo "Built: $mgridgenPACKAGE"
|
||||
&& echo "Built: $PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $mgridgenPACKAGE"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
173
makeMPICH
173
makeMPICH
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -28,60 +28,65 @@ if [ "$1" = "-test" ]
|
||||
then
|
||||
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
|
||||
dir="${2%/}" # <- *_ARCH_PATH
|
||||
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
then
|
||||
echo "Have mpich shared library (${dir##*/})"
|
||||
exit 0
|
||||
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
then
|
||||
echo "Have mpich static library (${dir##*/})"
|
||||
exit 0
|
||||
else
|
||||
echo "No mpich libraries found: ${dir:-not-specified}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
package="mpich"
|
||||
libName="libmpi"
|
||||
for lib in \
|
||||
"$dir/lib/$libName.a" \
|
||||
"$dir/lib/$libName$EXT_SO" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo "Have $package shared library (${dir##*/})"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo "No $package libraries found: ${dir:-not-specified}"
|
||||
exit 2
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
# Transition
|
||||
# ~~~~~~~~~~
|
||||
_foamAddLib() { true; }
|
||||
_foamAddMan() { true; }
|
||||
_foamAddPath() { true; }
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
WM_MPLIB=MPICH # Ensure we get the correct MPI
|
||||
|
||||
# mpich version from OpenFOAM etc/config.sh file:
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
WM_MPLIB=MPICH # Ensure we get the correct MPI
|
||||
_foamConfig mpi
|
||||
|
||||
mpiPACKAGE=${FOAM_MPI:-mpich-system}
|
||||
PACKAGE="${FOAM_MPI:-system}"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions mpich; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [mpich-VERSION] [-- configure-options]
|
||||
Usage: ${0##*/} [OPTION] [mpich-VERSION] [-- configure-options]
|
||||
options:
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build mpich with
|
||||
${mpiPACKAGE:-'unspecified mpich version'}
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint MPICH
|
||||
exit 1
|
||||
showDownloadHint mpich
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
@ -94,12 +99,14 @@ do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
|
||||
mpich/* | sources/mpich* | \
|
||||
mpich*)
|
||||
mpiPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
|
||||
*)
|
||||
@ -109,39 +116,43 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$mpiPACKAGE" ] || die "The mpich-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$mpiPACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using mpich-none (skip ThirdParty build of mpich)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$mpiPACKAGE"
|
||||
die "The MPICH package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using mpich-system (skip ThirdParty build of mpich)"
|
||||
echo "Using none/system (skip ThirdParty build of MPICH)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build mpich
|
||||
#
|
||||
# MPI_SOURCE_DIR : location of the original sources
|
||||
# MPI_ARCH_PATH : installation directory
|
||||
# Build MPICH
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
|
||||
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
&& {
|
||||
[ -r "$PKG_PREFIX/lib/libmpi$EXT_SO" ] \
|
||||
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
}
|
||||
then
|
||||
echo "Already has shared library"
|
||||
echo "Already has shared library: $PKG_PREFIX"
|
||||
elif [ -z "$optForce" ] \
|
||||
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
&& {
|
||||
[ -r "$PKG_PREFIX/lib/libmpi.a" ] \
|
||||
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
}
|
||||
then
|
||||
echo "Already has static library"
|
||||
echo "Already has static library: $PKG_PREFIX"
|
||||
else
|
||||
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
|
||||
echo "Starting build: $WM_MPLIB ($PACKAGE)"
|
||||
echo
|
||||
|
||||
(
|
||||
@ -158,33 +169,51 @@ else
|
||||
# End of configuration options
|
||||
# ----------------------------
|
||||
|
||||
buildDIR=$buildBASE/$mpiPACKAGE
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
|
||||
cd "$MPI_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
[ -e Makefile ] && make distclean 2>/dev/null
|
||||
cd "$PKG_SOURCE" || exit
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
rm -rf $MPI_ARCH_PATH
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
set -x
|
||||
$MPI_SOURCE_DIR/configure \
|
||||
--prefix=$MPI_ARCH_PATH \
|
||||
# reproducible build naming
|
||||
local_destdir="$(dirname $PKG_PREFIX)"
|
||||
local_prefix="/$(basename $local_destdir)/$(basename $PKG_PREFIX)"
|
||||
local_destdir="$(dirname $local_destdir)"
|
||||
|
||||
echo
|
||||
echo "configured prefix: $local_prefix"
|
||||
echo "install directory: $local_destdir"
|
||||
echo
|
||||
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure \
|
||||
--prefix="$local_prefix" \
|
||||
--disable-fortran --disable-g \
|
||||
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
||||
--enable-shared --disable-static \
|
||||
$configOpt \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $mpiPACKAGE" \
|
||||
&& pkgconfigAdjust $MPI_ARCH_PATH
|
||||
&& make install DESTDIR="$local_destdir" \
|
||||
&& echo "Built: $PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $mpiPACKAGE"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Unneeded generated files
|
||||
for dir in share/doc share/info share/man
|
||||
do
|
||||
if [ -d "$PKG_PREFIX/$dir" ]
|
||||
then
|
||||
echo "Discard $dir files to save space: $PACKAGE"
|
||||
rm -rf "$PKG_PREFIX/$dir"
|
||||
fi
|
||||
done
|
||||
rmdir "$PKG_PREFIX"/share 2>/dev/null || true
|
||||
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
150
makeMVAPICH
150
makeMVAPICH
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -28,64 +28,69 @@ if [ "$1" = "-test" ]
|
||||
then
|
||||
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
|
||||
dir="${2%/}" # <- *_ARCH_PATH
|
||||
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
then
|
||||
echo "Have mpich shared library (${dir##*/})"
|
||||
exit 0
|
||||
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
then
|
||||
echo "Have mpich static library (${dir##*/})"
|
||||
exit 0
|
||||
else
|
||||
echo "No mpich libraries found: ${dir:-not-specified}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
package="mvapich"
|
||||
libName="libmpi"
|
||||
for lib in \
|
||||
"$dir/lib/$libName.a" \
|
||||
"$dir/lib/$libName$EXT_SO" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo "Have $package library (${dir##*/})"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo "No $package libraries found: ${dir:-not-specified}"
|
||||
exit 2
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
# Transition
|
||||
# ~~~~~~~~~~
|
||||
_foamAddLib() { true; }
|
||||
_foamAddMan() { true; }
|
||||
_foamAddPath() { true; }
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
WM_MPLIB=MV2MPI # Ensure we get the correct MPI
|
||||
|
||||
# mvapich2 version from OpenFOAM etc/config.sh file:
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
WM_MPLIB=MVA2MPI # Ensure we get the correct MPI
|
||||
_foamConfig mpi
|
||||
|
||||
mpiPACKAGE=${FOAM_MPI:-mvapich2-system}
|
||||
PACKAGE="${FOAM_MPI:-system}"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions mvapich; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [mvapich2-VERSION] [-- configure-options]
|
||||
Usage: ${0##*/} [OPTION] [mvapich2-VERSION] [-- configure-options]
|
||||
options:
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build mvapich2 with
|
||||
${mpiPACKAGE:-'unspecified mpich version'}
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
The additional configure-options could include, for example,
|
||||
|
||||
${0##*/} -- --disable-mcast
|
||||
|
||||
USAGE
|
||||
showDownloadHint MVAPICH
|
||||
exit 1
|
||||
showDownloadHint mvapich
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
@ -98,12 +103,14 @@ do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
|
||||
mvapich/* | sources/mvapich* | \
|
||||
mvapich*)
|
||||
mpiPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
|
||||
*)
|
||||
@ -113,39 +120,43 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$mpiPACKAGE" ] || die "The mvapich-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$mpiPACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using mvapich-none (skip ThirdParty build of mvapich)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$mpiPACKAGE"
|
||||
die "The MVAPICH package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using mvapich-system (skip ThirdParty build of mvapich)"
|
||||
echo "Using none/system (skip ThirdParty build of MVAPICH)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build mvapich
|
||||
#
|
||||
# MPI_SOURCE_DIR : location of the original sources
|
||||
# MPI_ARCH_PATH : installation directory
|
||||
# Build MVAPICH
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
|
||||
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
&& {
|
||||
[ -r "$PKG_PREFIX/lib/libmpi$EXT_SO" ] \
|
||||
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
}
|
||||
then
|
||||
echo "Already has shared library"
|
||||
echo "Already has shared library: $PKG_PREFIX"
|
||||
elif [ -z "$optForce" ] \
|
||||
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
&& {
|
||||
[ -r "$PKG_PREFIX/lib/libmpi.a" ] \
|
||||
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
}
|
||||
then
|
||||
echo "Already has static library"
|
||||
echo "Already has static library: $PKG_PREFIX"
|
||||
else
|
||||
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
|
||||
echo "Starting build: $WM_MPLIB ($PACKAGE)"
|
||||
echo
|
||||
|
||||
(
|
||||
@ -162,31 +173,28 @@ else
|
||||
# End of configuration options
|
||||
# ----------------------------
|
||||
|
||||
buildDIR=$buildBASE/$mpiPACKAGE
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
|
||||
cd "$MPI_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
[ -e Makefile ] && make distclean 2>/dev/null
|
||||
cd "$PKG_SOURCE" || exit
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
rm -rf $MPI_ARCH_PATH
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
set -x
|
||||
$MPI_SOURCE_DIR/configure \
|
||||
--prefix=$MPI_ARCH_PATH \
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
--disable-fortran --disable-g \
|
||||
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
||||
--enable-shared --disable-static \
|
||||
$configOpt \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $mpiPACKAGE" \
|
||||
&& pkgconfigAdjust $MPI_ARCH_PATH
|
||||
&& echo "Built: $PACKAGE" \
|
||||
&& pkgconfigAdjust "$PKG_PREFIX"
|
||||
) || {
|
||||
echo "Error building: $mpiPACKAGE"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
225
makeMesa
225
makeMesa
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -15,7 +15,7 @@
|
||||
# makeMesa
|
||||
#
|
||||
# Description
|
||||
# Build script for Mesa
|
||||
# Build script for MESA
|
||||
#
|
||||
# Note
|
||||
# Building with mesa-12.x.x fails to create an include/GL directory and
|
||||
@ -23,44 +23,52 @@
|
||||
#
|
||||
# Building with mesa-11.x, mesa-13.x and mesa-17.x seems to be okay.
|
||||
#
|
||||
# Known dependencies (likely incomplete)
|
||||
#
|
||||
# openSUSE 15.2:
|
||||
#
|
||||
# dri2proto-devel
|
||||
# glproto-devel
|
||||
# libxshmfence-devel
|
||||
#
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
unset vtk_version mesa_version mesa_llvm # Purge current values
|
||||
|
||||
# mesa version from OpenFOAM etc/config.sh file:
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
unset vtk_version mesa_version mesa_llvm # Purge current values
|
||||
_foamConfig vtk
|
||||
|
||||
mesaPACKAGE=$mesa_version
|
||||
PACKAGE="$mesa_version"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions mesa; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] mesa-VERSION [-- configure-options]
|
||||
Usage: ${0##*/} [OPTION] mesa-VERSION [-- configure-options]
|
||||
options:
|
||||
-gcc Force use of gcc/g++
|
||||
-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
|
||||
${mesaPACKAGE:-'unspecified MESA version'}
|
||||
* build MESA with
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint MESA
|
||||
exit 1
|
||||
showDownloadHint mesa
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
@ -93,7 +101,8 @@ do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc)
|
||||
useGcc
|
||||
unset withLLVM
|
||||
@ -106,8 +115,10 @@ do
|
||||
llvm-*)
|
||||
withLLVM="$1"
|
||||
;;
|
||||
|
||||
mesa/* | sources/mesa* |\
|
||||
mesa-*)
|
||||
mesaPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -116,22 +127,23 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$mesaPACKAGE" ] || die "The mesa-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$mesaPACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using mesa-none (skip ThirdParty build of MESA)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$mesaPACKAGE"
|
||||
die "The MESA package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using mesa-system (skip ThirdParty build of MESA)"
|
||||
echo "Using none/system (skip ThirdParty build of MESA)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Locate third-party clang as required
|
||||
case "$withLLVM" in
|
||||
('' | none | false)
|
||||
withLLVM=none
|
||||
echo "Without llvm"
|
||||
;;
|
||||
|
||||
(true | system)
|
||||
LLVM_ARCH_PATH="$(command -v clang)" || {
|
||||
echo "Error: could not properly locate llvm/clang"
|
||||
@ -141,51 +153,61 @@ case "$withLLVM" in
|
||||
# Root installation directory
|
||||
LLVM_ARCH_PATH="${LLVM_ARCH_PATH%/bin/clang}"
|
||||
|
||||
[ -d "$LLVM_ARCH_PATH" ] || {
|
||||
if [ -d "$LLVM_ARCH_PATH" ]
|
||||
then
|
||||
# Add to path (for llvm-config)
|
||||
PATH="$LLVM_ARCH_PATH/bin:$PATH"
|
||||
else
|
||||
echo "Error: could not properly locate llvm/clang"
|
||||
exit 2
|
||||
}
|
||||
;;
|
||||
|
||||
('' | none | false)
|
||||
withLLVM=none
|
||||
echo "No llvm"
|
||||
fi
|
||||
;;
|
||||
|
||||
(llvm-*)
|
||||
echo "check llvm = $withLLVM"
|
||||
LLVM_ARCH_PATH="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH/$withLLVM"
|
||||
|
||||
[ -d "$LLVM_ARCH_PATH" ] || {
|
||||
if [ -d "$LLVM_ARCH_PATH" ]
|
||||
then
|
||||
# Add to path (for llvm-config)
|
||||
PATH="$LLVM_ARCH_PATH/bin:$PATH"
|
||||
else
|
||||
echo "Error: could not properly locate llvm/clang"
|
||||
exit 2
|
||||
}
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build MESA
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
#
|
||||
# For 64-bit
|
||||
# - 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
|
||||
MESA_ARCH_PATH=$installBASE/$mesaPACKAGE
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
|
||||
#
|
||||
# Manual adjustments to mesa
|
||||
# - avoid GLES (GLES1) since <GLES/gl.h> may mask the <GL/gl.h> header
|
||||
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"
|
||||
}
|
||||
|
||||
# Old MESA with autoconfig
|
||||
|
||||
if [ -e "$PKG_SOURCE"/configure ]
|
||||
then
|
||||
(
|
||||
# Configuration options:
|
||||
unset configOpt compFlags
|
||||
@ -210,21 +232,14 @@ adjustMESA()
|
||||
|
||||
# End of configuration options
|
||||
# ----------------------------
|
||||
buildDIR=$buildBASE/$mesaPACKAGE
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
|
||||
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 $buildDIR
|
||||
cd "$PKG_SOURCE" || exit
|
||||
|
||||
echo "----"
|
||||
echo "Building $mesaPACKAGE"
|
||||
echo " Source : $MESA_SOURCE_DIR"
|
||||
echo " Target : $MESA_ARCH_PATH"
|
||||
echo "Building $PACKAGE (with autoconf)"
|
||||
echo " Source : $PKG_SOURCE"
|
||||
echo " Target : $PKG_PREFIX"
|
||||
if [ -d "$LLVM_ARCH_PATH" ]
|
||||
then
|
||||
echo " llvm : $LLVM_ARCH_PATH"
|
||||
@ -238,9 +253,14 @@ adjustMESA()
|
||||
fi
|
||||
|
||||
## autoreconf -fi
|
||||
set -x
|
||||
$MESA_SOURCE_DIR/configure \
|
||||
--prefix=$MESA_ARCH_PATH \
|
||||
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
--disable-xvmc \
|
||||
--disable-glx \
|
||||
--disable-dri \
|
||||
@ -253,11 +273,82 @@ adjustMESA()
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built $mesaPACKAGE" \
|
||||
&& echo "Built $PACKAGE" \
|
||||
&& adjustMESA
|
||||
) || {
|
||||
echo "Error building: MESA"
|
||||
exit 1
|
||||
}
|
||||
|
||||
elif [ -e "$PKG_SOURCE"/meson.build ]
|
||||
then
|
||||
(
|
||||
# Configuration options:
|
||||
unset configOpt compFlags
|
||||
|
||||
# Sometimes for LLVM issues
|
||||
# compFlags="-D_GLIBCXX_USE_CXX11_ABI=0"
|
||||
|
||||
# Possibly for older mesa versions (see paraview wiki)
|
||||
# compFlags="-O2 -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
|
||||
|
||||
# Additional configure options
|
||||
if [ "$1" = "--" ]
|
||||
then
|
||||
shift
|
||||
configOpt="$configOpt $@"
|
||||
fi
|
||||
|
||||
# End of configuration options
|
||||
# ----------------------------
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
cd "$PKG_SOURCE" || exit
|
||||
|
||||
echo "----"
|
||||
echo "Building $PACKAGE (with meson)"
|
||||
echo " Source : $PKG_SOURCE"
|
||||
echo " Target : $PKG_PREFIX"
|
||||
if [ -d "$LLVM_ARCH_PATH" ]
|
||||
then
|
||||
echo " llvm : $LLVM_ARCH_PATH"
|
||||
fi
|
||||
echo "----"
|
||||
|
||||
if [ -n "$compFlags" ]
|
||||
then
|
||||
CFLAGS="$CFLAGS $compFlags"
|
||||
CXXFLAGS="$CXXFLAGS $compFlags"
|
||||
fi
|
||||
|
||||
# Needs c++14 not c++11
|
||||
CXXFLAGS="$(echo "$CXXFLAGS" | sed 's/c++11/c++14/')"
|
||||
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
cd "$PKG_SOURCE" && set -x && \
|
||||
meson "$PKG_BUILD" \
|
||||
--prefix="$PKG_PREFIX" \
|
||||
-Dplatforms=x11 \
|
||||
-Dosmesa=gallium \
|
||||
-Dgallium-drivers=swrast \
|
||||
-Ddri-drivers=[] \
|
||||
-Dvulkan-drivers=[] \
|
||||
$configOpt \
|
||||
&& set +x \
|
||||
&& ninja -j $WM_NCOMPPROCS -C "$PKG_BUILD" \
|
||||
&& ninja -C "$PKG_BUILD" install \
|
||||
&& echo "Built $PACKAGE" \
|
||||
&& adjustMESA
|
||||
) || {
|
||||
echo "Error building: MESA"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
echo "Error building: MESA. Not autoconfig or meson?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
180
makeOPENMPI
180
makeOPENMPI
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -28,63 +28,68 @@ if [ "$1" = "-test" ]
|
||||
then
|
||||
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
|
||||
dir="${2%/}" # <- *_ARCH_PATH
|
||||
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
then
|
||||
echo " Have openmpi shared library (${dir##*/})"
|
||||
exit 0
|
||||
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
then
|
||||
echo " Have openmpi static library (${dir##*/})"
|
||||
exit 0
|
||||
else
|
||||
echo "No openmpi libraries found: ${dir:-not-specified}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
package="openmpi"
|
||||
libName="libmpi"
|
||||
for lib in \
|
||||
"$dir/lib/$libName.a" \
|
||||
"$dir/lib/$libName$EXT_SO" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo "Have $package library (${dir##*/})"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo "No $package libraries found: ${dir:-not-specified}"
|
||||
exit 2
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
# Transition
|
||||
# ~~~~~~~~~~
|
||||
_foamAddLib() { true; }
|
||||
_foamAddMan() { true; }
|
||||
_foamAddPath() { true; }
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
WM_MPLIB=OPENMPI # Ensure we get the correct MPI
|
||||
|
||||
# openmpi version from OpenFOAM etc/config.sh file:
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
WM_MPLIB=OPENMPI # Ensure we get the correct MPI
|
||||
_foamConfig mpi
|
||||
|
||||
mpiPACKAGE=${FOAM_MPI:-openmpi-system}
|
||||
PACKAGE="${FOAM_MPI:-system}"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions openmpi; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [openmpi-VERSION] [-- configure-options]
|
||||
Usage: ${0##*/} [OPTION] [openmpi-VERSION] [-- configure-options]
|
||||
options:
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-memcheck Configure with --enable-memcheck (requires valgrind.h)
|
||||
-threaded Configure with --enable-mpi-thread-multiple
|
||||
-no-threaded Configure with --disable-mpi-thread-multiple
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build openmpi with
|
||||
${mpiPACKAGE:-'unspecified openmpi version'}
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint OPENMPI
|
||||
exit 1
|
||||
showDownloadHint openmpi
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler # Compiler info for CMake/configure
|
||||
@ -97,15 +102,17 @@ do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
-memcheck*) optMemchecker=true ;;
|
||||
-thread*) optThreaded=enable ;;
|
||||
-no-thread*) optThreaded=disable ;;
|
||||
|
||||
openmpi/* | sources/openmpi* | \
|
||||
openmpi-[0-9]* | openmpi_[0-9]* | openmpi-system )
|
||||
mpiPACKAGE="${1%%/}"
|
||||
PACKAGE="${1%%/}"
|
||||
;;
|
||||
|
||||
*)
|
||||
@ -115,39 +122,43 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$mpiPACKAGE" ] || die "The openmpi-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$mpiPACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using openmpi-none (skip ThirdParty build of openmpi)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$mpiPACKAGE"
|
||||
die "The OPENMPI package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using openmpi-system (skip ThirdParty build of openmpi)"
|
||||
echo "Using none/system (skip ThirdParty build of OPENMPI)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build openmpi
|
||||
#
|
||||
# MPI_SOURCE_DIR : location of the original sources
|
||||
# MPI_ARCH_PATH : installation directory
|
||||
# Build OPENMPI
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
|
||||
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
&& {
|
||||
[ -r "$PKG_PREFIX/lib/libmpi$EXT_SO" ] \
|
||||
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
}
|
||||
then
|
||||
echo "Already has shared library: $MPI_ARCH_PATH"
|
||||
echo "Already has shared library: $PKG_PREFIX"
|
||||
elif [ -z "$optForce" ] \
|
||||
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
&& {
|
||||
[ -r "$PKG_PREFIX/lib/libmpi.a" ] \
|
||||
|| [ -r "$PKG_PREFIX/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
}
|
||||
then
|
||||
echo "Already has static library: $MPI_ARCH_PATH"
|
||||
echo "Already has static library: $PKG_PREFIX"
|
||||
else
|
||||
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
|
||||
echo "Starting build: $WM_MPLIB ($PACKAGE)"
|
||||
echo
|
||||
|
||||
(
|
||||
@ -176,34 +187,59 @@ else
|
||||
# End of configuration options
|
||||
# ----------------------------
|
||||
|
||||
buildDIR=$buildBASE/$mpiPACKAGE
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
cd "$PKG_SOURCE" || exit
|
||||
|
||||
cd "$MPI_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
[ -e Makefile ] && make distclean 2>/dev/null
|
||||
make distclean 2>/dev/null || true
|
||||
|
||||
rm -rf $MPI_ARCH_PATH
|
||||
rm -rf $buildDIR
|
||||
mkdir -p $buildDIR
|
||||
cd $buildDIR
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
set -x
|
||||
$MPI_SOURCE_DIR/configure \
|
||||
--prefix=$MPI_ARCH_PATH \
|
||||
--libdir=$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
||||
# The real prefix is /path/ThirdParty/platforms/arch/openmpi-x.y.z
|
||||
# but configure with prefix="/arch/openmpi-x.y.z"
|
||||
# and install into "/path/ThirdParty/platforms"
|
||||
|
||||
# The final binaries are then independent of the build location and
|
||||
# will always require OPAL_PREFIX to run
|
||||
|
||||
local_destdir="$(dirname $PKG_PREFIX)"
|
||||
local_prefix="/$(basename $local_destdir)/$(basename $PKG_PREFIX)"
|
||||
local_destdir="$(dirname $local_destdir)"
|
||||
|
||||
echo
|
||||
echo "configured prefix: $local_prefix"
|
||||
echo "install directory: $local_destdir"
|
||||
echo
|
||||
|
||||
# Do not specify '--libdir' or relocating becomes difficult
|
||||
cd "$PKG_BUILD" && set -x && \
|
||||
"$PKG_SOURCE"/configure \
|
||||
--prefix="$local_prefix" \
|
||||
--disable-orterun-prefix-by-default \
|
||||
--enable-shared --disable-static \
|
||||
--enable-mpi-fortran=none \
|
||||
$configOpt \
|
||||
&& set +x \
|
||||
&& make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: $mpiPACKAGE" \
|
||||
&& pkgconfigAdjust $MPI_ARCH_PATH
|
||||
&& make install DESTDIR="$local_destdir" \
|
||||
&& echo "Built: $PACKAGE"
|
||||
) || {
|
||||
echo "Error building: $mpiPACKAGE"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Unneeded generated files
|
||||
for dir in share/doc share/info share/man
|
||||
do
|
||||
if [ -d "$PKG_PREFIX/$dir" ]
|
||||
then
|
||||
echo "Discard $dir files to save space: $PACKAGE"
|
||||
rm -rf "$PKG_PREFIX/$dir"
|
||||
fi
|
||||
done
|
||||
rmdir "$PKG_PREFIX"/share 2>/dev/null || true
|
||||
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
236
makePETSC
236
makePETSC
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -20,85 +20,98 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
_foamConfig hypre
|
||||
_foamConfig petsc
|
||||
|
||||
hyprePACKAGE="${hypre_version:-hypre-none}"
|
||||
petscPACKAGE="${petsc_version:-petsc-system}"
|
||||
PETSC_PACKAGE="${petsc_version:-none}"
|
||||
targetType=libso
|
||||
|
||||
# Should be possible to build with download, but seems to fail
|
||||
# hypreURL="https://github.com/hypre-space/hypre/archive/v2.14.0.tar.gz"
|
||||
unset hypreURL
|
||||
unset HYPRE_PACKAGE
|
||||
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
||||
|
||||
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||
then
|
||||
unset PETSC_ARCH_PATH
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions petsc; exit 0; }
|
||||
printHelp() {
|
||||
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:
|
||||
-force Force compilation, even if include/library already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-inplace Build/install inplace (expert option)
|
||||
-no-hypre Disable automatic hypre detection
|
||||
-help
|
||||
-debug Build with debugging enabled
|
||||
-hypre=URL Specify hypre download location
|
||||
-no-hypre Disable automatic hypre download/detection
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build PETSC with
|
||||
${petscPACKAGE:-'unspecified petsc version'}
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint PETSC
|
||||
showDownloadHint petsc
|
||||
|
||||
echo
|
||||
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
|
||||
|
||||
unset optForce optInplace
|
||||
unset optDebug optForce optInplace optHypre
|
||||
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
-inplace) optInplace=true ;;
|
||||
-debug) optDebug=true ;;
|
||||
|
||||
lib|libso)
|
||||
targetType="$1"
|
||||
lib|libso) targetType="$1" ;;
|
||||
|
||||
-hypre=*)
|
||||
optHypre="${1#*=}" # URL for download
|
||||
unset HYPRE_PACKAGE HYPRE_ARCH_PATH
|
||||
;;
|
||||
|
||||
-no-hypre)
|
||||
unset hyprePACKAGE hypreURL
|
||||
unset HYPRE_ARCH_PATH
|
||||
optHypre=false
|
||||
unset HYPRE_PACKAGE HYPRE_ARCH_PATH
|
||||
;;
|
||||
|
||||
hypre-[0-9]* | hypre-git)
|
||||
hyprePACKAGE="${1%%/}"
|
||||
unset hypreURL
|
||||
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
||||
HYPRE_PACKAGE="${1%%/}"
|
||||
unset optHypre
|
||||
unset HYPRE_ARCH_PATH # Avoid inconsistency
|
||||
;;
|
||||
|
||||
petsc/* | sources/petsc* |\
|
||||
petsc-[0-9]* | petsc-git)
|
||||
petscPACKAGE="${1%%/}"
|
||||
unset PETSC_ARCH_PATH # Avoid inconsistency
|
||||
PETSC_PACKAGE="${1%%/}"
|
||||
unset PETSC_ARCH_PATH # Avoid inconsistency
|
||||
;;
|
||||
*)
|
||||
die "unknown option/argument: '$1'"
|
||||
@ -107,30 +120,24 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$petscPACKAGE" ] || die "The petsc-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$petscPACKAGE"
|
||||
if [ -z "$PETSC_PACKAGE" ]
|
||||
then
|
||||
echo "Using petsc-none (skip ThirdParty build of PETSC)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$petscPACKAGE"
|
||||
die "The PETSC package/version not specified"
|
||||
elif _foamIsNone "$PETSC_PACKAGE" || _foamIsSystem "$PETSC_PACKAGE"
|
||||
then
|
||||
echo "Using petsc-system"
|
||||
echo "Using none/system (skip ThirdParty build of PETSC)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Integrations
|
||||
|
||||
# No hypre
|
||||
if _foamIsNone "$hyprePACKAGE"
|
||||
# Clunky
|
||||
if [ -z "$optHypre" ] && [ -n "$HYPRE_PACKAGE" ] \
|
||||
&& ! _foamIsNone "$HYPRE_PACKAGE"
|
||||
then
|
||||
:
|
||||
elif [ -n "$hyprePACKAGE" ]
|
||||
then
|
||||
# Clunky
|
||||
: "${HYPRE_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$hyprePACKAGE}"
|
||||
echo "Using $HYPRE_PACKAGE"
|
||||
: "${HYPRE_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$HYPRE_PACKAGE}"
|
||||
fi
|
||||
|
||||
|
||||
@ -138,15 +145,22 @@ fi
|
||||
#
|
||||
# Build PETSC
|
||||
#
|
||||
# PETSC_ARCH_PATH : installation directory
|
||||
# PETSC_SOURCE_DIR : location of the original sources
|
||||
# PETSC_ARCH_PATH : installation directory (as per config file)
|
||||
#
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
PETSC_SOURCE_DIR="$sourceBASE/$petscPACKAGE"
|
||||
: "${PETSC_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$petscPACKAGE}"
|
||||
PETSC_SOURCE="$(findSourceDir "$PETSC_PACKAGE")"
|
||||
PETSC_PACKAGE="$(basename "$PETSC_PACKAGE")"
|
||||
PETSC_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PETSC_PACKAGE"
|
||||
|
||||
[ -d "$PETSC_SOURCE_DIR" ] || {
|
||||
echo "Missing sources: '$petscPACKAGE'"
|
||||
showDownloadHint PETSC
|
||||
# Override as per config file (if any)
|
||||
[ -n "$PETSC_ARCH_PATH" ] && PETSC_PREFIX="$PETSC_ARCH_PATH"
|
||||
|
||||
[ -d "$PETSC_SOURCE" ] || {
|
||||
echo "Missing sources: '$PETSC_PACKAGE'"
|
||||
showDownloadHint petsc
|
||||
exit 2
|
||||
}
|
||||
|
||||
@ -156,40 +170,48 @@ archOpt="$WM_SIZE_OPTIONS"
|
||||
|
||||
if [ -n "$optInplace" ]
|
||||
then
|
||||
unset installPrefix
|
||||
# No install stage requires
|
||||
# Inplace installation. No install stage required
|
||||
unset PETSC_PREFIX
|
||||
makeInstall() { true; }
|
||||
else
|
||||
|
||||
# Regular installation location
|
||||
installPrefix="$PETSC_ARCH_PATH"
|
||||
# Regular installation location (PETSC_PREFIX)
|
||||
|
||||
makeInstall() {
|
||||
make PETSC_DIR="$PETSC_SOURCE_DIR" PETSC_ARCH="$archOpt" install
|
||||
make PETSC_DIR="$PETSC_SOURCE" PETSC_ARCH="$archOpt" install
|
||||
pkgconfigAdjust "$PETSC_PREFIX"
|
||||
}
|
||||
fi
|
||||
|
||||
echo "Starting build: $petscPACKAGE ($targetType)"
|
||||
echo "Starting build: $PETSC_PACKAGE ($targetType)"
|
||||
if [ "$WM_PRECISION_OPTION" = SP ]
|
||||
then
|
||||
optHypre=false # No single-precision hypre
|
||||
echo "No single-precision hypre"
|
||||
fi
|
||||
if [ -d "$PETSC_SOURCE/$archOpt/externalpackages" ]
|
||||
then
|
||||
echo "Removing old $archOpt/externalpackages"
|
||||
rm -rf "$PETSC_SOURCE/$archOpt/externalpackages"
|
||||
fi
|
||||
echo
|
||||
(
|
||||
# Configuration options
|
||||
configOpt="--with-cc=$(whichMpicc) --with-cxx=$(whichMpicxx)"
|
||||
|
||||
# Normally want hypre but this is really clunky
|
||||
if [ -f "$HYPRE_ARCH_PATH/include/HYPRE.h" ]
|
||||
then
|
||||
echo "Has installed hypre: $hyprePACKAGE"
|
||||
configOpt="$configOpt --with-hypre-dir=$HYPRE_ARCH_PATH"
|
||||
elif [ -n "$urlHypre" ]
|
||||
then
|
||||
configOpt="$configOpt --download-hypre=$urlHypre"
|
||||
fi
|
||||
# Compiler or MPI (but not both)
|
||||
# if [ -d "$MPI_ARCH_PATH" ]
|
||||
# then
|
||||
# configOpt="--with-mpi-dir=$MPI_ARCH_PATH"
|
||||
# else
|
||||
configOpt="--with-cc=$(whichMpicc) --with-cxx=$(whichMpicxx)"
|
||||
# fi
|
||||
|
||||
# Additional configure options
|
||||
if [ "$1" = "--" ]
|
||||
if [ "$optDebug" = true ]
|
||||
then
|
||||
shift
|
||||
configOpt="$configOpt $@"
|
||||
configOpt="$configOpt --with-debugging=1"
|
||||
else
|
||||
# A reasonable assumption for optimization
|
||||
configOpt="$configOpt --with-debugging=0"
|
||||
configOpt="$configOpt --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3"
|
||||
fi
|
||||
|
||||
if [ "$targetType" = libso ]
|
||||
@ -211,42 +233,66 @@ echo
|
||||
configOpt="$configOpt --with-precision=double"
|
||||
fi
|
||||
|
||||
case "$optHypre" in
|
||||
false)
|
||||
configOpt="$configOpt --with-hypre=0"
|
||||
;;
|
||||
ftp:* | git:* | http:* | https:*)
|
||||
configOpt="$configOpt --download-hypre=$optHypre"
|
||||
;;
|
||||
*)
|
||||
# This is a really clunky way to use ThirdParty hypre
|
||||
if [ -f "$HYPRE_ARCH_PATH/include/HYPRE.h" ]
|
||||
then
|
||||
echo "Has installed hypre: $HYPRE_PACKAGE"
|
||||
configOpt="$configOpt --with-hypre-dir=$HYPRE_ARCH_PATH"
|
||||
else
|
||||
configOpt="$configOpt --download-hypre"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Additional configure options
|
||||
if [ "$1" = "--" ]
|
||||
then
|
||||
shift
|
||||
configOpt="$configOpt $@"
|
||||
fi
|
||||
|
||||
# We export compiler settings (above) but actually use the
|
||||
# --with-cc and --with-cxx. So ignore them and flags
|
||||
# --with-cc and --with-cxx. So ignore these environment variables.
|
||||
|
||||
unset CC CXX
|
||||
unset CFLAGS CXXFLAGS
|
||||
|
||||
cd "$PETSC_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
cd "$PETSC_SOURCE" || exit
|
||||
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
|
||||
|
||||
## without tests? --testdir=..
|
||||
## configOpt="$configOpt --download-f2cblaslapack=1"
|
||||
|
||||
echo
|
||||
set -x
|
||||
./configure \
|
||||
${installPrefix:+--prefix="$installPrefix"} \
|
||||
--PETSC_DIR="$PETSC_SOURCE_DIR" \
|
||||
${PETSC_PREFIX:+--prefix="$PETSC_PREFIX"} \
|
||||
--PETSC_DIR="$PETSC_SOURCE" \
|
||||
--with-petsc-arch="$archOpt" \
|
||||
--with-clanguage=C \
|
||||
--with-fc=0 \
|
||||
--with-scalapack=0 \
|
||||
--with-superlu_dist=0 \
|
||||
--with-suitesparse=0 \
|
||||
--with-x=0 \
|
||||
$configOpt \
|
||||
&& set +x \
|
||||
&& echo "Configured: petsc" \
|
||||
&& 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" \
|
||||
&& 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
|
||||
}
|
||||
|
||||
|
||||
68
makeParaView
68
makeParaView
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -26,20 +26,21 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
. etc/tools/ParaViewFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${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:
|
||||
unset ParaView_VERSION # Purge current values
|
||||
_foamConfig paraview
|
||||
|
||||
# Avoid any potential conflicts (especially if building from git)
|
||||
@ -64,14 +65,19 @@ setParaViewVersion ${ParaView_VERSION:-none}
|
||||
# New rendering backend (starting with paraview 5.0).
|
||||
withGL2=auto # auto-config based on version
|
||||
|
||||
# Hint for cmake findMPI
|
||||
if [ -d "$MPI_ARCH_PATH" ]
|
||||
then
|
||||
export MPI_HOME="$MPI_ARCH_PATH"
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
printVersions() { listPackageVersions paraview; exit 0; }
|
||||
printHelp() {
|
||||
: ${ParaView_VERSION:=none} # some dummy value for usage information
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [paraview-VERSION] [CMAKE-OPTION]
|
||||
Usage: ${0##*/} [OPTION] [paraview-VERSION] [CMAKE-OPTION]
|
||||
options:
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH with cmake from the given path
|
||||
@ -83,6 +89,7 @@ options:
|
||||
-mesa-lib PATH path to mesa library (current: ${MESA_LIBRARY:-none})
|
||||
-mpi with mpi
|
||||
-mpi=N with max 'N' mpi processes. N=0 for no upper-limit.
|
||||
-mpi-home PATH with mpi and hint for MPI_HOME
|
||||
-python | -python2 | -python3
|
||||
with python
|
||||
-python-include DIR
|
||||
@ -90,14 +97,16 @@ options:
|
||||
-python-lib PATH path to python library (current: ${PYTHON_LIBRARY:-none})
|
||||
-qmake PATH with QT version corresponding to the qmake in given path
|
||||
-qt with extra Qt gui support (if not already enabled)
|
||||
-qt-VER with QT version corresponding to
|
||||
-qt-<VER> with QT version corresponding to
|
||||
\$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/qt-VER/bin/qmake
|
||||
-verbose verbose output in Makefiles
|
||||
-version VER specify an alternative version (current: $ParaView_VERSION)
|
||||
-major VER specify an alternative major version for special builds
|
||||
-buildType NAME specify the build type (default: Release)
|
||||
-suffix NAME specify a suffix to distinguish the build
|
||||
-help
|
||||
-DNAME=VALUE add cmake variable
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
The -no-FEATURE option can be used to forcibly disable these features:
|
||||
-no-gl2 | -no-mesa | -no-mpi | -no-python | -no-qt
|
||||
@ -126,8 +135,8 @@ For example,
|
||||
Or change the \$WM_PROJECT_DIR/etc/config.sh/paraview settings.
|
||||
|
||||
USAGE
|
||||
showDownloadHint PARAVIEW
|
||||
exit 1
|
||||
showDownloadHint paraview
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler minimal # Minimal compiler info for CMake/configure
|
||||
@ -141,13 +150,16 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
|
||||
[0-9]* | paraview-[0-9]* | ParaView-[0-9]*) # paraview version
|
||||
setParaViewVersion "${1%%/}"
|
||||
# paraview version
|
||||
paraview/* | vtk/* | sources/paraview* | sources/vtk* |\
|
||||
[0-9]* | paraview-[0-9]* | ParaView-[0-9]* | ParaView-v[0-9]*)
|
||||
setParaViewVersion "$(basename "$1")"
|
||||
;;
|
||||
[A-Z]*=*) # cmake variables
|
||||
-D[A-Z]*=* | [A-Z]*=*) # cmake variables
|
||||
addCMakeVariable "$1"
|
||||
;;
|
||||
-patch) # stage 0: patch sources
|
||||
@ -231,6 +243,13 @@ do
|
||||
withMPI=true
|
||||
MPI_MAX_PROCS="${1##*=}"
|
||||
;;
|
||||
-mpi-home) # mpi with hint
|
||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||
withMPI=true
|
||||
export MPI_HOME="${2%%/}"
|
||||
case "${MPI_HOME:-none}" in (false|none) unset MPI_HOME;; esac
|
||||
shift
|
||||
;;
|
||||
-no-mpi)
|
||||
withMPI=false
|
||||
;;
|
||||
@ -359,6 +378,7 @@ fi
|
||||
|
||||
# Set configure options
|
||||
#~~~~~~~~~~~~~~~~~~~~~~
|
||||
addGeneral # general settings (version-dependent)
|
||||
addVerbosity # verbose makefiles
|
||||
addMpiSupport # set MPI-specific options
|
||||
addPythonSupport # set Python-specific options
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
# - mpi (0 = no upper-limit on processes)
|
||||
# - mesa
|
||||
# - python (required for Catalyst)
|
||||
# - has VTK_PYTHON_OPTIONAL_LINK=OFF to avoid
|
||||
# undefined symbol: PyExc_ValueError
|
||||
#
|
||||
# NOTE: must modify etc/config.*/paraview to use this particular version
|
||||
# and combination, or use chaining as per etc/config.*/example/paraview
|
||||
@ -18,6 +20,8 @@ set -x
|
||||
-mesa-prefix $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa \
|
||||
-python \
|
||||
-suffix mesa-mpi-py \
|
||||
-DPARAVIEW_ENABLE_FFMPEG=ON \
|
||||
-DVTK_PYTHON_OPTIONAL_LINK=OFF \
|
||||
"$@"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
107
makeQt
107
makeQt
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -21,37 +21,40 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
. etc/tools/QtFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/QtFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions qt; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [qt-VERSION] [-- configure-options]
|
||||
Usage: ${0##*/} [OPTION] [qt-VERSION] [-- configure-options]
|
||||
options:
|
||||
-force Force compilation, even if it already exists
|
||||
-gcc Force use of gcc/g++
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* build $qtTYPE, version ${qtVERSION:-undefined}
|
||||
|
||||
USAGE
|
||||
showDownloadHint QT
|
||||
exit 1
|
||||
showDownloadHint qt
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler true # Compiler info + flags for CMake/configure
|
||||
|
||||
unset optForce
|
||||
unset PACKAGE qtVERSION
|
||||
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
@ -59,14 +62,22 @@ do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-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-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
|
||||
qtVERSION="${1%%/}";
|
||||
qtVERSION="${qtVERSION##*-}"
|
||||
PACKAGE="$qtTYPE-$qtVERSION"
|
||||
;;
|
||||
|
||||
*)
|
||||
@ -75,38 +86,41 @@ do
|
||||
esac
|
||||
shift
|
||||
done
|
||||
qtPACKAGE=$qtTYPE-$qtVERSION
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$qtPACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using qt-none (skip ThirdParty build of QT)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$qtPACKAGE"
|
||||
die "The QT package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using qt-system"
|
||||
echo "Using none/system (skip ThirdParty build of QT)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build QT
|
||||
#
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
QT_SOURCE_DIR=$sourceBASE/$qtPACKAGE
|
||||
QT_ARCH_PATH=$installBASE/qt-$qtVERSION
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE" "$qtTYPE-$qtVERSION")"
|
||||
PACKAGE="qt-$qtVERSION"
|
||||
PKG_PREFIX="$installBASE/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
echo
|
||||
echo ========================================
|
||||
echo "Build Qt $qtPACKAGE"
|
||||
echo "Build Qt $PACKAGE"
|
||||
echo
|
||||
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -d "$QT_ARCH_PATH" ] \
|
||||
&& [ -r "$QT_ARCH_PATH/bin/qmake" ]
|
||||
&& [ -d "$PKG_PREFIX" ] \
|
||||
&& [ -r "$PKG_PREFIX"/bin/qmake ]
|
||||
then
|
||||
echo "Already built: Qt-$qtVERSION"
|
||||
echo "Already built: $PACKAGE"
|
||||
else
|
||||
echo "Starting build: Qt-$qtVERSION"
|
||||
echo "Starting build: $PACKAGE"
|
||||
(
|
||||
# Configuration options:
|
||||
unset configOpt
|
||||
@ -140,35 +154,34 @@ else
|
||||
|
||||
# End of configuration options
|
||||
# ----------------------------
|
||||
buildDIR=$buildBASE/$qtPACKAGE
|
||||
PKG_BUILD="$buildBASE/$PACKAGE"
|
||||
|
||||
cd "$QT_SOURCE_DIR" || exit
|
||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||
cd "$PKG_SOURCE" || exit
|
||||
[ -e Makefile ] && make distclean 2>/dev/null
|
||||
|
||||
# Remove any existing build folder and recreate
|
||||
rm -rf $QT_ARCH_DIR
|
||||
rm -rf $buildDIR 2>/dev/null
|
||||
mkdir -p $buildDIR
|
||||
rm -rf "$PKG_PREFIX"
|
||||
rm -rf "$PKG_BUILD"
|
||||
mkdir -p "$PKG_BUILD"
|
||||
|
||||
# Remove any remnants from a previous shadow build
|
||||
rm -f "$QT_SOURCE_DIR/.qmake.cache" 2>/dev/null
|
||||
rm -f "$QT_SOURCE_DIR/src/corelib/global/qconfig.h" 2>/dev/null
|
||||
rm -f "$QT_SOURCE_DIR/src/corelib/global/qconfig.cpp" 2>/dev/null
|
||||
rm -f "$PKG_SOURCE"/.qmake.cache
|
||||
rm -f "$PKG_SOURCE"/src/corelib/global/qconfig.h
|
||||
rm -f "$PKG_SOURCE"/src/corelib/global/qconfig.cpp
|
||||
|
||||
cd "$buildDIR" || exit
|
||||
cd "$PKG_BUILD" || exit
|
||||
|
||||
# Compile as opensource, accepting LGPL conditions (yes)
|
||||
echo yes | $QT_SOURCE_DIR/configure \
|
||||
-prefix $QT_ARCH_PATH \
|
||||
echo yes | "$PKG_SOURCE"/configure \
|
||||
-prefix "$PKG_PREFIX" \
|
||||
-opensource \
|
||||
$configOpt \
|
||||
&& time make -j $WM_NCOMPPROCS \
|
||||
&& make install \
|
||||
&& echo "Built: Qt-$qtVERSION" \
|
||||
&& finalizeQt
|
||||
&& echo "Built: $PACKAGE" \
|
||||
&& finalizeQt "$PKG_PREFIX"
|
||||
) || {
|
||||
echo "Error building: Qt-$qtVERSION"
|
||||
echo "Error building: $PACKAGE"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
502
makeSCOTCH
502
makeSCOTCH
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -20,27 +20,32 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
_foamConfig scotch # Get SCOTCH_ARCH_PATH, SCOTCH_VERSION
|
||||
|
||||
scotchPACKAGE=${SCOTCH_VERSION:-scotch-system}
|
||||
PACKAGE="${SCOTCH_VERSION:-system}"
|
||||
|
||||
unset withMPI
|
||||
case "$WM_MPLIB" in (*MPI*) [ "$FOAM_MPI" = dummy ] || withMPI=true ;; esac
|
||||
|
||||
if nonStandardPlatforms # Possibly unreliable inherited values
|
||||
then
|
||||
unset SCOTCH_ARCH_PATH
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage()
|
||||
{
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions scotch; exit 0; }
|
||||
printHelp() {
|
||||
/bin/cat<<USAGE
|
||||
|
||||
Usage: ${0##*/} [OPTION] [libso] [scotch-VERSION]
|
||||
@ -48,37 +53,45 @@ options:
|
||||
-force Force compilation, even if include/library already exists
|
||||
Also force build attempt of pt-scotch (mingw)
|
||||
-gcc Force use of gcc/g++
|
||||
-bin Create scotch binaries as well (experimental)
|
||||
-int32 Use SCOTCH_Num 32
|
||||
-int64 Use SCOTCH_Num 64
|
||||
-bin Create scotch binaries as well
|
||||
-no-bin Suppress creation of scotch binaries (default)
|
||||
-no-mpi Suppress build of pt-scotch
|
||||
-help
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
* Compile SCOTCH
|
||||
$scotchPACKAGE
|
||||
* Build SCOTCH (default: -int${WM_LABEL_SIZE:-32}) with
|
||||
${PACKAGE:-[unspecified]}
|
||||
|
||||
USAGE
|
||||
showDownloadHint SCOTCH
|
||||
exit 1
|
||||
showDownloadHint scotch
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
unset optBinaries optForce
|
||||
unset optForce optNoExtlib
|
||||
optBinaries=false
|
||||
optLabelSize="${WM_LABEL_SIZE:-32}"
|
||||
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
-force) optForce=true ;;
|
||||
|
||||
-int32 | -int64) optLabelSize="${1#-int}" ;;
|
||||
-bin) optBinaries=true ;;
|
||||
-no-bin) unset optBinaries ;;
|
||||
-no-bin) optBinaries=false ;;
|
||||
-no-mpi) unset withMPI ;;
|
||||
-no-extlib) optNoExtlib=true ;; # Hidden option
|
||||
|
||||
scotch-[0-9]* | scotch-git | scotch_* )
|
||||
scotchPACKAGE="${1%%/}"
|
||||
scotch/ | sources/scotch* |\
|
||||
scotch-[0-9]* | scotch-v[0-9]* | scotch-git | scotch_* )
|
||||
PACKAGE="${1%%/}"
|
||||
unset SCOTCH_ARCH_PATH # Avoid inconsistency
|
||||
;;
|
||||
*)
|
||||
@ -88,72 +101,279 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
[ -n "$scotchPACKAGE" ] || die "The scotch-VERSION was not specified"
|
||||
|
||||
# Nothing to build
|
||||
if _foamIsNone "$scotchPACKAGE"
|
||||
if [ -z "$PACKAGE" ]
|
||||
then
|
||||
echo "Using scotch-none (skip ThirdParty build of SCOTCH)"
|
||||
exit 0
|
||||
elif _foamIsSystem "$scotchPACKAGE"
|
||||
die "The SCOTCH package/version not specified"
|
||||
elif _foamIsNone "$PACKAGE" || _foamIsSystem "$PACKAGE"
|
||||
then
|
||||
echo "Using scotch-system"
|
||||
echo "Using none/system (skip ThirdParty build of SCOTCH)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
requireExtLibBin
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Needs generalizing, but works fairly well
|
||||
for scotchMakefile in \
|
||||
"OpenFOAM-$(uname -s)-${WM_COMPILER}.shlib" \
|
||||
"OpenFOAM-$(uname -s).shlib" \
|
||||
OpenFOAM-Linux.shlib \
|
||||
;
|
||||
do
|
||||
scotchMakefile="etc/makeFiles/scotch/Makefile.inc.$scotchMakefile"
|
||||
[ -f "$scotchMakefile" ] && break
|
||||
done
|
||||
|
||||
# The relative link location within the "scotch/src/" directory
|
||||
makefileInc="../../$scotchMakefile"
|
||||
if [ "$optNoExtlib" = true ]
|
||||
then
|
||||
unset FOAM_EXT_LIBBIN
|
||||
else
|
||||
requireExtLibBin
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Build SCOTCH
|
||||
# SCOTCH_ARCH_PATH : installation directory (as per config file)
|
||||
#
|
||||
# SCOTCH_ARCH_PATH : installation directory
|
||||
# SCOTCH_SOURCE_DIR : location of the original sources
|
||||
# *PACKAGE : name-version of the package
|
||||
# *SOURCE : location of original sources
|
||||
# *PREFIX : installation directory
|
||||
|
||||
SCOTCH_SOURCE_DIR="$sourceBASE/$scotchPACKAGE"
|
||||
: "${SCOTCH_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$scotchPACKAGE}"
|
||||
PKG_SOURCE="$(findSourceDir "$PACKAGE")"
|
||||
PACKAGE="$(basename "$PACKAGE")"
|
||||
PKG_PREFIX="$installBASE$WM_SIZE_OPTIONS/$PACKAGE"
|
||||
export GIT_DIR="$PKG_SOURCE/.git"
|
||||
|
||||
[ -d "$SCOTCH_SOURCE_DIR/src" ] || {
|
||||
echo "Missing sources: '$scotchPACKAGE'"
|
||||
showDownloadHint SCOTCH
|
||||
# Override as per config file (if any)
|
||||
[ -n "$SCOTCH_ARCH_PATH" ] && PKG_PREFIX="$SCOTCH_ARCH_PATH"
|
||||
|
||||
[ -d "$PKG_SOURCE/src" ] || {
|
||||
echo "Missing sources: '$PACKAGE'"
|
||||
showDownloadHint scotch
|
||||
exit 2
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Select a Makefile.inc for the scotch build
|
||||
# - could use more generalizing, but works fairly well
|
||||
|
||||
unset MakefileInc
|
||||
for ending in \
|
||||
"$(uname -s)-${WM_COMPILER}".shlib \
|
||||
"$(uname -s)".shlib \
|
||||
Linux.shlib \
|
||||
;
|
||||
do
|
||||
# Fully resolve path
|
||||
file="$WM_THIRD_PARTY_DIR/etc/makeFiles/scotch/Makefile.inc.$ending"
|
||||
if [ -f "$file" ]
|
||||
then
|
||||
MakefileInc="$file"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# - copy OpenFOAM-specific Makefile include files into the scotch dir.
|
||||
# - place a full copy into an 'openfoam/' directory (for documentation)
|
||||
# - make symlink from the openfoam/Makefile.inc.XXX -> src/Makefile.inc
|
||||
|
||||
createMakefileLinks()
|
||||
{
|
||||
# Sanity checks
|
||||
if [ -z "$MakefileInc" ]
|
||||
then
|
||||
echo "Did not define a Makefile.inc for"
|
||||
echo " $PACKAGE/src"
|
||||
return 1
|
||||
elif [ ! -f "$MakefileInc" ]
|
||||
then
|
||||
echo "No such file to include:"
|
||||
echo " $MakefileInc"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$PKG_SOURCE"/src ] || [ ! -w "$PKG_SOURCE"/src ]
|
||||
then
|
||||
echo "Directory missing or not writable:"
|
||||
echo " $PKG_SOURCE/src"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Copy files and make links
|
||||
mkdir -p "$PKG_SOURCE"/openfoam
|
||||
cp -p "$(dirname "$MakefileInc")"/* "$PKG_SOURCE"/openfoam
|
||||
rm -f "$PKG_SOURCE"/src/Makefile.inc
|
||||
(
|
||||
cd "$PKG_SOURCE/src" && \
|
||||
ln -sf ../openfoam/"$(basename "$MakefileInc")" Makefile.inc
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Manual installation of serial libraries
|
||||
# from libdir to -> $FOAM_EXT_LIBBIN
|
||||
#
|
||||
install_serial()
|
||||
{
|
||||
local libdir_source="$1"
|
||||
local libdir_target="$FOAM_EXT_LIBBIN"
|
||||
local libname_suffix="-int$WM_LABEL_SIZE"
|
||||
|
||||
[ -n "$FOAM_EXT_LIBBIN" ] || unset libdir_target
|
||||
[ -n "$WM_LABEL_SIZE" ] || unset libname_suffix
|
||||
|
||||
echo
|
||||
echo "Adjusting installation"
|
||||
|
||||
# Rename lib as xxx-intNN qualified library names (non-windows)
|
||||
if [ -n "$libname_suffix" ] && [ "${EXT_SO:-.dll}" != ".dll" ]
|
||||
then
|
||||
(
|
||||
cd "$libdir_source" || exit
|
||||
echo "Tagging libraries with $libname_suffix"
|
||||
for name in libscotch
|
||||
do
|
||||
if [ -f "$name$EXT_SO" ]
|
||||
then
|
||||
mv "$name$EXT_SO" "$name$libname_suffix$EXT_SO"
|
||||
ln -sf "$name$libname_suffix$EXT_SO" "$name$EXT_SO"
|
||||
fi
|
||||
done
|
||||
)
|
||||
fi
|
||||
|
||||
if [ -n "$libdir_target" ]
|
||||
then
|
||||
# Remove old libraries and links
|
||||
for name in libscotch
|
||||
do
|
||||
rm -f "$libdir_target/$name$EXT_SO"
|
||||
rm -f "$libdir_target/$name$libname_suffix$EXT_SO"
|
||||
done
|
||||
mkdir -p "$libdir_target"
|
||||
echo "Relocating serial libraries"
|
||||
|
||||
# echo "Installing: $libdir_target/libscotch$libname_suffix"
|
||||
mv -f "$libdir_source"/lib* "$libdir_target"
|
||||
fi
|
||||
|
||||
rmdir "$libdir_source" 2>/dev/null # Failed rmdir is uncritical
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Manual installation of parallel libraries
|
||||
# from libdir to -> $FOAM_EXT_LIBBIN/$FOAM_MPI
|
||||
#
|
||||
install_parallel()
|
||||
{
|
||||
local libdir_source="$1"
|
||||
local libdir_target="$FOAM_EXT_LIBBIN/$FOAM_MPI"
|
||||
local libname_suffix="-int$WM_LABEL_SIZE"
|
||||
local link_serial=false
|
||||
|
||||
[ -n "$FOAM_EXT_LIBBIN" ] || unset libdir_target
|
||||
[ -n "$WM_LABEL_SIZE" ] || unset libname_suffix
|
||||
|
||||
echo
|
||||
echo "Adjusting installation"
|
||||
|
||||
# Rename lib as xxx-intNN qualified library names (non-windows)
|
||||
if [ -n "$libname_suffix" ] && [ "${EXT_SO:-.dll}" != ".dll" ]
|
||||
then
|
||||
(
|
||||
cd "$libdir_source" || exit
|
||||
echo "Tagging libraries with $libname_suffix"
|
||||
|
||||
# When linked, remove generated serial libraries
|
||||
if [ "$link_serial" = true ]
|
||||
then
|
||||
rm -f libscotch*
|
||||
fi
|
||||
|
||||
for name in libscotch libptscotch
|
||||
do
|
||||
if [ -f "$name$EXT_SO" ]
|
||||
then
|
||||
mv "$name$EXT_SO" "$name$libname_suffix$EXT_SO"
|
||||
ln -sf "$name$libname_suffix$EXT_SO" "$name$EXT_SO"
|
||||
fi
|
||||
done
|
||||
)
|
||||
fi
|
||||
|
||||
if [ -n "$libdir_target" ]
|
||||
then
|
||||
# Remove old libraries and links
|
||||
for name in libscotch libptscotch
|
||||
do
|
||||
rm -f "$libdir_target/$name$EXT_SO"
|
||||
rm -f "$libdir_target/$name$libname_suffix$EXT_SO"
|
||||
done
|
||||
mkdir -p "$libdir_target"
|
||||
echo "Relocating parallel libraries"
|
||||
|
||||
# echo "Installing: $libdir_target/libptscotch$libname_suffix"
|
||||
mv -f "$libdir_source"/lib* "$libdir_target"
|
||||
fi
|
||||
|
||||
# Create symlinks to serial versions?
|
||||
if [ -n "$link_serial" ] && [ "${EXT_SO:-.dll}" != ".dll" ]
|
||||
then
|
||||
(
|
||||
if [ -n "$libdir_target" ]
|
||||
then
|
||||
cd "$libdir_target" || exit
|
||||
else
|
||||
cd "$libdir_source" || exit
|
||||
fi
|
||||
|
||||
for name in libscotch"$libname_suffix" libscotcherr*
|
||||
do
|
||||
if [ -f ../"$name$EXT_SO" ]
|
||||
then
|
||||
ln -sf ../"$name$EXT_SO" "$name$EXT_SO"
|
||||
fi
|
||||
done
|
||||
|
||||
for name in libscotch
|
||||
do
|
||||
if [ -f "$name$libname_suffix$EXT_SO" ]
|
||||
then
|
||||
ln -sf "$name$libname_suffix$EXT_SO" "$name$EXT_SO"
|
||||
fi
|
||||
done
|
||||
)
|
||||
fi
|
||||
|
||||
rmdir "$libdir_source" 2>/dev/null # Failed rmdir is uncritical
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
echo
|
||||
echo ========================================
|
||||
echo "scotch decomposition ($scotchPACKAGE)"
|
||||
echo " Makefile.inc : ${makefileInc##*/}"
|
||||
echo "scotch decomposition ($PACKAGE)"
|
||||
echo " Makefile.inc : ${customMakefileInc##*/}"
|
||||
|
||||
# (serial) scotch
|
||||
prefixDIR="$SCOTCH_ARCH_PATH"
|
||||
binDIR="$prefixDIR"/bin
|
||||
incDIR="$prefixDIR"/include
|
||||
libDIR="$FOAM_EXT_LIBBIN"
|
||||
bindir="$PKG_PREFIX"/bin
|
||||
includedir="$PKG_PREFIX"/include
|
||||
libdir="$FOAM_EXT_LIBBIN"
|
||||
if [ -z "$FOAM_EXT_LIBBIN" ]
|
||||
then
|
||||
libdir="$PKG_PREFIX"/lib
|
||||
fi
|
||||
|
||||
if [ "$optLabelSize" != "$WM_LABEL_SIZE" ]
|
||||
then
|
||||
echo "Using int-$optLabelSize instead of int-$WM_LABEL_SIZE"
|
||||
fi
|
||||
export WM_LABEL_SIZE="$optLabelSize"
|
||||
|
||||
# Test installation. May or may not have libscotcherrexit.so
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -f "$incDIR"/scotch.h ] \
|
||||
&& haveLibso "$libDIR"/libscotch
|
||||
&& [ -f "$includedir"/scotch.h ] \
|
||||
&& haveLibso "$libdir"/libscotch
|
||||
then
|
||||
echo " scotch include: $incDIR"
|
||||
echo " scotch library: $libDIR"
|
||||
elif [ -d "$SCOTCH_SOURCE_DIR" ]
|
||||
echo " scotch include: $includedir"
|
||||
echo " scotch library: $libdir"
|
||||
elif [ -d "$PKG_SOURCE" ]
|
||||
then
|
||||
(
|
||||
# Older versions ok, but scotch-6.0.5a cannot build in parallel.
|
||||
@ -162,38 +382,36 @@ then
|
||||
echo "*** building scotch in serial ***"
|
||||
echo
|
||||
|
||||
[ -f "$scotchMakefile" ] || {
|
||||
echo " Error: no such makefile: $scotchMakefile"
|
||||
exit 1
|
||||
}
|
||||
cd "$PKG_SOURCE/src" || exit
|
||||
|
||||
cd "$SCOTCH_SOURCE_DIR/src" || exit
|
||||
export GIT_DIR="$SCOTCH_SOURCE_DIR/.git" # Mask seeing our own git-repo
|
||||
rm -rf "$SCOTCH_ARCH_PATH"
|
||||
applyPatch "$PACKAGE" .. # patch at parent-level
|
||||
createMakefileLinks || exit
|
||||
|
||||
applyPatch "$scotchPACKAGE" .. # patch at parent-level
|
||||
|
||||
mkdir -p "$binDIR" 2>/dev/null
|
||||
mkdir -p "$incDIR" 2>/dev/null
|
||||
mkdir -p "$libDIR" 2>/dev/null
|
||||
|
||||
if [ -f "$makefileInc" ]
|
||||
then
|
||||
rm -f Makefile.inc
|
||||
ln -s "$makefileInc" Makefile.inc
|
||||
fi
|
||||
# Verify
|
||||
[ -f Makefile.inc ] || {
|
||||
echo " Error: scotch needs an appropriate Makefile.inc"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Fresh install
|
||||
rm -rf "$PKG_PREFIX"
|
||||
mkdir -p "$bindir" "$includedir" "$libdir"
|
||||
|
||||
# Temporary location for library install
|
||||
libdir_tmp="$libdir"
|
||||
if [ -n "$FOAM_EXT_LIBBIN" ]
|
||||
then
|
||||
libdir_tmp="$PKG_PREFIX"/lib-tmp
|
||||
fi
|
||||
|
||||
export CCS="$(whichCC)" # CCS (serial compiler)
|
||||
export CCP="$(whichMpicc)" # CCP (parallel compiler) default=mpicc
|
||||
|
||||
# Consistency for Intel-MPI and non-icc compilers
|
||||
[ -n "$I_MPI_CC" ] || export I_MPI_CC="$(whichCC)"
|
||||
|
||||
# The make targets
|
||||
# The make targets.
|
||||
# - according to docs, cannot make binaries with suffix renaming
|
||||
make_targets="libscotch"
|
||||
if [ "$optBinaries" = true ]
|
||||
then
|
||||
@ -203,14 +421,23 @@ then
|
||||
make realclean 2>/dev/null # Extra safety
|
||||
make -j $WM_NCOMPPROCS $make_targets \
|
||||
&& make \
|
||||
prefix="$prefixDIR" \
|
||||
bindir="$binDIR" \
|
||||
libdir="$libDIR" \
|
||||
includedir="$incDIR" \
|
||||
prefix="$PKG_PREFIX" \
|
||||
bindir="$bindir" \
|
||||
includedir="$includedir" \
|
||||
libdir="$libdir_tmp" \
|
||||
install
|
||||
|
||||
rmdir "$binDIR" 2>/dev/null || true # Remove empty bin/
|
||||
rmdir "${binDIR%/*}" 2>/dev/null || true # ... and empty parent
|
||||
install_serial "$libdir_tmp"
|
||||
|
||||
sharedir="$PKG_PREFIX/share"
|
||||
if [ "$optBinaries" = false ]
|
||||
then
|
||||
rm -rf "$sharedir/man" # No bins -> no manpages
|
||||
fi
|
||||
|
||||
rmdir "$bindir" 2>/dev/null || true # Remove empty bin/
|
||||
rmdir "${bindir%/*}" 2>/dev/null || true # ... and empty parent
|
||||
rmdir "$sharedir" 2>/dev/null || true # Remove empty share/
|
||||
make realclean 2>/dev/null || true # Failed cleanup is uncritical
|
||||
) || warnBuildIssues SCOTCH
|
||||
else
|
||||
@ -243,12 +470,12 @@ esac
|
||||
|
||||
# Build ptscotch if normal scotch was built (has include and library)
|
||||
# (reuse prefix/include/lib dirs set above)
|
||||
if [ -f "$incDIR"/scotch.h ] \
|
||||
&& haveLibso "$libDIR"/libscotch
|
||||
if [ -f "$includedir"/scotch.h ] \
|
||||
&& haveLibso "$libdir"/libscotch
|
||||
then
|
||||
echo
|
||||
echo ========================================
|
||||
echo "pt-scotch decomposition ($scotchPACKAGE with $FOAM_MPI)"
|
||||
echo "pt-scotch decomposition ($PACKAGE with $FOAM_MPI)"
|
||||
else
|
||||
# Report that the above tests failed and pass-through the failure
|
||||
echo "Skipping pt-scotch - no <scotch.h> found"
|
||||
@ -256,81 +483,96 @@ else
|
||||
fi
|
||||
|
||||
# (parallel) pt-scotch
|
||||
prefixDIR="$SCOTCH_ARCH_PATH"
|
||||
binDIR="$prefixDIR/bin/$FOAM_MPI"
|
||||
incDIR="$prefixDIR/include/$FOAM_MPI"
|
||||
libDIR="$FOAM_EXT_LIBBIN/$FOAM_MPI"
|
||||
bindir="$PKG_PREFIX/bin/$FOAM_MPI"
|
||||
includedir="$PKG_PREFIX/include/$FOAM_MPI"
|
||||
libdir="$FOAM_EXT_LIBBIN/$FOAM_MPI"
|
||||
if [ -z "$FOAM_EXT_LIBBIN" ]
|
||||
then
|
||||
libdir="$PKG_PREFIX/lib/$FOAM_MPI"
|
||||
fi
|
||||
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -f "$incDIR"/ptscotch.h ] \
|
||||
&& haveLibso "$libDIR"/libptscotch
|
||||
&& [ -f "$includedir"/ptscotch.h ] \
|
||||
&& haveLibso "$libdir"/libptscotch
|
||||
then
|
||||
echo " ptscotch include: $incDIR"
|
||||
echo " ptscotch library: $libDIR"
|
||||
echo " ptscotch include: $includedir"
|
||||
echo " ptscotch library: $libdir"
|
||||
else
|
||||
(
|
||||
# Older versions ok, but scotch-6.0.5a cannot build in parallel.
|
||||
# Force serial build
|
||||
export WM_NCOMPPROCS=1
|
||||
echo "*** building pt-scotch in serial ***"
|
||||
|
||||
[ -f "$scotchMakefile" ] || {
|
||||
echo " Error: no such makefile: $scotchMakefile"
|
||||
exit 1
|
||||
}
|
||||
|
||||
cd "$SCOTCH_SOURCE_DIR/src" || exit
|
||||
export GIT_DIR="$SCOTCH_SOURCE_DIR/.git" # Mask seeing our own git-repo
|
||||
echo
|
||||
|
||||
mkdir -p "$binDIR" 2>/dev/null
|
||||
mkdir -p "$incDIR" 2>/dev/null
|
||||
mkdir -p "$libDIR" 2>/dev/null
|
||||
cd "$PKG_SOURCE/src" || exit
|
||||
createMakefileLinks || exit
|
||||
|
||||
if [ -f "$makefileInc" ]
|
||||
then
|
||||
rm -f Makefile.inc
|
||||
ln -s "$makefileInc" Makefile.inc
|
||||
fi
|
||||
# Verify
|
||||
[ -f Makefile.inc ] || {
|
||||
echo " Error: ptscotch needs an appropriate Makefile.inc"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Install into existing prefix
|
||||
mkdir -p "$bindir" "$includedir" "$libdir"
|
||||
|
||||
# Temporary location for library install
|
||||
libdir_tmp="$libdir"
|
||||
if [ -n "$FOAM_EXT_LIBBIN" ]
|
||||
then
|
||||
libdir_tmp="$PKG_PREFIX"/lib-tmp
|
||||
fi
|
||||
|
||||
export CCS="$(whichCC)" # CCS (serial compiler)
|
||||
export CCP="$(whichMpicc)" # CCP (parallel compiler) default=mpicc
|
||||
|
||||
# Consistency for Intel-MPI and non-icc compilers
|
||||
[ -n "$I_MPI_CC" ] || export I_MPI_CC="$(whichCC)"
|
||||
|
||||
# The make targets. No simple means of handling mpi-specific binaries
|
||||
# The make targets.
|
||||
# - no simple means of handling mpi-specific binaries
|
||||
# - according to docs, cannot make binaries with suffix renaming
|
||||
make_targets="libptscotch"
|
||||
if [ "$optBinaries" = true ]
|
||||
then
|
||||
make_targets="$make_targets ptscotch"
|
||||
fi
|
||||
|
||||
# Remove any old symlinks etc
|
||||
rm -rf "$includedir"/scotch*.h 2>/dev/null
|
||||
rm -rf "$libdir"/libscotch*.so 2>/dev/null
|
||||
|
||||
make realclean 2>/dev/null # Extra safety
|
||||
make -j $WM_NCOMPPROCS $make_targets \
|
||||
&& make \
|
||||
prefix="$prefixDIR" \
|
||||
bindir="$binDIR" \
|
||||
libdir="$libDIR" \
|
||||
includedir="$incDIR" \
|
||||
prefix="$PKG_PREFIX" \
|
||||
bindir="$bindir" \
|
||||
includedir="$includedir" \
|
||||
libdir="$libdir_tmp" \
|
||||
install
|
||||
|
||||
rmdir "$binDIR" 2>/dev/null || true # Remove empty bin/
|
||||
rmdir "${binDIR%/*}" 2>/dev/null || true # ... and empty parent
|
||||
install_parallel "$libdir_tmp"
|
||||
|
||||
sharedir="$PKG_PREFIX/share"
|
||||
if [ "$optBinaries" = false ]
|
||||
then
|
||||
rm -rf "$sharedir/man" # No bins -> no manpages
|
||||
fi
|
||||
|
||||
rmdir "$bindir" 2>/dev/null || true # Remove empty bin/
|
||||
rmdir "${bindir%/*}" 2>/dev/null || true # ... and empty parent
|
||||
rmdir "$sharedir" 2>/dev/null || true # Remove empty share/
|
||||
make realclean 2>/dev/null || true # Failed cleanup is uncritical
|
||||
) || warnBuildIssues PTSCOTCH
|
||||
fi
|
||||
|
||||
# Verify existence of ptscotch include
|
||||
[ -f "$SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h" ] || {
|
||||
[ -f "$PKG_PREFIX/include/$FOAM_MPI/ptscotch.h" ] || {
|
||||
echo
|
||||
echo " WARNING: required include file 'ptscotch.h' not found!"
|
||||
}
|
||||
|
||||
# Could now remove $SCOTCH_SOURCE_DIR/src/Makefile.inc
|
||||
# Could remove $PKG_SOURCE/src/Makefile.inc, but leave for documentation
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
71
makeVTK
71
makeVTK
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -27,21 +27,21 @@
|
||||
# ----------------------------------------------
|
||||
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
. etc/tools/ThirdPartyFunctions
|
||||
. etc/tools/ParaViewFunctions
|
||||
. etc/tools/vtkFunctions
|
||||
if : # Run from third-party directory
|
||||
then
|
||||
cd "${0%/*}" || exit
|
||||
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ParaViewFunctions
|
||||
. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/vtkFunctions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
unset vtk_version mesa_version # Purge current values
|
||||
|
||||
# vtk version from OpenFOAM etc/config.sh file:
|
||||
# Obtain version from OpenFOAM etc/config.sh file:
|
||||
unset vtk_version mesa_version # Purge current values
|
||||
_foamConfig vtk
|
||||
|
||||
VTK_VERSION="$vtk_version"
|
||||
@ -53,17 +53,21 @@ case "$VTK_VERSION" in
|
||||
esac
|
||||
VTK_VERSION="${VTK_VERSION%%-*}" # Without suffix (eg, -mesa)
|
||||
|
||||
|
||||
# New rendering backend (starting with vtk 7?).
|
||||
withGL2=auto # auto-config based on version
|
||||
|
||||
# Hint for cmake findMPI
|
||||
if [ -d "$MPI_ARCH_PATH" ]
|
||||
then
|
||||
export MPI_HOME="$MPI_ARCH_PATH"
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printVersions() { listPackageVersions vtk; exit 0; }
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [vtk-VERSION] [CMAKE-OPTION]
|
||||
Usage: ${0##*/} [OPTION] [vtk-VERSION] [CMAKE-OPTION]
|
||||
options:
|
||||
-gcc Force use of gcc/g++
|
||||
-cmake PATH with cmake from the given path
|
||||
@ -76,11 +80,14 @@ options:
|
||||
-osmesa with off-screen mesa only
|
||||
-mpi with mpi (VTK_Group_MPI=ON)
|
||||
-mpi=N with max 'N' mpi processes. N=0 for no upper-limit.
|
||||
-mpi-home PATH with mpi and hint for MPI_HOME
|
||||
-verbose verbose output in Makefiles
|
||||
-version VER specify an alternative version (current: $VTK_VERSION)
|
||||
-buildType NAME specify the build type (default: Release)
|
||||
-suffix NAME specify a suffix to distinguish the build
|
||||
-help
|
||||
-DNAME=VALUE add cmake variable
|
||||
-list List available unpacked source versions
|
||||
-help Display usage help
|
||||
|
||||
The -no-FEATURE option can be used to forcibly disable these features:
|
||||
-no-gl2 | -no-mesa | -no-mpi
|
||||
@ -102,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
|
||||
|
||||
USAGE
|
||||
# showDownloadHint VTK
|
||||
exit 1
|
||||
# showDownloadHint vtk
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
exportCompiler minimal # Minimal compiler info for CMake/configure
|
||||
@ -117,13 +124,16 @@ while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
'') ;; # Ignore empty
|
||||
-h | -help) usage ;;
|
||||
-h | -help*) printHelp;;
|
||||
-list) printVersions;;
|
||||
-gcc) useGcc ;;
|
||||
|
||||
[0-9]* | vtk-[0-9]* | VTK-[0-9]*) # VTK version
|
||||
setVtkVersion "${1%%/}"
|
||||
# VTK version
|
||||
paraview/* | vtk/* | sources/paraview* | sources/vtk* |\
|
||||
[0-9]* | vtk-[0-9]* | VTK-[0-9]*)
|
||||
setVtkVersion "$(basename "$1")"
|
||||
;;
|
||||
[A-Z]*=*) # cmake variables
|
||||
-D[A-Z]*=* | [A-Z]*=*) # cmake variables
|
||||
addCMakeVariable "$1"
|
||||
;;
|
||||
-patch) # stage 0: patch sources
|
||||
@ -204,6 +214,13 @@ do
|
||||
withMPI=true
|
||||
MPI_MAX_PROCS="${1##*=}"
|
||||
;;
|
||||
-mpi-home) # mpi with hint
|
||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||
withMPI=true
|
||||
export MPI_HOME="${2%%/}"
|
||||
case "${MPI_HOME:-none}" in (false|none) unset MPI_HOME;; esac
|
||||
shift
|
||||
;;
|
||||
-no-mpi)
|
||||
withMPI=false
|
||||
;;
|
||||
|
||||
51
minCmake
51
minCmake
@ -6,7 +6,7 @@
|
||||
# \\ / A nd | www.openfoam.com
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# 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
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
usage() {
|
||||
exec 1>&2
|
||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||
printHelp() {
|
||||
cat<<USAGE
|
||||
|
||||
usage: ${0##*/} [OPTION] [dir1 ... dirN]
|
||||
Usage: ${0##*/} [OPTION] [dir1 ... dirN]
|
||||
options:
|
||||
-help
|
||||
|
||||
@ -41,18 +39,17 @@ options:
|
||||
* Without any arguments, select all first level directories.
|
||||
|
||||
USAGE
|
||||
exit 1
|
||||
exit 0 # Clean exit
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
-h | -help*) printHelp;;
|
||||
-*)
|
||||
usage "unknown option: '$1'"
|
||||
echo "$0: Error unknown option: '$1'" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
break
|
||||
@ -62,22 +59,50 @@ do
|
||||
done
|
||||
|
||||
# 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
|
||||
do
|
||||
dir="${dir#./}" # Remove leading "./"
|
||||
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 \
|
||||
-e 's/^.*cmake_minimum.*VERSION *\([0-9.][0-9.]*\).*/\1/p' \
|
||||
"$dir/CMakeLists.txt" \
|
||||
"$file" \
|
||||
2>/dev/null | head -1)
|
||||
|
||||
if [ -n "$min" ]
|
||||
then
|
||||
# Remove trailing ".0" from version
|
||||
echo "${min%.0}" "${dir#sources/}"
|
||||
echo "${min%.0}" "$dir"
|
||||
fi
|
||||
|
||||
done \
|
||||
|
||||
Reference in New Issue
Block a user