diff --git a/Allwmake b/Allwmake index 71557d5..0869a95 100755 --- a/Allwmake +++ b/Allwmake @@ -7,7 +7,7 @@ # \\/ M anipulation | #------------------------------------------------------------------------------ # Copyright (C) 2011-2016 OpenFOAM Foundation -# Copyright (C) 2016-2020 OpenCFD Ltd. +# Copyright (C) 2016-2023 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -48,7 +48,10 @@ echo Build MPI libraries if required echo " $MPI_ARCH_PATH" case "$WM_MPLIB" in (OPENMPI | MPICH) - ./make"$WM_MPLIB" -test "$MPI_ARCH_PATH" || ./make"$WM_MPLIB" + if ! ./make"$WM_MPLIB" -test "$MPI_ARCH_PATH" + then + ./make"$WM_MPLIB" + fi ;; esac diff --git a/etc/tools/CMakeFunctions b/etc/tools/CMakeFunctions new file mode 100644 index 0000000..4e2f793 --- /dev/null +++ b/etc/tools/CMakeFunctions @@ -0,0 +1,57 @@ +#---------------------------------*- sh -*------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | www.openfoam.com +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# Copyright (C) 2023 OpenCFD Ltd. +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM, distributed under GPL-3.0-or-later. +# +# File +# etc/tools/CMakeFunction +# +# Description +# CMake make/install helper functions +# +#------------------------------------------------------------------------------ + +# Variables referenced by the functions. Initialization at the end of the file. +unset CMAKE_VARIABLES +unset withVERBOSE +BUILD_TYPE=Release # The cmake build type + +#------------------------------------------------------------------------------ + +# +# Set CMake cache variables. +# Automatically adds -D prefix it needed +# +addCMakeVariable() +{ + local i + for i + do + case "$i" in + ('') ;; # empty + (-*) CMAKE_VARIABLES="${CMAKE_VARIABLES} ${i}" ;; + (*) CMAKE_VARIABLES="${CMAKE_VARIABLES} -D${i}" ;; + esac + done +} + +# +# Verbose makefiles +# +addVerbosity() +{ + if [ "${withVERBOSE:=false}" = true ] + then + addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE" + fi +} + + +#------------------------------------------------------------------------------ diff --git a/etc/tools/ParaViewFunctions b/etc/tools/ParaViewFunctions index 0e69269..e8f938b 100644 --- a/etc/tools/ParaViewFunctions +++ b/etc/tools/ParaViewFunctions @@ -6,7 +6,7 @@ # \\/ M anipulation | #------------------------------------------------------------------------------ # Copyright (C) 2011-2016 OpenFOAM Foundation -# Copyright (C) 2016-2021 OpenCFD Ltd. +# Copyright (C) 2016-2023 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -16,6 +16,7 @@ # # Description # ParaView make/install helper functions +# To be loaded *after* etc/tools/CMakeFunctions # # Note # Obtaining paths via 'python-config' may not always resolve properly: @@ -132,23 +133,8 @@ setParaViewVersion() #------------------------------------------------------------------------------ -# -# Set CMake cache variables. -# Automatically adds -D prefix it needed -# -addCMakeVariable() -{ - local i - for i - do - case "$i" in - ('') ;; # empty - (-*) CMAKE_VARIABLES="${CMAKE_VARIABLES} ${i}" ;; - (*) CMAKE_VARIABLES="${CMAKE_VARIABLES} -D${i}" ;; - esac - done -} - +# addCMakeVariable : defined in etc/tools/CMakeFunctions +# addVerbosity : defined in etc/tools/CMakeFunctions # # General settings (version-dependent) @@ -165,18 +151,6 @@ addGeneral() } -# -# Verbose makefiles -# -addVerbosity() -{ - if [ "${withVERBOSE:=false}" = true ] - then - addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE" - fi -} - - # # MPI support for PARAVIEW # diff --git a/etc/tools/vtkFunctions b/etc/tools/vtkFunctions index 0a88341..5743c92 100644 --- a/etc/tools/vtkFunctions +++ b/etc/tools/vtkFunctions @@ -5,7 +5,7 @@ # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------ -# Copyright (C) 2016-2021 OpenCFD Ltd. +# Copyright (C) 2016-2023 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -15,7 +15,7 @@ # # Description # VTK (library) make/install helper functions. -# To be loaded *after* etc/tools/ParaViewFunctions +# To be loaded *after* etc/tools/CMakeFunctions, ParaViewFunctions # #------------------------------------------------------------------------------ diff --git a/makeAdios2 b/makeAdios2 index 496f655..a9ece2c 100755 --- a/makeAdios2 +++ b/makeAdios2 @@ -5,7 +5,7 @@ # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------ -# Copyright (C) 2018-2021 OpenCFD Ltd. +# Copyright (C) 2018-2023 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -59,6 +59,7 @@ then } fi . "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions +. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/CMakeFunctions #------------------------------------------------------------------------------ # Obtain version from OpenFOAM etc/config.sh file: _foamConfig adios2 @@ -82,6 +83,7 @@ options: -gcc Force use of gcc/g++ -cmake PATH With cmake from the given path -mpi-home PATH With hint for MPI_HOME + -DNAME=VALUE add cmake variable -list List available unpacked source versions -help Display usage help @@ -124,6 +126,9 @@ do adios2-[0-9]* | adios2-git* | adios-[0-9]* | adios-git*) PACKAGE="${1%%/}" ;; + -D[A-Z]*=* | [A-Z]*=*) # cmake variables + addCMakeVariable "$1" + ;; *) die "unknown option/argument: '$1'" ;; diff --git a/makeParaView b/makeParaView index d7b8ef6..dc345db 100755 --- a/makeParaView +++ b/makeParaView @@ -36,6 +36,7 @@ then } fi . "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions +. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/CMakeFunctions . "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ParaViewFunctions #------------------------------------------------------------------------------ diff --git a/makeVTK b/makeVTK index 55cf191..078955a 100755 --- a/makeVTK +++ b/makeVTK @@ -6,7 +6,7 @@ # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------ -# Copyright (C) 2016-2021 OpenCFD Ltd. +# Copyright (C) 2016-2023 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -37,6 +37,7 @@ then } fi . "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ThirdPartyFunctions +. "${WM_THIRD_PARTY_DIR:?}"/etc/tools/CMakeFunctions . "${WM_THIRD_PARTY_DIR:?}"/etc/tools/ParaViewFunctions . "${WM_THIRD_PARTY_DIR:?}"/etc/tools/vtkFunctions #------------------------------------------------------------------------------