From 54d6b7994d4d0fa3796a24bf6b40224290561b2f Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 31 Jul 2019 14:28:53 +0200 Subject: [PATCH] CONFIG: harmonize makeAdios1, makeAdios2 files - remove old dependency of adios2 on the adios1 library --- BUILD.md | 2 +- makeADIOS => makeAdios1 | 73 +++++++++++++++++++++------------------- makeADIOS2 => makeAdios2 | 52 ++++++++++++---------------- 3 files changed, 60 insertions(+), 67 deletions(-) rename makeADIOS => makeAdios1 (81%) rename makeADIOS2 => makeAdios2 (77%) diff --git a/BUILD.md b/BUILD.md index 24375ef..c035b94 100644 --- a/BUILD.md +++ b/BUILD.md @@ -154,7 +154,7 @@ export GMP_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mp #### Optional Components -`makeADIOS` +`makeAdios1` `makeAdios2` - Only required for [ADIOS](#parallel) support, which is currently staged in the [add-ons repository][link AddOns]. diff --git a/makeADIOS b/makeAdios1 similarity index 81% rename from makeADIOS rename to makeAdios1 index 238d2a9..8218610 100755 --- a/makeADIOS +++ b/makeAdios1 @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -11,10 +11,10 @@ # . # # Script -# makeADIOS +# makeAdios1 # # Description -# Build script for ADIOS +# Build script for ADIOS1 # # ---------------------------------------------- # NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE @@ -29,9 +29,9 @@ cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || { #------------------------------------------------------------------------------ # ADIOS version from OpenFOAM etc/config.sh file: -_foamConfig ADIOS +_foamConfig adios1 -adiosPACKAGE=${adios_version:-adios-none} +adiosPACKAGE=${adios1_version:-adios-none} #------------------------------------------------------------------------------ usage() { @@ -52,7 +52,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -exportCompiler true # Compiler info + flags for CMake/configure +exportCompiler minimal # Minimal compiler info for CMake/configure # Parse options while [ "$#" -gt 0 ] @@ -68,7 +68,10 @@ do CMAKE_PATH="${2%%/}" shift ;; - ADIOS-[1-9]* | adios-[1-9]* | ADIOS-git* | adios-git*) + ADIOS1-[1-9]* | ADIOS1-git* | ADIOS-[1-9]* | ADIOS-git*) + adiosPACKAGE="${1%%/}" + ;; + adios1-[1-9]* | adios1-git* | adios-[1-9]* | adios-git*) adiosPACKAGE="${1%%/}" ;; @@ -95,11 +98,11 @@ fi #------------------------------------------------------------------------------ # # Build ADIOS -# ADIOS_SOURCE_DIR : location of the original sources -# ADIOS_ARCH_PATH : installation directory +# ADIOS1_SOURCE_DIR : location of the original sources +# ADIOS1_ARCH_PATH : installation directory -ADIOS_SOURCE_DIR=$sourceBASE/$adiosPACKAGE -ADIOS_ARCH_PATH=$installBASE/$adiosPACKAGE +ADIOS1_SOURCE_DIR=$sourceBASE/$adiosPACKAGE +ADIOS1_ARCH_PATH=$installBASE/$adiosPACKAGE : ${FOAM_MPI:=dummy} @@ -116,7 +119,7 @@ adjustADIOS() { # Rename libraries according to FOAM_MPI ( - cd $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH || exit 1 + cd $ADIOS1_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH || exit 1 if [ "$FOAM_MPI" != dummy ] then @@ -132,13 +135,13 @@ adjustADIOS() ) # We don't need/use XML things - \rm -f $ADIOS_ARCH_PATH/bin/adios_lint + \rm -f $ADIOS1_ARCH_PATH/bin/adios_lint # Replace resolved paths with variables echo "Adjust prefix for ADIOS" for i in \ - $ADIOS_ARCH_PATH/bin/adios_config \ - $ADIOS_ARCH_PATH/etc/adios_config.flags \ + $ADIOS1_ARCH_PATH/bin/adios_config \ + $ADIOS1_ARCH_PATH/etc/adios_config.flags \ ; do [ -f "$i" ] || { @@ -163,7 +166,7 @@ adjustADIOS() # echo "Adjust library names for ADIOS" for i in \ - $ADIOS_ARCH_PATH/etc/adios_config.flags \ + $ADIOS1_ARCH_PATH/etc/adios_config.flags \ ; do [ -f "$i" ] || { @@ -196,7 +199,7 @@ adjustADIOS() # listMethods() { - [ -f $ADIOS_ARCH_PATH/bin/adios_config ] || { + [ -f $ADIOS1_ARCH_PATH/bin/adios_config ] || { echo "Warning: no adios_config" return 1 } @@ -204,13 +207,13 @@ listMethods() echo "===============" # May have problems listing parallel methods (eg, transport key missing) - if $ADIOS_ARCH_PATH/bin/adios_config -m >/dev/null 2>&1 + if $ADIOS1_ARCH_PATH/bin/adios_config -m >/dev/null 2>&1 then - $ADIOS_ARCH_PATH/bin/adios_config -m 2>/dev/null + $ADIOS1_ARCH_PATH/bin/adios_config -m 2>/dev/null else echo "Warning: could not list parallel methods" # Fallback to serial methods - $ADIOS_ARCH_PATH/bin/adios_config -s -m 2>/dev/null + $ADIOS1_ARCH_PATH/bin/adios_config -s -m 2>/dev/null fi || echo "Warning: could not list configured methods" echo "===============" @@ -220,12 +223,12 @@ listMethods() # Needs future adjustment # - for shared library # - for mpi-specific library locations -if [ -f $ADIOS_ARCH_PATH/include/adios.h \ - -a -r $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios_${FOAM_MPI}.a ] +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 $ADIOS_ARCH_PATH/include" + echo " ADIOS header in $ADIOS1_ARCH_PATH/include" ### echo " ADIOS libs in $FOAM_EXT_LIBBIN" # dynamic - echo " ADIOS libs in $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static + echo " ADIOS libs in $ADIOS1_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static listMethods elif [ -z "$CMAKE_PATH" ] then @@ -269,15 +272,15 @@ then # ---------------------------- buildDIR=$buildBASE/$adiosPACKAGE - cd $ADIOS_SOURCE_DIR || exit 1 + cd $ADIOS1_SOURCE_DIR || exit 1 export GIT_DIR=$PWD/.git # Mask seeing our own git-repo [ -e Makefile ] && make distclean 2>/dev/null - applyPatch $adiosPACKAGE $ADIOS_SOURCE_DIR + applyPatch $adiosPACKAGE $ADIOS1_SOURCE_DIR # Remove any existing build folder and recreate - rm -rf $ADIOS_ARCH_DIR + rm -rf $ADIOS1_ARCH_DIR rm -rf $buildDIR 2>/dev/null mkdir -p $buildDIR @@ -296,9 +299,9 @@ then fi # Install into lib64/ - cd $buildDIR && $ADIOS_SOURCE_DIR/configure \ - --prefix=$ADIOS_ARCH_PATH \ - --libdir=$ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \ + 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 \ @@ -317,13 +320,13 @@ else echo ( buildDIR=$buildBASE/$adiosPACKAGE - cd $ADIOS_SOURCE_DIR || exit 1 + cd $ADIOS1_SOURCE_DIR || exit 1 export GIT_DIR=$PWD/.git # Mask seeing our own git-repo - applyPatch $adiosPACKAGE $ADIOS_SOURCE_DIR + applyPatch $adiosPACKAGE $ADIOS1_SOURCE_DIR # Remove any existing build folder and recreate - rm -rf $ADIOS_ARCH_DIR + rm -rf $ADIOS1_ARCH_DIR rm -rf $buildDIR 2>/dev/null mkdir -p $buildDIR @@ -340,11 +343,11 @@ else # Install into lib64/ cd $buildDIR && $cmake \ - -DCMAKE_INSTALL_PREFIX=$ADIOS_ARCH_PATH \ + -DCMAKE_INSTALL_PREFIX=$ADIOS1_ARCH_PATH \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_FORTRAN=FALSE \ ${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \ - $ADIOS_SOURCE_DIR \ + $ADIOS1_SOURCE_DIR \ && make -j $WM_NCOMPPROCS all \ && make install \ && echo "Built: $adiosPACKAGE" \ diff --git a/makeADIOS2 b/makeAdios2 similarity index 77% rename from makeADIOS2 rename to makeAdios2 index 1cd1cf7..0ac4235 100755 --- a/makeADIOS2 +++ b/makeAdios2 @@ -3,14 +3,14 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # This file is part of OpenFOAM, licensed under the GNU General Public License # . # # Script -# makeADIOS2 +# makeAdios2 # # Description # Build script for ADIOS2 @@ -27,9 +27,9 @@ cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || { . etc/tools/ThirdPartyFunctions #------------------------------------------------------------------------------ # ADIOS2 version from OpenFOAM etc/config.sh file: -_foamConfig ADIOS2 +_foamConfig adios2 -adios2PACKAGE=${adios2_version:-adios-none} +adiosPACKAGE=${adios2_version:-adios-none} #------------------------------------------------------------------------------ usage() { @@ -44,13 +44,13 @@ options: -help * Build ADIOS2 - $adios2PACKAGE + $adiosPACKAGE USAGE exit 1 } #------------------------------------------------------------------------------ -exportCompiler true # Compiler info + flags for CMake/configure +exportCompiler minimal # Minimal compiler info for CMake/configure # Parse options while [ "$#" -gt 0 ] @@ -65,8 +65,11 @@ do CMAKE_PATH="${2%%/}" shift ;; - ADIOS2-[1-9]* | adios2-[1-9]* | ADIOS2-git* | adios2-git*) - adios2PACKAGE="${1%%/}" + ADIOS2-[1-9]* | ADIOS2-git* | adios-[1-9]* | ADIOS-git*) + adiosPACKAGE="${1%%/}" + ;; + adios2-[1-9]* | adios2-git* | adios-[1-9]* | adios-git*) + adiosPACKAGE="${1%%/}" ;; *) die "unknown option/argument: '$1'" @@ -75,14 +78,14 @@ do shift done -[ -n "$adios2PACKAGE" ] || die "The adios2-VERSION was not specified" +[ -n "$adiosPACKAGE" ] || die "The adios2-VERSION was not specified" # nothing to build -if _foamIsNone "$adios2PACKAGE" +if _foamIsNone "$adiosPACKAGE" then echo "Using adios-none (skip ThirdParty build of ADIOS)" exit 0 -elif _foamIsSystem "$adios2PACKAGE" +elif _foamIsSystem "$adiosPACKAGE" then echo "Using adios-system" exit 0 @@ -94,20 +97,8 @@ fi # ADIOS2_SOURCE_DIR : location of the original sources # ADIOS2_ARCH_PATH : installation directory -ADIOS2_SOURCE_DIR=$sourceBASE/$adios2PACKAGE -ADIOS2_ARCH_PATH=$installBASE/$adios2PACKAGE - -# Some hacked in value, for binding in ADIOS1 as well (for the reader) -# Don't know if this is still needed -if [ -n "$ADIOS1_ARCH_PATH" ] -then - ADIOS1_ARCH_PATH=$installBASE/ADIOS-1.13.0 -fi -if [ -d "$ADIOS1_ARCH_PATH" ] -then - export ADIOS1_ROOT="$ADIOS1_ARCH_PATH" -fi - +ADIOS2_SOURCE_DIR=$sourceBASE/$adiosPACKAGE +ADIOS2_ARCH_PATH=$installBASE/$adiosPACKAGE : ${FOAM_MPI:=dummy} @@ -128,14 +119,14 @@ then echo " ADIOS2 libs in $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static else # CMake options often lag the configure ones - echo "Starting build: $adios2PACKAGE (using cmake)" + echo "Starting build: $adiosPACKAGE (using cmake)" echo ( - buildDIR=$buildBASE/$adios2PACKAGE + buildDIR=$buildBASE/$adiosPACKAGE cd $ADIOS2_SOURCE_DIR || exit 1 export GIT_DIR=$PWD/.git # Mask seeing our own git-repo - applyPatch $adios2PACKAGE $ADIOS2_SOURCE_DIR + applyPatch $adiosPACKAGE $ADIOS2_SOURCE_DIR # Remove any existing build folder and recreate rm -rf $ADIOS2_ARCH_DIR @@ -158,14 +149,13 @@ else -DCMAKE_INSTALL_PREFIX=$ADIOS2_ARCH_PATH \ -DCMAKE_BUILD_TYPE=Release \ -DADIOS2_USE_Fortran=FALSE \ - -DADIOS1_USE_STATIC_LIBS=TRUE \ ${WM_QUIET:+-DCMAKE_RULE_MESSAGES=OFF} \ $ADIOS2_SOURCE_DIR \ && make -j $WM_NCOMPPROCS all \ && make install \ - && echo "Built: $adios2PACKAGE" + && echo "Built: $adiosPACKAGE" ) || { - echo "Error building: $adios2PACKAGE" + echo "Error building: $adiosPACKAGE" } fi