mirror of
https://develop.openfoam.com/Development/ThirdParty-common.git
synced 2025-12-08 06:57:50 +00:00
COMP: skip build of ADIOS2 examples
- may fail to find mpi.h with ThirdParty openmpi - remove makeAdios1 (ADIOS1 considered defunct for our purposes)
This commit is contained in:
2
BUILD.md
2
BUILD.md
@ -516,7 +516,7 @@ easier to use `grep` and find the relevant pages and links.
|
|||||||
|
|
||||||
|
|
||||||
<!-- parallel -->
|
<!-- parallel -->
|
||||||
[page adios]: https://csmd.ornl.gov/adios2
|
[page adios]: https://csmd.ornl.gov/software/adios2
|
||||||
[repo adios]: https://github.com/ornladios/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.4.0.tar.gz
|
||||||
|
|
||||||
|
|||||||
365
makeAdios1
365
makeAdios1
@ -1,365 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# ========= |
|
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
# \\ / O peration |
|
|
||||||
# \\ / A nd | www.openfoam.com
|
|
||||||
# \\/ M anipulation |
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# Copyright (C) 2016-2019 OpenCFD Ltd.
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# License
|
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
# Script
|
|
||||||
# makeAdios1
|
|
||||||
#
|
|
||||||
# Description
|
|
||||||
# Build script for ADIOS1
|
|
||||||
#
|
|
||||||
# ----------------------------------------------
|
|
||||||
# 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
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# ADIOS version from OpenFOAM etc/config.sh file:
|
|
||||||
_foamConfig adios1
|
|
||||||
|
|
||||||
adiosPACKAGE=${adios1_version:-adios-none}
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
usage() {
|
|
||||||
exec 1>&2
|
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
|
||||||
|
|
||||||
usage: ${0##*/} [OPTION] [adios-VERSION] [-- configure-options]
|
|
||||||
options:
|
|
||||||
-gcc Force use of gcc/g++
|
|
||||||
-cmake PATH With cmake from the given path
|
|
||||||
-help
|
|
||||||
|
|
||||||
* Build ADIOS
|
|
||||||
$adiosPACKAGE
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
exportCompiler minimal # Minimal compiler info for CMake/configure
|
|
||||||
|
|
||||||
# Parse options
|
|
||||||
while [ "$#" -gt 0 ]
|
|
||||||
do
|
|
||||||
case "$1" in
|
|
||||||
'') ;; # Ignore empty
|
|
||||||
--) break;; # Extra configure options (leave on $@ for later detection)
|
|
||||||
-h | -help) usage ;;
|
|
||||||
-gcc) useGcc ;;
|
|
||||||
|
|
||||||
-cmake)
|
|
||||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
|
||||||
CMAKE_PATH="${2%%/}"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
ADIOS1-[1-9]* | ADIOS1-git* | ADIOS-[1-9]* | ADIOS-git*)
|
|
||||||
adiosPACKAGE="${1%%/}"
|
|
||||||
;;
|
|
||||||
adios1-[1-9]* | adios1-git* | adios-[1-9]* | adios-git*)
|
|
||||||
adiosPACKAGE="${1%%/}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
die "unknown option/argument: '$1'"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
[ -n "$adiosPACKAGE" ] || die "The adios-VERSION was not specified"
|
|
||||||
|
|
||||||
# Nothing to build
|
|
||||||
if _foamIsNone "$adiosPACKAGE"
|
|
||||||
then
|
|
||||||
echo "Using adios-none (skip ThirdParty build of ADIOS)"
|
|
||||||
exit 0
|
|
||||||
elif _foamIsSystem "$adiosPACKAGE"
|
|
||||||
then
|
|
||||||
echo "Using adios-system"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Build ADIOS
|
|
||||||
# ADIOS1_SOURCE_DIR : location of the original sources
|
|
||||||
# ADIOS1_ARCH_PATH : installation directory
|
|
||||||
|
|
||||||
ADIOS1_SOURCE_DIR=$sourceBASE/$adiosPACKAGE
|
|
||||||
ADIOS1_ARCH_PATH=$installBASE/$adiosPACKAGE
|
|
||||||
|
|
||||||
: ${FOAM_MPI:=dummy}
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo ========================================
|
|
||||||
echo "Build adios library $adiosPACKAGE for $FOAM_MPI"
|
|
||||||
echo
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Manual adjustments to adios config
|
|
||||||
#
|
|
||||||
adjustADIOS()
|
|
||||||
{
|
|
||||||
# Rename libraries according to FOAM_MPI
|
|
||||||
(
|
|
||||||
cd "$ADIOS1_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" || exit
|
|
||||||
|
|
||||||
if [ "$FOAM_MPI" != dummy ]
|
|
||||||
then
|
|
||||||
\mv -f libadios.a libadios_$FOAM_MPI.a
|
|
||||||
\mv -f libadiosread.a libadiosread_$FOAM_MPI.a
|
|
||||||
fi
|
|
||||||
\mv -f libadios_nompi.a libadios_dummy.a
|
|
||||||
\mv -f libadiosread_nompi.a libadiosread_dummy.a
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "ADIOS library renamed to libadios_$FOAM_MPI"
|
|
||||||
echo
|
|
||||||
)
|
|
||||||
|
|
||||||
# We don't need/use XML things
|
|
||||||
\rm -f $ADIOS1_ARCH_PATH/bin/adios_lint
|
|
||||||
|
|
||||||
# Replace resolved paths with variables
|
|
||||||
echo "Adjust prefix for ADIOS"
|
|
||||||
for i in \
|
|
||||||
$ADIOS1_ARCH_PATH/bin/adios_config \
|
|
||||||
$ADIOS1_ARCH_PATH/etc/adios_config.flags \
|
|
||||||
;
|
|
||||||
do
|
|
||||||
[ -f "$i" ] || {
|
|
||||||
echo " no such file - '$i'"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if sed -i -e 's|'"$WM_THIRD_PARTY_DIR"'|$WM_THIRD_PARTY_DIR|g' $i
|
|
||||||
then
|
|
||||||
echo " '$i'"
|
|
||||||
else
|
|
||||||
echo " problems with '$i'"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Adjust the config flags file:
|
|
||||||
# * Remove references to Fortran libraries (disabled in configure)
|
|
||||||
# * Remove references to deprecated version 1 API
|
|
||||||
# * Cleanup excessive whitespace
|
|
||||||
# * Handle renamed libraries:
|
|
||||||
# - libadios -> libadios_$FOAM_MPI
|
|
||||||
# - libadios_nompi -> libadios_dummy
|
|
||||||
#
|
|
||||||
echo "Adjust library names for ADIOS"
|
|
||||||
for i in \
|
|
||||||
$ADIOS1_ARCH_PATH/etc/adios_config.flags \
|
|
||||||
;
|
|
||||||
do
|
|
||||||
[ -f "$i" ] || {
|
|
||||||
echo " no such file - '$i'"
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if sed -i \
|
|
||||||
-e '/_FLIB=/d' \
|
|
||||||
-e '/_V1_INC=/d' \
|
|
||||||
-e 's| *| |g' \
|
|
||||||
-e 's|\(-ladios[a-z]*_\)nompi |\1dummy |g' \
|
|
||||||
$i
|
|
||||||
then
|
|
||||||
echo " '$i'"
|
|
||||||
else
|
|
||||||
echo " problems with '$i'"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$FOAM_MPI" != dummy ]
|
|
||||||
then
|
|
||||||
sed -i -e 's|\(-ladios[a-z]*\) |\1_'"$FOAM_MPI |g" $i || \
|
|
||||||
echo " problems with '$i'"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
|
||||||
# List ADIOS methods/configuration
|
|
||||||
#
|
|
||||||
listMethods()
|
|
||||||
{
|
|
||||||
[ -f $ADIOS1_ARCH_PATH/bin/adios_config ] || {
|
|
||||||
echo "Warning: no adios_config"
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "==============="
|
|
||||||
|
|
||||||
# May have problems listing parallel methods (eg, transport key missing)
|
|
||||||
if $ADIOS1_ARCH_PATH/bin/adios_config -m >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
$ADIOS1_ARCH_PATH/bin/adios_config -m 2>/dev/null
|
|
||||||
else
|
|
||||||
echo "Warning: could not list parallel methods"
|
|
||||||
# Fallback to serial methods
|
|
||||||
$ADIOS1_ARCH_PATH/bin/adios_config -s -m 2>/dev/null
|
|
||||||
fi || echo "Warning: could not list configured methods"
|
|
||||||
echo "==============="
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Needs future adjustment
|
|
||||||
# - for shared library
|
|
||||||
# - for mpi-specific library locations
|
|
||||||
if [ -f $ADIOS1_ARCH_PATH/include/adios.h \
|
|
||||||
-a -r $ADIOS1_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios_${FOAM_MPI}.a ]
|
|
||||||
then
|
|
||||||
echo " ADIOS header in $ADIOS1_ARCH_PATH/include"
|
|
||||||
### echo " ADIOS libs in $FOAM_EXT_LIBBIN" # dynamic
|
|
||||||
echo " ADIOS libs in $ADIOS1_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static
|
|
||||||
listMethods
|
|
||||||
elif [ -z "$CMAKE_PATH" ]
|
|
||||||
then
|
|
||||||
echo "Starting build: $adiosPACKAGE (using configure)"
|
|
||||||
echo
|
|
||||||
(
|
|
||||||
# Configuration options:
|
|
||||||
unset configOpt
|
|
||||||
|
|
||||||
# Add InfiniBand support
|
|
||||||
ibDir=/usr/local/ofed
|
|
||||||
if [ -d "$ibDir" -a "$FOAM_MPI" != dummy ]
|
|
||||||
then
|
|
||||||
configOpt="$configOpt --with-infiniband=$ibDir"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Transport layers
|
|
||||||
if [ -f /usr/include/bzlib.h ]
|
|
||||||
then
|
|
||||||
configOpt="$configOpt --with-bzip2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /usr/include/zlib.h ]
|
|
||||||
then
|
|
||||||
configOpt="$configOpt --with-zlib"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Other types of support
|
|
||||||
## configOpt="$configOpt --with-hdf5=..."
|
|
||||||
## configOpt="$configOpt --with-lustre=..."
|
|
||||||
## configOpt="$configOpt --enable-research-transports"
|
|
||||||
|
|
||||||
# Additional configure options
|
|
||||||
if [ "$1" = "--" ]
|
|
||||||
then
|
|
||||||
shift
|
|
||||||
configOpt="$configOpt $@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# End of configuration options
|
|
||||||
# ----------------------------
|
|
||||||
buildDIR=$buildBASE/$adiosPACKAGE
|
|
||||||
|
|
||||||
cd "$ADIOS1_SOURCE_DIR" || exit
|
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
|
|
||||||
[ -e Makefile ] && make distclean 2>/dev/null
|
|
||||||
|
|
||||||
applyPatch $adiosPACKAGE $ADIOS1_SOURCE_DIR
|
|
||||||
|
|
||||||
# Remove any existing build folder and recreate
|
|
||||||
rm -rf $ADIOS1_ARCH_DIR
|
|
||||||
rm -rf $buildDIR 2>/dev/null
|
|
||||||
mkdir -p $buildDIR
|
|
||||||
|
|
||||||
[ -f configure ] || {
|
|
||||||
echo "no configure for $adiosPACKAGE ... trying autogen"
|
|
||||||
./autogen.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
# May not work properly with FOAM_MPI = dummy
|
|
||||||
if [ "$FOAM_MPI" = dummy ]
|
|
||||||
then
|
|
||||||
configOpt="$configOpt --without-mpi"
|
|
||||||
else
|
|
||||||
CC=mpicc
|
|
||||||
CXX=mpicxx
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install into lib64/
|
|
||||||
cd $buildDIR && $ADIOS1_SOURCE_DIR/configure \
|
|
||||||
--prefix=$ADIOS1_ARCH_PATH \
|
|
||||||
--libdir=$ADIOS1_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
|
||||||
--disable-fortran \
|
|
||||||
--with-pic \
|
|
||||||
--without-fastbit \
|
|
||||||
$configOpt \
|
|
||||||
&& make -j $WM_NCOMPPROCS all \
|
|
||||||
&& make install \
|
|
||||||
&& echo "Built: $adiosPACKAGE" \
|
|
||||||
&& adjustADIOS \
|
|
||||||
&& listMethods
|
|
||||||
) || {
|
|
||||||
echo "Error building: $adiosPACKAGE"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
# CMake options often lag the configure ones
|
|
||||||
echo "Starting build: $adiosPACKAGE (using cmake)"
|
|
||||||
echo
|
|
||||||
(
|
|
||||||
buildDIR=$buildBASE/$adiosPACKAGE
|
|
||||||
cd "$ADIOS1_SOURCE_DIR" || exit
|
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
|
||||||
|
|
||||||
applyPatch $adiosPACKAGE $ADIOS1_SOURCE_DIR
|
|
||||||
|
|
||||||
# Remove any existing build folder and recreate
|
|
||||||
rm -rf $ADIOS1_ARCH_DIR
|
|
||||||
rm -rf $buildDIR 2>/dev/null
|
|
||||||
mkdir -p $buildDIR
|
|
||||||
|
|
||||||
# May not work properly with FOAM_MPI = dummy
|
|
||||||
if [ "$FOAM_MPI" = dummy ]
|
|
||||||
then
|
|
||||||
configOpt="$configOpt --without-mpi"
|
|
||||||
else
|
|
||||||
CC=mpicc
|
|
||||||
CXX=mpicxx
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmake=$(findCMake)
|
|
||||||
|
|
||||||
# Install into lib64/
|
|
||||||
cd $buildDIR && $cmake \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=$ADIOS1_ARCH_PATH \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DBUILD_FORTRAN=FALSE \
|
|
||||||
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
|
||||||
$ADIOS1_SOURCE_DIR \
|
|
||||||
&& make -j $WM_NCOMPPROCS all \
|
|
||||||
&& make install \
|
|
||||||
&& echo "Built: $adiosPACKAGE" \
|
|
||||||
&& adjustADIOS \
|
|
||||||
&& listMethods
|
|
||||||
) || {
|
|
||||||
echo "Error building: $adiosPACKAGE"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
@ -5,11 +5,10 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2018-2019 OpenCFD Ltd.
|
# Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# makeAdios2
|
# makeAdios2
|
||||||
@ -165,6 +164,7 @@ else
|
|||||||
-DCMAKE_INSTALL_PREFIX=$ADIOS2_ARCH_PATH \
|
-DCMAKE_INSTALL_PREFIX=$ADIOS2_ARCH_PATH \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DADIOS2_USE_Fortran=FALSE \
|
-DADIOS2_USE_Fortran=FALSE \
|
||||||
|
-DADIOS2_BUILD_EXAMPLES=FALSE \
|
||||||
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \
|
||||||
$ADIOS2_SOURCE_DIR \
|
$ADIOS2_SOURCE_DIR \
|
||||||
&& make -j $WM_NCOMPPROCS all \
|
&& make -j $WM_NCOMPPROCS all \
|
||||||
|
|||||||
Reference in New Issue
Block a user