ENH: add etc/tools support for hierarchically named sources

This commit is contained in:
Mark Olesen
2021-09-27 10:18:57 +02:00
parent 665437cf8c
commit 1f6835794f
15 changed files with 771 additions and 282 deletions

10
.gitignore vendored
View File

@ -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

View File

@ -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]
```
---

149
SOURCES.md Normal file
View File

@ -0,0 +1,149 @@
Third-party software (shipped) versions according to OpenFOAM version
# 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
---

View File

@ -1,156 +0,0 @@
Third-party software versions for recent OpenFOAM versions
OpenFOAM-2106
---------------
ADIOS-2.6.0
CGAL-4.12.2
ParaView-5.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
---------------
ADIOS-2.6.0 *update*
CGAL-4.12.2
ParaView-5.6.3
boost_1_66_0
fftw-3.3.7
openmpi-4.0.3
scotch_6.0.9
kahip-2.12
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
View 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
View 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
View 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"
#------------------------------------------------------------------------------

View File

@ -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"

View File

@ -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"

View File

@ -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"
# -----------------------------------------------------------------------------

View File

@ -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
#------------------------------------------------------------------------------

View File

@ -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"
}
@ -411,7 +430,7 @@ ERROR
#
patchParaView()
{
applyPatch "paraview-$ParaView_VERSION" "$ParaView_SOURCE_DIR"
applyPatch "paraview-$ParaView_VERSION" "$PARAVIEW_SOURCEDIR"
}
@ -423,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)"
@ -442,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"
}
@ -471,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"
@ -490,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

View File

@ -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"
}

View File

@ -28,15 +28,13 @@
# 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}"
@ -368,18 +366,163 @@ 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" \
"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 . 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
}
@ -794,23 +937,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
#
@ -820,9 +963,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
}

View File

@ -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"
}
@ -181,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
@ -198,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