diff --git a/wmake/scripts/have_adios2 b/wmake/scripts/have_adios2 index 56d6149e6c..52798bb137 100644 --- a/wmake/scripts/have_adios2 +++ b/wmake/scripts/have_adios2 @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -54,59 +54,53 @@ echo_adios2() # -> HAVE_ADIOS2, ADIOS2_INC_DIR, ADIOS2_LIB_DIR have_adios2() { - local header library static label settings warn + local prefix header library static settings warn # warn="==> skip adios2" - # Basic setup/checks - settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS2) || { - [ -n "$warn" ] && echo "$warn (no config.sh/ADIOS2 settings)" - return 1 - } - . $settings - if isNone "$ADIOS2_ARCH_PATH" + # Setup + if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS2) then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 + . "$settings" + else + [ -n "$warn" ] && echo "$warn (no config.sh/ADIOS2 settings)" + return 2 fi + # Location + prefix="$ADIOS2_ARCH_PATH" # Header/library names header="adios2.h" library="libadios2$extLibso" - - if hasAbsdir "$ADIOS2_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $ADIOS2_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $ADIOS2_ARCH_PATH/lib/$library \ - $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$ADIOS2_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -116,14 +110,15 @@ have_adios2() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } - header="${header%/*}" # Strip one-level (include/adios2/...) + header="${header%/*}" # Strip one-level (include/adios2/...) + # OK export HAVE_ADIOS2=true - export ADIOS2_ARCH_PATH + export ADIOS2_ARCH_PATH="$prefix" export ADIOS2_INC_DIR="${header%/*}" # Basename export ADIOS2_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/have_boost b/wmake/scripts/have_boost index 32df1b4216..ba12fee2c4 100644 --- a/wmake/scripts/have_boost +++ b/wmake/scripts/have_boost @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -54,54 +54,46 @@ echo_boost() # -> HAVE_BOOST, BOOST_INC_DIR, BOOST_LIB_DIR have_boost() { - local header library static label settings warn + local prefix header library static settings warn # warn="==> skip boost" - # Basic setup/checks - if isNone "$BOOST_ARCH_PATH" - then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 - fi + # Setup - from the current environment + # Location + prefix="$BOOST_ARCH_PATH" # Header/library names header="boost/version.hpp" library="libboost_system$extLibso" - - if hasAbsdir "$BOOST_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $BOOST_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $BOOST_ARCH_PATH/lib/$library \ - $BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$BOOST_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -111,14 +103,16 @@ have_boost() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } - header="${header%/*}" # Strip one-level (include/boost/...) + header="${header%/*}" # Strip one-level (include/boost/...) + + # OK export HAVE_BOOST=true - export BOOST_ARCH_PATH + export BOOST_ARCH_PATH="$prefix" export BOOST_INC_DIR="${header%/*}" # Basename export BOOST_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/have_ccmio b/wmake/scripts/have_ccmio index 9d3dc68aa8..ae2d13cb69 100644 --- a/wmake/scripts/have_ccmio +++ b/wmake/scripts/have_ccmio @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -53,42 +53,44 @@ echo_ccmio() # -> HAVE_CCMIO, CCMIO_INC_DIR, CCMIO_LIB_DIR have_ccmio() { - local header library static label settings warn good + local prefix header library static settings warn warn="==> skip ccmio" - # Basic setup/checks - settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio) || { - [ -n "$warn" ] && echo "$warn (no config.sh/ccmio settings)" - return 1 - } - . $settings - if isNone "$CCMIO_ARCH_PATH" + # Setup + if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio) then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 + . "$settings" + else + [ -n "$warn" ] && echo "$warn (no config.sh/ccmio settings)" + return 2 fi + # Location + prefix="$CCMIO_ARCH_PATH" # Header/library names. # Link with static libccmio only (fewer issues) - # header="libccmio/ccmio.h" static="libccmio$extLiba" - - if hasAbsdir "$CCMIO_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $CCMIO_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $CCMIO_ARCH_PATH/lib/$static \ - $CCMIO_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \ + "$prefix/lib/$static" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$static" \ ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -98,16 +100,17 @@ have_ccmio() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } - header="${header%/*}" # Strip one-level (include/libccmio/...) # The libccmio uses int32_t. # The OpenFOAM adapter thus requires additional work for 64-bit labels. # The OpenFOAM adapter was originally only designed for 'double' + local good + if [ "$WM_LABEL_SIZE" = 32 ] then if [ "$WM_PRECISION_OPTION" = DP ] @@ -124,8 +127,12 @@ have_ccmio() return 1 fi + + header="${header%/*}" # Strip one-level (include/libccmio/...) + + # OK export HAVE_CCMIO=true - export CCMIO_ARCH_PATH + export CCMIO_ARCH_PATH="$prefix" export CCMIO_INC_DIR="${header%/*}" # Basename export CCMIO_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/have_cgal b/wmake/scripts/have_cgal index 3582488443..bb57130796 100644 --- a/wmake/scripts/have_cgal +++ b/wmake/scripts/have_cgal @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -54,54 +54,46 @@ echo_cgal() # -> HAVE_CGAL, CGAL_INC_DIR, CGAL_LIB_DIR have_cgal() { - local header library static label settings warn + local prefix header library static settings warn # warn="==> skip cgal" - # Basic setup/checks - if isNone "$CGAL_ARCH_PATH" - then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 - fi + # Setup - from the current environment + # Location + prefix="$CGAL_ARCH_PATH" # Header/library names header="CGAL/version.h" library="libCGAL$extLibso" - - if hasAbsdir "$CGAL_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $CGAL_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $CGAL_ARCH_PATH/lib/$library \ - $CGAL_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$CGAL_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -111,14 +103,15 @@ have_cgal() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } - header="${header%/*}" # Strip one-level (include/CGAL/...) + header="${header%/*}" # Strip one-level (include/CGAL/...) + # OK export HAVE_CGAL=true - export CGAL_ARCH_PATH + export CGAL_ARCH_PATH="$prefix" export CGAL_INC_DIR="${header%/*}" # Basename export CGAL_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/have_fftw b/wmake/scripts/have_fftw index 317b37677b..218175e347 100644 --- a/wmake/scripts/have_fftw +++ b/wmake/scripts/have_fftw @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -54,57 +54,49 @@ echo_fftw() # -> HAVE_FFTW, FFTW_INC_DIR, FFTW_LIB_DIR have_fftw() { - local header library static label settings warn + local prefix header library static settings warn # warn="==> skip fftw" - # Basic setup/checks - if isNone "$FFTW_ARCH_PATH" - then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 - fi + # Setup - from the current environment + # Location + prefix="$FFTW_ARCH_PATH" # Header/library names header="fftw3.h" library="libfftw3$extLibso" static="libfftw3$extLiba" - - if hasAbsdir "$FFTW_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $FFTW_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $FFTW_ARCH_PATH/lib/$static \ - $FFTW_ARCH_PATH/lib/$library \ - $FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \ - $FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$static" \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$static" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$FFTW_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -114,12 +106,13 @@ have_fftw() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } + # OK export HAVE_FFTW=true - export FFTW_ARCH_PATH + export FFTW_ARCH_PATH="$prefix" export FFTW_INC_DIR="${header%/*}" # Basename export FFTW_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/have_hypre b/wmake/scripts/have_hypre index 67d9ba35d7..b2919c9587 100644 --- a/wmake/scripts/have_hypre +++ b/wmake/scripts/have_hypre @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -54,62 +54,56 @@ echo_hypre() # -> HAVE_HYPRE, HYPRE_INC_DIR, HYPRE_LIB_DIR have_hypre() { - local header library static label settings warn + local prefix header library static settings warn warn="==> skip hypre" - # Basic setup/checks. Prefer current environment value? (TDB) + # Setup - prefer current environment value? (TDB) if [ ! -d "$HYPRE_ARCH_PATH" ] then - settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/hypre) || { + if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/hypre) + then + . "$settings" + else [ -n "$warn" ] && echo "$warn (no config.sh/hypre settings)" - return 1 - } - . $settings - fi - if isNone "$HYPRE_ARCH_PATH" - then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 + return 2 + fi fi + # Location + prefix="$HYPRE_ARCH_PATH" # Header/library names header="HYPRE.h" library="libHYPRE$extLibso" - - if hasAbsdir "$HYPRE_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $HYPRE_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $HYPRE_ARCH_PATH/lib/$library \ - $HYPRE_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$HYPRE_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -119,12 +113,14 @@ have_hypre() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } + + # OK export HAVE_HYPRE=true - export HYPRE_ARCH_PATH + export HYPRE_ARCH_PATH="$prefix" export HYPRE_INC_DIR="${header%/*}" # Basename export HYPRE_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/have_kahip b/wmake/scripts/have_kahip index f6288da65d..f87ab85f19 100644 --- a/wmake/scripts/have_kahip +++ b/wmake/scripts/have_kahip @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -55,61 +55,56 @@ echo_kahip() # -> HAVE_KAHIP, KAHIP_ARCH_PATH, KAHIP_INC_DIR, KAHIP_LIB_DIR have_kahip() { - local header library static label settings warn + local prefix header library static settings warn warn="==> skip kahip" - # Basic setup/checks - settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/kahip) || { - [ -n "$warn" ] && echo "$warn (no config.sh/kahip settings)" - return 1 - } - . $settings - if isNone "$KAHIP_ARCH_PATH" + # Setup + if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/kahip) then - [ -n "$warn" ] && echo "$warn (not available)" + . "$settings" + else + [ -n "$warn" ] && echo "$warn (no config.sh/kahip settings)" return 1 fi + # Location + prefix="$KAHIP_ARCH_PATH" # Header/library names header="kaHIP_interface.h" library="libkahip$extLibso" static="libkahip$extLiba" - if hasAbsdir "$KAHIP_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $KAHIP_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $KAHIP_ARCH_PATH/lib/$static \ - $KAHIP_ARCH_PATH/lib/$library \ - $KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \ - $KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$static" \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$static" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$KAHIP_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -119,7 +114,7 @@ have_kahip() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } @@ -127,9 +122,9 @@ have_kahip() # kahip itself is 32-bit int, but our interface itself handles some # 64-bit conversion (mesh size). - echo "kahip (label=32) - $KAHIP_ARCH_PATH" + echo "kahip (label=32) - $prefix" export HAVE_KAHIP=true - export KAHIP_ARCH_PATH + export KAHIP_ARCH_PATH="$prefix" export KAHIP_INC_DIR="${header%/*}" # Basename export KAHIP_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/have_metis b/wmake/scripts/have_metis index b517e41774..1204fe3cb1 100644 --- a/wmake/scripts/have_metis +++ b/wmake/scripts/have_metis @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -55,62 +55,56 @@ echo_metis() # -> HAVE_METIS, METIS_ARCH_PATH, METIS_INC_DIR, METIS_LIB_DIR have_metis() { - local header library static label settings warn + local prefix header library static settings warn warn="==> skip metis" - # Basic setup/checks - settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || { - [ -n "$warn" ] && echo "$warn (no config.sh/metis settings)" - return 1 - } - . $settings - if isNone "$METIS_ARCH_PATH" + # Setup + if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 + . "$settings" + else + [ -n "$warn" ] && echo "$warn (no config.sh/metis settings)" + return 2 fi + # Location + prefix="$METIS_ARCH_PATH" # Header/library names header="metis.h" library="libmetis$extLibso" static="libmetis$extLiba" - - if hasAbsdir "$METIS_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $METIS_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $METIS_ARCH_PATH/lib/$static \ - $METIS_ARCH_PATH/lib/$library \ - $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \ - $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$static" \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$static" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$METIS_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -120,31 +114,38 @@ have_metis() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } + local good label + # Ensure consistent sizes between OpenFOAM and metis header # Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake - label=$(sed -ne 's/^.*#define *IDXTYPEWIDTH *\([1-9][0-9]\).*/\1/p' $header) - : ${label:=unknown} + label=$(sed -ne \ + 's/^.*#define *IDXTYPEWIDTH *\([1-9][0-9]\).*/\1/p' \ + "$header") + : "${label:=unknown}" if [ "$WM_LABEL_SIZE" = "$label" ] then - echo "Metis (label=$label) - $METIS_ARCH_PATH" - export HAVE_METIS=true - export METIS_ARCH_PATH - export METIS_INC_DIR="${header%/*}" # Basename - export METIS_LIB_DIR="${library%/*}" # Basename + good=true else if [ -n "$warn" ] then - echo "$warn (label=$WM_LABEL_SIZE, metis.h has '$label')" + echo "$warn (label=$WM_LABEL_SIZE, ${header##*/} has '$label')" fi no_metis return 1 fi + + # OK + echo "metis (label=$label) - $prefix" + export HAVE_METIS=true + export METIS_ARCH_PATH="$prefix" + export METIS_INC_DIR="${header%/*}" # Basename + export METIS_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/have_mgridgen b/wmake/scripts/have_mgridgen index cfc9ce5d74..c6dfe30a6f 100644 --- a/wmake/scripts/have_mgridgen +++ b/wmake/scripts/have_mgridgen @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -55,62 +55,56 @@ echo_mgridgen() # -> HAVE_MGRIDGEN, MGRIDGEN_ARCH_PATH, MGRIDGEN_INC_DIR, MGRIDGEN_LIB_DIR have_mgridgen() { - local header library static label scalar settings warn good + local prefix header library static settings warn warn="==> skip mgridgen" - # Basic setup/checks - settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mgridgen) || { - #silent# [ -n "$warn" ] && echo "$warn (no config.sh/mgridgen settings)" - return 1 - } - . $settings - if isNone "$MGRIDGEN_ARCH_PATH" + # Setup + if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mgridgen) then - #silent# [ -n "$warn" ] && echo "$warn (not available)" - return 1 + . "$settings" + else + #silent# [ -n "$warn" ] && echo "$warn (no config.sh/mgridgen settings)" + return 2 fi + # Location + prefix="$MGRIDGEN_ARCH_PATH" # Header/library names header="mgridgen.h" library="libMGridGen$extLibso" static="libmgrid$extLiba" - - if hasAbsdir "$MGRIDGEN_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $MGRIDGEN_ARCH_PATH/include/$header) + #silent# [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $MGRIDGEN_ARCH_PATH/lib/$static \ - $MGRIDGEN_ARCH_PATH/lib/$library \ - $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \ - $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$static" \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$static" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$MGRIDGEN_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -120,10 +114,11 @@ have_mgridgen() # Library found? [ -n "$library" ] || { - #silent# [ -n "$warn" ] && echo "$warn (missing library)" + #silent# [ -n "$warn" ] && echo "$warn (no library)" return 2 } + local good label scalar # Ensure consistent sizes with OpenFOAM and mgridgen header # Extract typedef for idxtype, realtype @@ -134,20 +129,20 @@ have_mgridgen() 's/^.*typedef *\([^ ]*\) *realtype.*/\1/ip' \ "$header") - : ${label:=unknown} - : ${scalar:=unknown} - + : "${label:=unknown}" + : "${scalar:=unknown}" case "$WM_LABEL_SIZE:$label" in (32:int32_t | 32:int | 64:int64_t | 64:long) good=true ;; - *) + (*) if [ -n "$warn" ] then - echo "$warn (label='$WM_LABEL_SIZE', mgridgen.h has '$label')" + echo "$warn (label='$WM_LABEL_SIZE', ${header##*/} has '$label')" fi + no_mgridgen return 1 ;; esac @@ -156,21 +151,23 @@ have_mgridgen() good=true ;; - *) + (*) if [ -n "$warn" ] then - echo "$warn (scalar='$WM_PRECISION_OPTION', mgridgen.h has '$scalar')" + echo "$warn (scalar='$WM_PRECISION_OPTION', ${header##*/} has '$scalar')" fi + no_mgridgen return 1 ;; esac # OK - echo "mgridgen (label=$label, scalar=$scalar) - $MGRIDGEN_ARCH_PATH" + echo "mgridgen (label=$label, scalar=$scalar) - $prefix" export HAVE_MGRIDGEN=true - export MGRIDGEN_ARCH_PATH MGRIDGEN_VERSION + export MGRIDGEN_ARCH_PATH="$prefix" export MGRIDGEN_INC_DIR="${header%/*}" # Basename export MGRIDGEN_LIB_DIR="${library%/*}" # Basename + export MGRIDGEN_VERSION } diff --git a/wmake/scripts/have_petsc b/wmake/scripts/have_petsc index 277532e115..301bb7cb01 100644 --- a/wmake/scripts/have_petsc +++ b/wmake/scripts/have_petsc @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -54,62 +54,56 @@ echo_petsc() # -> HAVE_PETSC, PETSC_INC_DIR, PETSC_LIB_DIR have_petsc() { - local header library static label settings warn + local prefix header library static settings warn warn="==> skip petsc" - # Basic setup/checks. Prefer current environment value? (TDB) + # Setup - prefer current environment value? (TDB) if [ ! -d "$PETSC_ARCH_PATH" ] then - settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/petsc) || { + if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/petsc) + then + . "$settings" + else [ -n "$warn" ] && echo "$warn (no config.sh/petsc settings)" - return 1 - } - . $settings - fi - if isNone "$PETSC_ARCH_PATH" - then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 + return 2 + fi fi + # Location + prefix="$PETSC_ARCH_PATH" # Header/library names header="petsc.h" library="libpetsc$extLibso" - - if hasAbsdir "$PETSC_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $PETSC_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $PETSC_ARCH_PATH/lib/$library \ - $PETSC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$PETSC_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -119,12 +113,15 @@ have_petsc() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } + # TODO: check size of petsc integer vs label + + # OK export HAVE_PETSC=true - export PETSC_ARCH_PATH + export PETSC_ARCH_PATH="$prefix" export PETSC_INC_DIR="${header%/*}" # Basename export PETSC_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/have_readline b/wmake/scripts/have_readline index 9f9509e40f..dc0b557db2 100644 --- a/wmake/scripts/have_readline +++ b/wmake/scripts/have_readline @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -52,32 +52,43 @@ echo_readline() # -> HAVE_LIBREADLINE, READLINE_INC_DIR, READLINE_LIB_DIR have_readline() { - local header library static settings warn + local prefix header library static settings warn # warn="==> skip readline" + # Location + prefix=system # Header/library names header="readline/readline.h" library="libreadline$extLibso" - # System only? - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + # ---------------------------------- + if isNone "$prefix" + then + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") - case "$header" in - /usr/local/*) library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - ;; + elif isSystem "$prefix" + then + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - *) library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - ;; - esac + else + unset prefix header library + fi + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -87,12 +98,13 @@ have_readline() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } - header="${header%/*}" # Strip one-level (include/readline/...) + header="${header%/*}" # Strip one-level (include/readline/...) + # OK export HAVE_LIBREADLINE=true export READLINE_INC_DIR="${header%/*}" # Basename export READLINE_LIB_DIR="${library%/*}" # Basename diff --git a/wmake/scripts/have_scotch b/wmake/scripts/have_scotch index 96d353e55c..e25525926a 100644 --- a/wmake/scripts/have_scotch +++ b/wmake/scripts/have_scotch @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -55,67 +55,64 @@ echo_scotch() # -> HAVE_SCOTCH, SCOTCH_ARCH_PATH, SCOTCH_INC_DIR, SCOTCH_LIB_DIR have_scotch() { - local header library static label settings warn + local prefix header library static settings warn warn="==> skip scotch" - # Basic setup/checks - settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || { - [ -n "$warn" ] && echo "$warn (no config.sh/scotch settings)" - return 1 - } - . $settings - if isNone "$SCOTCH_ARCH_PATH" + # Setup + if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 + . "$settings" + else + [ -n "$warn" ] && echo "$warn (no config.sh/scotch settings)" + return 2 fi + # Location + prefix="$SCOTCH_ARCH_PATH" # Header/library names header="scotch.h" library="libscotch$extLibso" static="libscotch$extLiba" - - if hasAbsdir "$SCOTCH_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $SCOTCH_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $SCOTCH_ARCH_PATH/lib/$static \ - $SCOTCH_ARCH_PATH/lib/$library \ - $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \ - $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$static" \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$static" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$SCOTCH_ARCH_PATH" + + elif isSystem "$prefix" then + prefix=/usr + header=$(findFirstFile \ - /usr/local/include/$header \ - /usr/local/include/scotch/$header \ - /usr/include/$header \ - /usr/include/scotch/$header \ + "/usr/local/include/scotch/$header" \ + "/usr/local/include/$header" \ + "/usr/include/scotch/$header" \ + "/usr/include/$header" \ ) - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -125,17 +122,18 @@ have_scotch() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } + local good label # Ensure consistent sizes between OpenFOAM and scotch header # extract 'typedef int64_t SCOTCH_Num' or equivalent label=$(sed -ne \ 's/^.*typedef *\([^ ]*\) *SCOTCH_Num.*/\1/p' \ "$header") - : ${label:=unknown} # Failsafe value + : "${label:=unknown}" # No SCOTCH_VERSION set? Try to obtain from header @@ -152,27 +150,30 @@ have_scotch() IFS="." [ "$#" -gt 0 ] && echo "scotch-$*" ) - : ${SCOTCH_VERSION:=scotch} # Failsafe value - + : "${SCOTCH_VERSION:=scotch}" # Failsafe value case "$WM_LABEL_SIZE:$label" in (32:int32_t | 32:int | 64:int64_t | 64:long) - echo "Scotch (label=$label) - $SCOTCH_ARCH_PATH" - export HAVE_SCOTCH=true - export SCOTCH_ARCH_PATH SCOTCH_VERSION - export SCOTCH_INC_DIR="${header%/*}" # Basename - export SCOTCH_LIB_DIR="${library%/*}" # Basename + good=true ;; - *) + (*) if [ -n "$warn" ] then - echo "$warn (label='$WM_LABEL_SIZE', scotch.h has '$label')" + echo "$warn (label='$WM_LABEL_SIZE', ${header##*/} has '$label')" fi no_scotch return 1 ;; esac + + # OK + echo "scotch (label=$label) - $prefix" + export HAVE_SCOTCH=true + export SCOTCH_ARCH_PATH="$prefix" + export SCOTCH_INC_DIR="${header%/*}" # Basename + export SCOTCH_LIB_DIR="${library%/*}" # Basename + export SCOTCH_VERSION } diff --git a/wmake/scripts/have_zoltan b/wmake/scripts/have_zoltan index e9fa45ea02..12efc04c90 100644 --- a/wmake/scripts/have_zoltan +++ b/wmake/scripts/have_zoltan @@ -2,7 +2,7 @@ # ========= | # \\ / 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 | #------------------------------------------------------------------------------ # License @@ -54,62 +54,56 @@ echo_zoltan() # -> HAVE_ZOLTAN, ZOLTAN_INC_DIR, ZOLTAN_LIB_DIR have_zoltan() { - local header library static label settings warn + local prefix header library static settings warn # warn="==> skip zoltan" - # Basic setup/checks - settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) || { - [ -n "$warn" ] && echo "$warn (no config.sh/zoltan settings)" - return 1 - } - . $settings - if isNone "$ZOLTAN_ARCH_PATH" + # Setup + if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) then - [ -n "$warn" ] && echo "$warn (not available)" - return 1 + . "$settings" + else + [ -n "$warn" ] && echo "$warn (no config.sh/zoltan settings)" + return 2 fi + # Location + prefix="$ZOLTAN_ARCH_PATH" # Header/library names header="zoltan.h" library="libzoltan$extLibso" static="libzoltan$extLiba" - - if hasAbsdir "$ZOLTAN_ARCH_PATH" + # ---------------------------------- + if isNone "$prefix" then - header=$(findFirstFile $ZOLTAN_ARCH_PATH/include/$header) + [ -n "$warn" ] && echo "$warn (disabled)" + return 1 + elif hasAbsdir "$prefix" + then + header=$(findFirstFile "$prefix/include/$header") library=$(findFirstFile \ "$(thirdExtLib $library)" \ - $ZOLTAN_ARCH_PATH/lib/$static \ - $ZOLTAN_ARCH_PATH/lib/$library \ - $ZOLTAN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \ - $ZOLTAN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \ + "$prefix/lib/$static" \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$static" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ ) - elif isSystem "$ZOLTAN_ARCH_PATH" + elif isSystem "$prefix" then - header=$(findFirstFile /usr/local/include/$header /usr/include/$header) + prefix=/usr + header=$(findFirstFile "/usr/local/include/$header" "/usr/include/$header") + case "$header" in (/usr/local/*) prefix=/usr/local ;; esac - case "$header" in - /usr/local/*) - library=$(findFirstFile \ - /usr/local/lib/$library \ - /usr/local/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - - *) - library=$(findFirstFile \ - /usr/lib/$library \ - /usr/lib$WM_COMPILER_LIB_ARCH/$library \ - ) - ;; - esac + library=$(findFirstFile \ + "$prefix/lib/$library" \ + "$prefix/lib$WM_COMPILER_LIB_ARCH/$library" \ + ) else - unset header library + unset prefix header library fi - + # ---------------------------------- # Header found? [ -n "$header" ] || { @@ -119,12 +113,13 @@ have_zoltan() # Library found? [ -n "$library" ] || { - [ -n "$warn" ] && echo "$warn (missing library)" + [ -n "$warn" ] && echo "$warn (no library)" return 2 } + # OK export HAVE_ZOLTAN=true - export ZOLTAN_ARCH_PATH + export ZOLTAN_ARCH_PATH="$prefix" export ZOLTAN_INC_DIR="${header%/*}" # Basename export ZOLTAN_LIB_DIR="${library%/*}" # Basename } diff --git a/wmake/scripts/paraviewFunctions b/wmake/scripts/paraviewFunctions index 6b69360919..d098e0626c 100644 --- a/wmake/scripts/paraviewFunctions +++ b/wmake/scripts/paraviewFunctions @@ -180,6 +180,7 @@ have_pvplugin_support() return 2 } + # OK export HAVE_PVPLUGIN_SUPPORT=true export FOAM_PV_PLUGIN_LIBBIN="$targetDir" export PARAVIEW_API="$pv_api" diff --git a/wmake/scripts/sysFunctions b/wmake/scripts/sysFunctions index 64b5cd730f..30de032b90 100644 --- a/wmake/scripts/sysFunctions +++ b/wmake/scripts/sysFunctions @@ -71,16 +71,16 @@ then } - # True if '$1' is an empty string or matches "*-none". + # True if '$1' is an empty string, "none" or ends in "-none" # Eg, - # if isNone "$KAHIP_ARCH_PATH" ... + # if isNone "$BOOST_ARCH_PATH" ... isNone() { test -z "$1" -o "${1##*-}" = none } - # True if '$1' matches "*-system" + # True if '$1' is "system" or ends in "-system" # Eg, # if isSystem "$BOOST_ARCH_PATH" isSystem()