From d5d0174b01f982c86713b0c1518ece2a067fb5f5 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 14 Jun 2016 10:46:20 +0200 Subject: [PATCH 01/17] CONFIG: adjust for updated ThirdParty - also update settings to include newer compiler versions --- .../mesh/conversion/Optional/Allwmake | 12 ++++-- .../Optional/ccm26ToFoam/Make/options | 5 +-- .../Optional/ccm26ToFoam/ccm26ToFoam.C | 2 +- etc/bashrc | 2 +- etc/config.csh/CGAL | 2 +- etc/config.csh/paraview | 2 +- etc/config.csh/settings | 13 ++++-- etc/config.sh/CGAL | 2 +- etc/config.sh/compiler | 13 ++++-- etc/config.sh/libccmio | 42 +++++++++++++++++++ etc/config.sh/paraview | 2 +- etc/cshrc | 2 +- 12 files changed, 78 insertions(+), 21 deletions(-) create mode 100644 etc/config.sh/libccmio diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake index cb0064789a..f84479c089 100755 --- a/applications/utilities/mesh/conversion/Optional/Allwmake +++ b/applications/utilities/mesh/conversion/Optional/Allwmake @@ -6,13 +6,17 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for compilation (at least for error catching) . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments +# Get version info and arch-path +. $WM_PROJECT_DIR/etc/config.sh/functions +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/libccmio) + set -x -# build libccmio and create lnInclude directory -$WM_THIRD_PARTY_DIR/AllwmakeLibccmio +# Build libccmio (.so) +$WM_THIRD_PARTY_DIR/makeCCMIO -# if the library built properly, the headers should exist too -if [ -e $FOAM_EXT_LIBBIN/libccmio.so ] +if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \ + -a -e $FOAM_EXT_LIBBIN/libccmio.so ] then wmake ccm26ToFoam fi diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options index e2cdbcd1c2..410b53c73c 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options @@ -1,10 +1,7 @@ -LIBCCMIO_DIR = $(WM_THIRD_PARTY_DIR)/libccmio-2.6.1 - EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIBCCMIO_DIR) \ - -I$(LIBCCMIO_DIR)/lnInclude + -I$(CCMIO_ARCH_PATH)/include EXE_LIBS = \ -lfiniteVolume \ diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C index b95acd7978..d97133244c 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C @@ -43,7 +43,7 @@ Description #include "SortableList.H" #include "cellSet.H" -#include +#include "libccmio/ccmio.h" #include using namespace Foam; diff --git a/etc/bashrc b/etc/bashrc index 9a190e2548..225f5e22ff 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -62,7 +62,7 @@ foamInstall=$HOME/$WM_PROJECT export WM_COMPILER_TYPE=system #- Compiler: -# WM_COMPILER = Gcc | Gcc45 | Gcc46 | Gcc47 | Gcc48 | Gcc49| Clang | Icc +# WM_COMPILER = Gcc | Gcc4[5-9] | Gcc5[1-4] | Gcc61 | Clang | Icc export WM_COMPILER=Gcc unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH diff --git a/etc/config.csh/CGAL b/etc/config.csh/CGAL index 0ec72b5e76..14304f46a4 100644 --- a/etc/config.csh/CGAL +++ b/etc/config.csh/CGAL @@ -30,7 +30,7 @@ ##------------------------------------------------------------------------------ set boost_version=boost-system -set cgal_version=CGAL-4.7 +set cgal_version=CGAL-4.8 setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version diff --git a/etc/config.csh/paraview b/etc/config.csh/paraview index 9e5f7eb0f7..df5e680a34 100644 --- a/etc/config.csh/paraview +++ b/etc/config.csh/paraview @@ -54,7 +54,7 @@ end #setenv ParaView_VERSION 4.1.0 #setenv ParaView_VERSION 4.3.1 #setenv ParaView_VERSION 4.4.0 -setenv ParaView_VERSION 5.0.0 +setenv ParaView_VERSION 5.0.1 setenv ParaView_MAJOR detect diff --git a/etc/config.csh/settings b/etc/config.csh/settings index b93503e36f..e54ff41380 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -217,9 +217,9 @@ switch ("$WM_COMPILER_TYPE") case OpenFOAM: case ThirdParty: # Default versions of GMP, MPFR and MPC, overide as necessary - set gmp_version=gmp-5.1.2 - set mpfr_version=mpfr-3.1.2 - set mpc_version=mpc-1.0.1 + set gmp_version=gmp-6.0.1 + set mpfr_version=mpfr-3.1.4 + set mpc_version=mpc-1.0.3 switch ("$WM_COMPILER") case Gcc: case Gcc48: @@ -246,11 +246,18 @@ case ThirdParty: case Gcc53: set gcc_version=gcc-5.3.0 breaksw + case Gcc54: + set gcc_version=gcc-5.4.0 + breaksw + case Gcc61: + set gcc_version=gcc-6.1.0 + breaksw case Clang: # Using clang - not gcc setenv WM_CC 'clang' setenv WM_CXX 'clang++' set clang_version=llvm-3.7.0 + # set clang_version=llvm-3.8.0 breaksw default: echo diff --git a/etc/config.sh/CGAL b/etc/config.sh/CGAL index 4d0ca25ff6..654140addd 100644 --- a/etc/config.sh/CGAL +++ b/etc/config.sh/CGAL @@ -36,7 +36,7 @@ #------------------------------------------------------------------------------ boost_version=boost-system -cgal_version=CGAL-4.7 +cgal_version=CGAL-4.8 if [ -z "$SOURCE_CGAL_VERSIONS_ONLY" ] then diff --git a/etc/config.sh/compiler b/etc/config.sh/compiler index 63099a7923..bcfc00fb8b 100644 --- a/etc/config.sh/compiler +++ b/etc/config.sh/compiler @@ -34,9 +34,9 @@ case "$WM_COMPILER_TYPE" in OpenFOAM | ThirdParty) # Default versions of GMP, MPFR and MPC, override as necessary - gmp_version=gmp-5.1.2 - mpfr_version=mpfr-3.1.2 - mpc_version=mpc-1.0.1 + gmp_version=gmp-6.0.1 + mpfr_version=mpfr-3.1.4 + mpc_version=mpc-1.0.3 case "$WM_COMPILER" in Gcc | Gcc48) @@ -63,11 +63,18 @@ OpenFOAM | ThirdParty) Gcc53) gcc_version=gcc-5.3.0 ;; + Gcc54) + gcc_version=gcc-5.4.0 + ;; + Gcc61) + gcc_version=gcc-6.1.0 + ;; Clang) # Using clang - not gcc export WM_CC='clang' export WM_CXX='clang++' clang_version=llvm-3.7.0 + # clang_version=llvm-3.8.0 ;; *) echo 1>&2 diff --git a/etc/config.sh/libccmio b/etc/config.sh/libccmio new file mode 100644 index 0000000000..1ef4205640 --- /dev/null +++ b/etc/config.sh/libccmio @@ -0,0 +1,42 @@ +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM. If not, see . +# +# File +# etc/config.sh/libccmio +# +# Description +# Setup file for libccmio include/libraries. +# Sourced during wmake process only. +# +# Dynamic libraries are found under the FOAM_EXT_LIBBIN path. +# Static libraries are found under the CCMIO_ARCH_PATH/lib path. +# +# Note +# A csh version is not needed, since the values here are only sourced +# during the wmake process +#------------------------------------------------------------------------------ + +ccmio_version=libccmio-2.6.1 +export CCMIO_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$ccmio_version + +#------------------------------------------------------------------------------ diff --git a/etc/config.sh/paraview b/etc/config.sh/paraview index b6216f0579..aebfd5b889 100644 --- a/etc/config.sh/paraview +++ b/etc/config.sh/paraview @@ -62,7 +62,7 @@ done #export ParaView_VERSION=4.1.0 #export ParaView_VERSION=4.3.1 #export ParaView_VERSION=4.4.0 -export ParaView_VERSION=5.0.0 +export ParaView_VERSION=5.0.1 export ParaView_MAJOR=detect diff --git a/etc/cshrc b/etc/cshrc index 5604372d06..30138fdb36 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -61,7 +61,7 @@ if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall setenv WM_COMPILER_TYPE system #- Compiler: -# WM_COMPILER = Gcc | Gcc45 | Gcc46 | Gcc47 | Gcc48 | Gcc49 | Clang | Icc +# WM_COMPILER = Gcc | Gcc4[5-9] | Gcc5[1-4] | Gcc61 | Clang | Icc setenv WM_COMPILER Gcc setenv WM_COMPILER_ARCH # defined but empty unsetenv WM_COMPILER_LIB_ARCH From 62f634c014c4436a53a82baf81474ddca32566e1 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 16 Jun 2016 15:54:06 +0200 Subject: [PATCH 02/17] BUG: missing library arch on 3rd party gmp/mpfr/mpc paths issue #148 STYLE: drop conditional check on mpc. - was for older gcc, but is a requisite for gcc >= 4.5 --- etc/config.csh/settings | 16 +++++----------- etc/config.sh/settings | 13 ++++--------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/etc/config.csh/settings b/etc/config.csh/settings index e54ff41380..1f9ae3a8a6 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -275,9 +275,7 @@ case ThirdParty: set gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version set gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version set mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version - if ( $?mpc_version ) then - set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version - endif + set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version # Check that the compiler directory can be found if ( ! -d "$gccDir" ) then @@ -296,14 +294,10 @@ case ThirdParty: # Add compiler libraries to run-time environment _foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH - # Add gmp/mpfr libraries to run-time environment - _foamAddLib $gmpDir/lib - _foamAddLib $mpfrDir/lib - - # Add mpc libraries (not need for older gcc) to run-time environment - if ( $?mpc_version ) then - _foamAddLib $mpcDir/lib - endif + # Add gmp/mpfr/mpc libraries to run-time environment + _foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH + _foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH + _foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH # Used by boost/CGAL: setenv MPFR_ARCH_PATH $mpfrDir diff --git a/etc/config.sh/settings b/etc/config.sh/settings index f53af4b162..c77b084275 100644 --- a/etc/config.sh/settings +++ b/etc/config.sh/settings @@ -240,15 +240,10 @@ OpenFOAM | ThirdParty) # Add compiler libraries to run-time environment _foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH - # Add gmp/mpfr libraries to run-time environment - _foamAddLib $gmpDir/lib - _foamAddLib $mpfrDir/lib - - # Add mpc libraries (not need for older gcc) to run-time environment - if [ -n "$mpc_version" ] - then - _foamAddLib $mpcDir/lib - fi + # Add gmp/mpfr/mpc libraries to run-time environment + _foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH + _foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH + _foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH # Used by boost/CGAL: export MPFR_ARCH_PATH=$mpfrDir From bbf20318e0b50554e7b5f4be2053cd6e1c78257b Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 16 Jun 2016 16:49:28 +0200 Subject: [PATCH 03/17] ENH: support use of system gmp/mpfr/mpc with ThirdParty gcc - not previously possible to configure a third-party gcc with system gmp/mpfr/mpc. This makes it easier to switch between compilers for testing. - use system libraries by default --- etc/config.csh/settings | 34 ++++++++++++++++++++++------------ etc/config.sh/compiler | 9 ++++----- etc/config.sh/settings | 37 ++++++++++++++++++++++++++----------- 3 files changed, 52 insertions(+), 28 deletions(-) diff --git a/etc/config.csh/settings b/etc/config.csh/settings index 1f9ae3a8a6..6c201aefa8 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -202,7 +202,7 @@ _foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_L # Compiler settings # ~~~~~~~~~~~~~~~~~ unset gcc_version gmp_version mpfr_version mpc_version -unsetenv MPFR_ARCH_PATH GMP_ARCH_PATH +unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH # Location of compiler installation @@ -217,9 +217,9 @@ switch ("$WM_COMPILER_TYPE") case OpenFOAM: case ThirdParty: # Default versions of GMP, MPFR and MPC, overide as necessary - set gmp_version=gmp-6.0.1 - set mpfr_version=mpfr-3.1.4 - set mpc_version=mpc-1.0.3 + set gmp_version=gmp-system + set mpfr_version=mpfr-system + set mpc_version=mpc-system switch ("$WM_COMPILER") case Gcc: case Gcc48: @@ -291,17 +291,28 @@ case ThirdParty: _foamAddMan $gccDir/man _foamAddPath $gccDir/bin - # Add compiler libraries to run-time environment + # Add ThirdParty compiler libraries to run-time environment _foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH - # Add gmp/mpfr/mpc libraries to run-time environment - _foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH - _foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH - _foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH + # Add ThirdParty gmp/mpfr/mpc libraries to run-time environment + if ( "${gmpDir:t}" != "gmp-system" ) then + _foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH + endif + if ( "${mpfrDir:t}" != "mpfr-system" ) then + _foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH + endif + if ( "${mpcDir:t}" != "mpc-system" ) then + _foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH + endif # Used by boost/CGAL: - setenv MPFR_ARCH_PATH $mpfrDir setenv GMP_ARCH_PATH $gmpDir + setenv MPFR_ARCH_PATH $mpfrDir + + if ($?FOAM_VERBOSE && $?prompt) then + echo "Using ThirdParty compiler" + echo " ${gccDir:t} (${gmpDir:t} ${mpfrDir:t} ${mpcDir:t})" + endif endif unset gcc_version gccDir unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir @@ -324,7 +335,6 @@ case ThirdParty: _foamAddPath $clangDir/bin endif unset clang_version clangDir - breaksw case system: diff --git a/etc/config.sh/compiler b/etc/config.sh/compiler index bcfc00fb8b..bcf61cead9 100644 --- a/etc/config.sh/compiler +++ b/etc/config.sh/compiler @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -32,11 +32,10 @@ case "$WM_COMPILER_TYPE" in OpenFOAM | ThirdParty) - # Default versions of GMP, MPFR and MPC, override as necessary - gmp_version=gmp-6.0.1 - mpfr_version=mpfr-3.1.4 - mpc_version=mpc-1.0.3 + gmp_version=gmp-system + mpfr_version=mpfr-system + mpc_version=mpc-system case "$WM_COMPILER" in Gcc | Gcc48) diff --git a/etc/config.sh/settings b/etc/config.sh/settings index c77b084275..48a1f9b0de 100644 --- a/etc/config.sh/settings +++ b/etc/config.sh/settings @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -198,7 +198,7 @@ _foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$ # Compiler settings # ~~~~~~~~~~~~~~~~~ unset gcc_version gmp_version mpfr_version mpc_version -unset MPFR_ARCH_PATH GMP_ARCH_PATH +unset GMP_ARCH_PATH MPFR_ARCH_PATH # Location of compiler installation # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -219,9 +219,9 @@ OpenFOAM | ThirdParty) if [ -n "$gcc_version" ] then gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version - gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version - mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version - mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version + gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${gmp_version:-gmp-system} + mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpfr_version:-mpfr-system} + mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system} # Check that the compiler directory can be found [ -d "$gccDir" ] || { @@ -237,17 +237,32 @@ OpenFOAM | ThirdParty) _foamAddMan $gccDir/man _foamAddPath $gccDir/bin - # Add compiler libraries to run-time environment + # Add ThirdParty compiler libraries to run-time environment _foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH - # Add gmp/mpfr/mpc libraries to run-time environment - _foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH - _foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH - _foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH + # Add ThirdParty gmp/mpfr/mpc libraries to run-time environment + if [ "${gmpDir##*-}" != system ] + then + _foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH + fi + if [ "${mpfrDir##*-}" != system ] + then + _foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH + fi + if [ "${mpcDir##*-}" != system ] + then + _foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH + fi # Used by boost/CGAL: - export MPFR_ARCH_PATH=$mpfrDir export GMP_ARCH_PATH=$gmpDir + export MPFR_ARCH_PATH=$mpfrDir + + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + echo "Using ThirdParty compiler" + echo " ${gccDir##*/} (${gmpDir##*/} $${mpfrDir##*/} ${mpcDir##*/})" + fi fi unset gcc_version gccDir unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir From 5ac7a846eddf0979b2acddea79631be415807e83 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 16 Jun 2016 17:22:30 +0200 Subject: [PATCH 04/17] CONFIG: adjust csh compiler settings to be closer to sh version - makes it easier to ensure consistent setups --- etc/config.csh/compiler | 90 +++++++++++++++++++++++++++++++++++++++++ etc/config.csh/settings | 75 ++++++++-------------------------- etc/config.sh/compiler | 2 + etc/config.sh/settings | 13 ++++-- 4 files changed, 117 insertions(+), 63 deletions(-) create mode 100644 etc/config.csh/compiler diff --git a/etc/config.csh/compiler b/etc/config.csh/compiler new file mode 100644 index 0000000000..6c457e763a --- /dev/null +++ b/etc/config.csh/compiler @@ -0,0 +1,90 @@ +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM. If not, see . +# +# File +# etc/config.csh/compiler +# +# Description +# Startup file for custom compiler versions for OpenFOAM +# Sourced from OpenFOAM-/etc/config.csh/settings +# +#------------------------------------------------------------------------------ + +switch ("$WM_COMPILER_TYPE") +case OpenFOAM: +case ThirdParty: + # Default versions of GMP, MPFR and MPC, override as necessary + set gmp_version=gmp-system + set mpfr_version=mpfr-system + set mpc_version=mpc-system + + switch ("$WM_COMPILER") + case Gcc: + case Gcc48: + set gcc_version=gcc-4.8.5 + breaksw + case Gcc45: + set gcc_version=gcc-4.5.4 + breaksw + case Gcc46: + set gcc_version=gcc-4.6.4 + breaksw + case Gcc47: + set gcc_version=gcc-4.7.4 + breaksw + case Gcc49: + set gcc_version=gcc-4.9.3 + breaksw + case Gcc51: + set gcc_version=gcc-5.1.0 + breaksw + case Gcc52: + set gcc_version=gcc-5.2.0 + breaksw + case Gcc53: + set gcc_version=gcc-5.3.0 + breaksw + case Gcc54: + set gcc_version=gcc-5.4.0 + breaksw + case Gcc61: + set gcc_version=gcc-6.1.0 + breaksw + case Clang: + # Using clang - not gcc + setenv WM_CC 'clang' + setenv WM_CXX 'clang++' + set clang_version=llvm-3.7.0 + # set clang_version=llvm-3.8.0 + breaksw + default: + echo + echo "Warning in $WM_PROJECT_DIR/etc/config.csh/compiler:" + echo " Unknown OpenFOAM compiler type '$WM_COMPILER'" + echo " Please check your settings" + echo + breaksw + endsw +endsw + +#------------------------------------------------------------------------------ diff --git a/etc/config.csh/settings b/etc/config.csh/settings index 6c201aefa8..592b71bbb3 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -213,65 +213,21 @@ if ( ! $?WM_COMPILER_TYPE ) then echo " WM_COMPILER_TYPE not set, using '$WM_COMPILER_TYPE'" endif +# Load configured compiler versions, regardless of the compiler type +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/compiler` + switch ("$WM_COMPILER_TYPE") +case system: + # Use system compiler + breaksw + case OpenFOAM: case ThirdParty: - # Default versions of GMP, MPFR and MPC, overide as necessary - set gmp_version=gmp-system - set mpfr_version=mpfr-system - set mpc_version=mpc-system - switch ("$WM_COMPILER") - case Gcc: - case Gcc48: - set gcc_version=gcc-4.8.5 - breaksw - case Gcc45: - set gcc_version=gcc-4.5.4 - breaksw - case Gcc46: - set gcc_version=gcc-4.6.4 - breaksw - case Gcc47: - set gcc_version=gcc-4.7.4 - breaksw - case Gcc49: - set gcc_version=gcc-4.9.3 - breaksw - case Gcc51: - set gcc_version=gcc-5.1.0 - breaksw - case Gcc52: - set gcc_version=gcc-5.2.0 - breaksw - case Gcc53: - set gcc_version=gcc-5.3.0 - breaksw - case Gcc54: - set gcc_version=gcc-5.4.0 - breaksw - case Gcc61: - set gcc_version=gcc-6.1.0 - breaksw - case Clang: - # Using clang - not gcc - setenv WM_CC 'clang' - setenv WM_CXX 'clang++' - set clang_version=llvm-3.7.0 - # set clang_version=llvm-3.8.0 - breaksw - default: - echo - echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:" - echo " Unknown OpenFOAM compiler type '$WM_COMPILER'" - echo " Please check your settings" - echo - breaksw - endsw - - # Optional configuration tweaks: - _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/compiler` - if ( $?gcc_version ) then + if ( ! $?gmp_version ) set gmp_version=gmp-system + if ( ! $?mpfr_version ) set mpfr_version=mpfr-system + if ( ! $?mpc_version ) set mpc_version=mpc-system set gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version set gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version set mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version @@ -333,14 +289,15 @@ case ThirdParty: _foamAddMan $clangDir/man _foamAddPath $clangDir/bin + + if ($?FOAM_VERBOSE && $?prompt) then + echo "Using ThirdParty compiler" + echo " ${clangDir:t}" + endif endif unset clang_version clangDir breaksw -case system: - # Use system compiler - breaksw - default: echo "Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported" echo " treating as 'system' instead" diff --git a/etc/config.sh/compiler b/etc/config.sh/compiler index bcf61cead9..876fe2b7fb 100644 --- a/etc/config.sh/compiler +++ b/etc/config.sh/compiler @@ -86,3 +86,5 @@ OpenFOAM | ThirdParty) ;; esac + +#------------------------------------------------------------------------------ diff --git a/etc/config.sh/settings b/etc/config.sh/settings index 48a1f9b0de..53cb221e00 100644 --- a/etc/config.sh/settings +++ b/etc/config.sh/settings @@ -214,8 +214,10 @@ fi _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler` case "$WM_COMPILER_TYPE" in +system) + # Use system compiler + ;; OpenFOAM | ThirdParty) - if [ -n "$gcc_version" ] then gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version @@ -284,12 +286,15 @@ OpenFOAM | ThirdParty) _foamAddMan $clangDir/share/man _foamAddPath $clangDir/bin + + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + echo "Using ThirdParty compiler" + echo " ${clangDir##*/}" + fi fi unset clang_version clangDir ;; -system) - # Use system compiler - ;; *) echo "Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported" 1>&2 echo " treating as 'system' instead" 1>&2 From 98e951e8ba8ba4978353c664dc30aef12db52a3a Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 16 Jun 2016 19:58:55 +0200 Subject: [PATCH 05/17] COMP: downgrade error to warning when building run-time post-pro - although the build is not 100% complete, it is only the run-time post-processing with VTK that is affected. - improve robustness and warning messages COMP: adjust build order (solvers, utilities) - as per http://bugs.openfoam.org/view.php?id=2116 --- applications/Allwmake | 2 +- .../graphics/runTimePostProcessing/Allwmake | 32 +++++++++++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/applications/Allwmake b/applications/Allwmake index 2a922d6ae5..23c5ebbae0 100755 --- a/applications/Allwmake +++ b/applications/Allwmake @@ -20,8 +20,8 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || { set -x -wmake -all utilities $* wmake -all solvers $* +wmake -all utilities $* #------------------------------------------------------------------------------ diff --git a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake index aa7ed7cc7e..ac92255621 100755 --- a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake +++ b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake @@ -11,18 +11,38 @@ sourceDir=$PWD findObjectDir dummy.C depDir="$objectsDir" -if [ -d "$VTK_DIR" -o -d "$ParaView_DIR" ] +echo +echo "======================================================================" +echo "${PWD##*/} : $PWD" +echo + +if [ -d "$VTK_DIR" -o -d "$ParaView_DIR" ] then # ensure CMake gets the correct C++ compiler [ -n "$WM_CXX" ] && export CXX="$WM_CXX" [ -n "$WM_CC" ] && export CC="$WM_CC" - (mkdir -p $depDir && cd $depDir && cmake $sourceDir && make) + if type cmake > /dev/null 2>&1 + then + ( + mkdir -p $depDir \ + && cd $depDir \ + && cmake $sourceDir \ + && make + ) || { + echo + echo "WARNING: incomplete build of VTK-based post-processing" + } + else + echo "WARNING: skipped - needs cmake" + fi else - echo "ERROR: Build of $PWD requires a valid VTK installation which" - echo " can be supplied either by ParaView by VTK. In case of" - echo " - ParaView : export the ParaView_DIR environment variable" - echo " - VTK : export the VTK_DIR variable" + echo "WARNING: skipped - needs a VTK or a ParaView installation" + echo " - For ParaView : export the 'ParaView_DIR' variable" + echo " - For VTK : export the 'VTK_DIR' variable" fi +echo "======================================================================" +echo + # ----------------------------------------------------------------- end-of-file From 97943ed8198f29edcb4b62f0f77944df23b6e803 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 17 Jun 2016 09:31:41 +0200 Subject: [PATCH 06/17] COMP: improve robustness and warning messages when building paraview plugins --- .../utilities/mesh/generation/Allwmake | 12 +--- .../mesh/generation/foamyMesh/Allwmake | 22 +++++--- .../graphics/PV3Readers/Allwmake | 56 +++++++++++++++---- .../graphics/PVReaders/Allwmake | 56 +++++++++++++++---- .../surface/surfaceBooleanFeatures/Allwmake | 10 +++- .../surfaceBooleanFeatures/Make/options | 1 - etc/config.csh/CGAL | 19 ++++++- etc/config.sh/CGAL | 8 ++- .../graphics/runTimePostProcessing/Allwclean | 3 +- src/renumber/Allwmake | 14 ++--- 10 files changed, 140 insertions(+), 61 deletions(-) diff --git a/applications/utilities/mesh/generation/Allwmake b/applications/utilities/mesh/generation/Allwmake index 2211a8c0b9..d4b3015ba7 100755 --- a/applications/utilities/mesh/generation/Allwmake +++ b/applications/utilities/mesh/generation/Allwmake @@ -3,12 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for compilation (at least for error catching) . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments - -# Get CGAL and boost versions -. $WM_PROJECT_DIR/etc/config.sh/functions -_foamEval SOURCE_CGAL_VERSIONS_ONLY=yes \ - $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL) - set -x wmake -all blockMesh @@ -16,10 +10,6 @@ wmake -all extrude wmake -all extrude2DMesh wmake -all snappyHexMesh -if [ -n "$CGAL_ARCH_PATH" -o "$cgal_version" = "cgal-system" ] -then - foamyMesh/Allwmake $* -fi - +foamyMesh/Allwmake $* #------------------------------------------------------------------------------ diff --git a/applications/utilities/mesh/generation/foamyMesh/Allwmake b/applications/utilities/mesh/generation/foamyMesh/Allwmake index 17241fde08..9faba8d9bf 100755 --- a/applications/utilities/mesh/generation/foamyMesh/Allwmake +++ b/applications/utilities/mesh/generation/foamyMesh/Allwmake @@ -4,15 +4,21 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation targetType=libso . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x -wmake $targetType conformalVoronoiMesh -wmake $targetType conformalVoronoi2DMesh -wmake foamyQuadMesh -wmake foamyHexMesh -#wmake foamyHexMeshBackgroundMesh -#(cd foamyHexMeshSurfaceSimplify && ./Allwmake) -#wmake cellSizeAndAlignmentGrid +if [ -d "$CGAL_ARCH_PATH/include/CGAL" ] || \ + [ "${CGAL_ARCH_PATH##*-}" = system -a -d /usr/include/CGAL ] +then + set -x + wmake $targetType conformalVoronoiMesh + wmake $targetType conformalVoronoi2DMesh + wmake foamyQuadMesh + wmake foamyHexMesh + # wmake foamyHexMeshBackgroundMesh + # (cd foamyHexMeshSurfaceSimplify && ./Allwmake) + # wmake cellSizeAndAlignmentGrid +else + echo "WARNING: cannot build ${PWD##*/} without CGAL" +fi #------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake index 049c1bfca0..b34e11bf4b 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake @@ -1,32 +1,66 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory +# Optional unit: continue-on-error +export WM_CONTINUE_ON_ERROR=true + # Parse arguments for library compilation targetType=libso . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -#set -x +# +# There are several prerequisites for building a plugin +# +#set -x +canBuildPlugin() +{ + [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] || { + echo + echo "WARNING: cannot build ParaView plugin(s) without paraview directory" + echo " ParaView_DIR=$ParaView_DIR" + echo + return 1 + } + + [ -n "$PV_PLUGIN_PATH" ] || { + echo + echo "${PWD##*/} : invalid PV_PLUGIN_PATH for building ParaView plugin(s)" + echo " PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-unset}" + echo + return 1 + } + + type cmake > /dev/null 2>&1 || { + echo + echo "WARNING: cannot build ParaView plugin(s) without cmake" + echo + return 1 + } + + return 0 # success +} + + +# ----------------------------------------------------------------------------- case "$ParaView_VERSION" in 3*) - if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] + if canBuildPlugin then - [ -n "$PV_PLUGIN_PATH" ] || { - echo "$0 : PV_PLUGIN_PATH not valid - it is unset" - exit 1 - } - - # ensure CMake gets the correct C++ compiler + ( + # C++ compiler for CMake [ -n "$WM_CXX" ] && export CXX="$WM_CXX" wmake $targetType vtkPV3Readers PV3blockMeshReader/Allwmake $* PV3FoamReader/Allwmake $* - else - echo "ERROR: ParaView not found in $ParaView_DIR" + ) fi ;; *) - echo "WARN: PV3 readers not building: ParaView_VERSION=$ParaView_VERSION" + echo + echo "NOTE: skipping build of ParaView V3 plugin(s)" + echo " different version: ParaView_VERSION=$ParaView_VERSION" + echo ;; esac diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake index edaa31a37b..0680975560 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake @@ -1,32 +1,66 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory +# Optional unit: continue-on-error +export WM_CONTINUE_ON_ERROR=true + # Parse arguments for library compilation targetType=libso . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -#set -x +# +# There are several prerequisites for building a plugin +# +#set -x +canBuildPlugin() +{ + [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] || { + echo + echo "WARNING: cannot build ParaView plugin(s) without paraview directory" + echo " ParaView_DIR=$ParaView_DIR" + echo + return 1 + } + + [ -n "$PV_PLUGIN_PATH" ] || { + echo + echo "${PWD##*/} : invalid PV_PLUGIN_PATH for building ParaView plugin(s)" + echo " PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-unset}" + echo + return 1 + } + + type cmake > /dev/null 2>&1 || { + echo + echo "WARNING: cannot build ParaView plugin(s) without cmake" + echo + return 1 + } + + return 0 # success +} + + +# ----------------------------------------------------------------------------- case "$ParaView_VERSION" in 4* | 5*) - if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] + if canBuildPlugin then - [ -n "$PV_PLUGIN_PATH" ] || { - echo "$0 : PV_PLUGIN_PATH not valid - it is unset" - exit 1 - } - - # ensure CMake gets the correct C++ compiler + ( + # C++ compiler for CMake [ -n "$WM_CXX" ] && export CXX="$WM_CXX" wmake $targetType vtkPVReaders PVblockMeshReader/Allwmake $* PVFoamReader/Allwmake $* - else - echo "ERROR: ParaView not found in $ParaView_DIR" + ) fi ;; *) - echo "WARN: PV readers not building: ParaView_VERSION=$ParaView_VERSION" + echo + echo "NOTE: skipping build of ParaView plugin(s)" + echo " different version: ParaView_VERSION=$ParaView_VERSION" + echo ;; esac diff --git a/applications/utilities/surface/surfaceBooleanFeatures/Allwmake b/applications/utilities/surface/surfaceBooleanFeatures/Allwmake index 50d640f2b2..98d3d2035c 100755 --- a/applications/utilities/surface/surfaceBooleanFeatures/Allwmake +++ b/applications/utilities/surface/surfaceBooleanFeatures/Allwmake @@ -2,14 +2,18 @@ cd ${0%/*} || exit 1 # Run from this directory set -x -if [ -z "$CGAL_ARCH_PATH" ] +unset COMPILE_FLAGS LINK_FLAGS + +if [ -d "$CGAL_ARCH_PATH/include/CGAL" ] || \ + [ "${CGAL_ARCH_PATH##*-}" = system -a -d /usr/include/CGAL ] then - export COMPILE_FLAGS="-DNO_CGAL" -else wmake PolyhedronReader export COMPILE_FLAGS='-IPolyhedronReader' export LINK_FLAGS='${CGAL_LIBS} -lPolyhedronReader' +else + export COMPILE_FLAGS="-DNO_CGAL" fi + wmake # ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/surface/surfaceBooleanFeatures/Make/options b/applications/utilities/surface/surfaceBooleanFeatures/Make/options index ed05fef039..873db3134a 100644 --- a/applications/utilities/surface/surfaceBooleanFeatures/Make/options +++ b/applications/utilities/surface/surfaceBooleanFeatures/Make/options @@ -15,7 +15,6 @@ EXE_INC = \ ${CGAL_INC} \ ${c++CGALWARN} \ $(COMPILE_FLAGS) \ - -IPolyhedronReader \ -I$(FOAM_SRC)/surfMesh/lnInclude \ -I$(FOAM_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/edgeMesh/lnInclude \ diff --git a/etc/config.csh/CGAL b/etc/config.csh/CGAL index 14304f46a4..a0fad016ba 100644 --- a/etc/config.csh/CGAL +++ b/etc/config.csh/CGAL @@ -22,12 +22,27 @@ # along with OpenFOAM. If not, see . # # File -# config.csh/CGAL +# etc/config.csh/CGAL # # Description # Setup file for CGAL (& boost) include/libraries. # Sourced from OpenFOAM-/etc/cshrc -##------------------------------------------------------------------------------ +# +# If using system-wide installations, use the following settings: +# +# boost_version=boost-system +# cgal_version=cgal-system +# +# If using a central installation: +# - specify boost-system / cgal-system +# - provide full paths for BOOST_ARCH_PATH / CGAL_ARCH_PATH +# +# Note +# When building OpenFOAM, any changes made here MUST be made in the +# equivalent config.sh version too, since that is the one which will +# be used during the build process. +# +#------------------------------------------------------------------------------ set boost_version=boost-system set cgal_version=CGAL-4.8 diff --git a/etc/config.sh/CGAL b/etc/config.sh/CGAL index 654140addd..119858485a 100644 --- a/etc/config.sh/CGAL +++ b/etc/config.sh/CGAL @@ -28,11 +28,15 @@ # Setup file for CGAL (& boost) include/libraries. # Sourced from OpenFOAM-/etc/bashrc # -# If using system-wide installations for either one, use the following -# version settings: +# If using system-wide installations, use the following settings: # # boost_version=boost-system # cgal_version=cgal-system +# +# If using a central installation: +# - specify boost-system / cgal-system +# - provide full paths for BOOST_ARCH_PATH / CGAL_ARCH_PATH +# #------------------------------------------------------------------------------ boost_version=boost-system diff --git a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwclean b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwclean index b570283bce..4cee715d32 100755 --- a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwclean +++ b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwclean @@ -7,6 +7,5 @@ cd ${0%/*} || exit 1 # Run from this directory ( # Where are the generated files stored? findObjectDir dummy.C - depDir="$objectsDir" - rm -rf "$depDir" > /dev/null 2>&1 + rm -rf "$objectsDir" > /dev/null 2>&1 ) diff --git a/src/renumber/Allwmake b/src/renumber/Allwmake index a44d239870..14191c9526 100755 --- a/src/renumber/Allwmake +++ b/src/renumber/Allwmake @@ -5,11 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory targetType=libso . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -# Get CGAL and scotch versions -. $WM_PROJECT_DIR/etc/config.sh/functions -_foamEval SOURCE_CGAL_VERSIONS_ONLY=yes \ - $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL) - ## Get ZOLTAN_ARCH_PATH #if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan` #then @@ -21,22 +16,21 @@ _foamEval SOURCE_CGAL_VERSIONS_ONLY=yes \ # echo #fi - set -x wmake $targetType renumberMethods -if [ -n "$BOOST_ARCH_PATH" -o "$boost_version" = "boost-system" ] +if [ -d "$BOOST_ARCH_PATH/include/boost" ] || \ + [ "${BOOST_ARCH_PATH##*-}" = system -a -d /usr/include/boost ] then wmake $targetType SloanRenumber else echo - echo "Skipping SloanRenumber" + echo "Skipping SloanRenumber (no boost)" echo fi - -if [ -n "$ZOLTAN_ARCH_PATH" ] +if [ -d "$ZOLTAN_ARCH_PATH" ] then wmake $targetType zoltanRenumber else From c740656eb4d82f50b9ba75570ea2401ef1a1461b Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 17 Jun 2016 16:53:14 +0200 Subject: [PATCH 07/17] ENH: replace SOURCE_CGAL_VERSIONS_ONLY workaround (fixes #148) - replace with an alternative workaround. Unset the _foamAddLib function prior to sourcing config.sh/CGAL: - LD_LIBRARY_PATH will not be adjusted. - cgal_version/boost_version variables will be retained. Note: for ThirdParty builds, it is important that the boost and CGAL paths are added into LD_LIBRARY_PATH even if before they are created. This ensures that the OpenFOAM environment is functional after the build. The '*-none' and '*-system' specifications can still be used to avoid setting them at all. --- etc/config.csh/CGAL | 32 ++++++++++++++++++-------- etc/config.sh/CGAL | 56 ++++++++++++++++++++++++++++----------------- 2 files changed, 57 insertions(+), 31 deletions(-) diff --git a/etc/config.csh/CGAL b/etc/config.csh/CGAL index a0fad016ba..5371099a25 100644 --- a/etc/config.csh/CGAL +++ b/etc/config.csh/CGAL @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation -# \\/ M anipulation | +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -33,7 +33,13 @@ # boost_version=boost-system # cgal_version=cgal-system # -# If using a central installation: +# If the system boost/cgal is unusable (eg, too old) and you don't +# have or want a ThirdParty installation: +# +# boost_version=boost-none +# cgal_version=cgal-none +# +# If using a central installation, but not located under ThirdParty: # - specify boost-system / cgal-system # - provide full paths for BOOST_ARCH_PATH / CGAL_ARCH_PATH # @@ -50,20 +56,26 @@ set cgal_version=CGAL-4.8 setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version +#------------------------------------------------------------------------------ if ($?FOAM_VERBOSE && $?prompt) then - echo "Using CGAL and boost" - echo " $cgal_version at $CGAL_ARCH_PATH" - echo " $boost_version at $BOOST_ARCH_PATH" + echo "Using boost ($boost_version) -> $BOOST_ARCH_PATH" + echo "Using CGAL ($cgal_version) -> $CGAL_ARCH_PATH" endif -if ( -d "$CGAL_ARCH_PATH" ) then - _foamAddLib $CGAL_ARCH_PATH/lib -endif +# If BOOST_ARCH_PATH, CGAL_ARCH_PATH do not end with '-system' or '-none', +# they are either located within ThirdParty, or a central installation +# outside of ThirdParty and must be added to the lib-path. -if ( -d "$BOOST_ARCH_PATH" ) then +set ending="${BOOST_ARCH_PATH:t}" +if ( "$ending" != "boost-none" && "$ending" != "boost-system" ) then _foamAddLib $BOOST_ARCH_PATH/lib endif -unset boost_version cgal_version +set ending="${CGAL_ARCH_PATH:t}" +if ( "$ending" != "cgal-none" && "$ending" != "cgal-system" ) then + _foamAddLib $CGAL_ARCH_PATH/lib +endif + +unset boost_version cgal_version ending #------------------------------------------------------------------------------ diff --git a/etc/config.sh/CGAL b/etc/config.sh/CGAL index 119858485a..afb178d709 100644 --- a/etc/config.sh/CGAL +++ b/etc/config.sh/CGAL @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation -# \\/ M anipulation | +# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -33,41 +33,55 @@ # boost_version=boost-system # cgal_version=cgal-system # -# If using a central installation: +# If the system boost/cgal is unusable (eg, too old) and you don't +# have or want a ThirdParty installation: +# +# boost_version=boost-none +# cgal_version=cgal-none +# +# If using a central installation, but not located under ThirdParty: # - specify boost-system / cgal-system # - provide full paths for BOOST_ARCH_PATH / CGAL_ARCH_PATH # +# Note +# When _foamAddLib is unset (eg, called from makeCGAL): +# - boost_version / cgal_version variables are retained. +# - the LD_LIBRARY_PATH is not adjusted. #------------------------------------------------------------------------------ boost_version=boost-system cgal_version=CGAL-4.8 -if [ -z "$SOURCE_CGAL_VERSIONS_ONLY" ] +export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version +export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version + +#------------------------------------------------------------------------------ +if [ "$FOAM_VERBOSE" -a "$PS1" ] +then + echo "Using boost ($boost_version) -> $BOOST_ARCH_PATH" 1>&2 + echo "Using CGAL ($cgal_version) -> $CGAL_ARCH_PATH" 1>&2 +fi + +if type _foamAddLib > /dev/null 2>&1 # normal sourcing then - common_path=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER + # If BOOST_ARCH_PATH, CGAL_ARCH_PATH do not end with '-system' or '-none', + # they are either located within ThirdParty, or a central installation + # outside of ThirdParty and must be added to the lib-path. - export BOOST_ARCH_PATH=$common_path/$boost_version - export CGAL_ARCH_PATH=$common_path/$cgal_version - - if [ "$FOAM_VERBOSE" -a "$PS1" ] - then - echo "Using CGAL and boost" 1>&2 - echo " $cgal_version at $CGAL_ARCH_PATH" 1>&2 - echo " $boost_version at $BOOST_ARCH_PATH" 1>&2 - fi - - if [ -d "$CGAL_ARCH_PATH" -a "$cgal_version" != "cgal-system" ] - then - _foamAddLib $CGAL_ARCH_PATH/lib - fi - - if [ -d "$BOOST_ARCH_PATH" -a "$boost_version" != "boost-system" ] + ending="${BOOST_ARCH_PATH##*-}" + if [ "$ending" != none -a "$ending" != system ] then _foamAddLib $BOOST_ARCH_PATH/lib fi - unset boost_version cgal_version common_path + ending="${CGAL_ARCH_PATH##*-}" + if [ "$ending" != none -a "$ending" != system ] + then + _foamAddLib $CGAL_ARCH_PATH/lib + fi + + unset boost_version cgal_version ending fi From b2b4123164d19072e1d6d3dcd51e42c0688d49f7 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 17 Jun 2016 19:56:19 +0200 Subject: [PATCH 08/17] STYLE: minor config file details - move unset mpi buffer size from config.csh/settings -> config.csh/mpi - wmUNSET now also unalias wmREFRESH Note: unsetenv WM_COMPILER_TYPE in csh variant? - drop reference to paraview-3 in config files. Cannot say anything definite about support for versions this old (2012) --- etc/config.csh/mpi | 5 ++++- etc/config.csh/paraview | 6 +----- etc/config.csh/settings | 1 - etc/config.csh/unset | 1 + etc/config.sh/aliases | 2 +- etc/config.sh/mpi | 1 - etc/config.sh/paraview | 6 +----- etc/config.sh/unset | 1 + 8 files changed, 9 insertions(+), 14 deletions(-) diff --git a/etc/config.csh/mpi b/etc/config.csh/mpi index 34280a12c9..ff21379258 100644 --- a/etc/config.csh/mpi +++ b/etc/config.csh/mpi @@ -261,7 +261,6 @@ if ( "$FOAM_MPI" != dummy ) then endif - # Set the minimum MPI buffer size (used by all platforms except SGI MPI) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if ( ! $?minBufferSize ) set minBufferSize=20000000 @@ -274,4 +273,8 @@ else setenv MPI_BUFFER_SIZE $minBufferSize endif +# Cleanup environment: +# ~~~~~~~~~~~~~~~~~~~~ +unset minBufferSize + #------------------------------------------------------------------------------ diff --git a/etc/config.csh/paraview b/etc/config.csh/paraview index df5e680a34..12de70491b 100644 --- a/etc/config.csh/paraview +++ b/etc/config.csh/paraview @@ -25,7 +25,7 @@ # config.csh/paraview # # Description -# Setup file for paraview-[3-5].x +# Setup file for paraview # Sourced from OpenFOAM-/etc/cshrc or from foamPV alias # # Note @@ -49,10 +49,6 @@ foreach cmake ( cmake-3.2.1 cmake-2.8.12.1 cmake-2.8.8 cmake-2.8.4 cmake-2.8.3 c end #- ParaView version, automatically determine major version: -#setenv ParaView_VERSION 3.12.0 -#setenv ParaView_VERSION 4.0.1 -#setenv ParaView_VERSION 4.1.0 -#setenv ParaView_VERSION 4.3.1 #setenv ParaView_VERSION 4.4.0 setenv ParaView_VERSION 5.0.1 setenv ParaView_MAJOR detect diff --git a/etc/config.csh/settings b/etc/config.csh/settings index 592b71bbb3..ed6227d58d 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -308,7 +308,6 @@ endsw # Cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ #- keep _foamAddPath _foamAddLib _foamAddMan -unset minBufferSize unsetenv WM_COMPILER_TYPE #------------------------------------------------------------------------------ diff --git a/etc/config.csh/unset b/etc/config.csh/unset index 38bedd2874..c076d82e12 100644 --- a/etc/config.csh/unset +++ b/etc/config.csh/unset @@ -166,6 +166,7 @@ unalias wm32 unalias wmSP unalias wmDP +unalias wmREFRESH unalias wmUNSET unalias wmSchedON diff --git a/etc/config.sh/aliases b/etc/config.sh/aliases index 44de3c70b5..872cbf9c42 100644 --- a/etc/config.sh/aliases +++ b/etc/config.sh/aliases @@ -55,7 +55,7 @@ alias wmSchedOFF='unset WM_SCHEDULER' unset foamPV foamPV() { - . $WM_PROJECT_DIR/etc/config.sh/paraview ParaView_VERSION=$1 + . $WM_PROJECT_DIR/etc/config.sh/paraview ParaView_VERSION=${1:-none} echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)" 1>&2 } diff --git a/etc/config.sh/mpi b/etc/config.sh/mpi index 36b651e0fc..18c69af6ca 100644 --- a/etc/config.sh/mpi +++ b/etc/config.sh/mpi @@ -256,7 +256,6 @@ then fi - # Set the minimum MPI buffer size (used by all platforms except SGI MPI) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ : ${minBufferSize:=20000000} diff --git a/etc/config.sh/paraview b/etc/config.sh/paraview index aebfd5b889..71a5964c72 100644 --- a/etc/config.sh/paraview +++ b/etc/config.sh/paraview @@ -25,7 +25,7 @@ # etc/config.sh/paraview # # Description -# Setup file for paraview-[3-5].x +# Setup file for paraview # Sourced from OpenFOAM-/etc/bashrc or from foamPV alias # # Note @@ -57,10 +57,6 @@ done #- ParaView version, automatically determine major version -#export ParaView_VERSION=3.12.0 -#export ParaView_VERSION=4.0.1 -#export ParaView_VERSION=4.1.0 -#export ParaView_VERSION=4.3.1 #export ParaView_VERSION=4.4.0 export ParaView_VERSION=5.0.1 export ParaView_MAJOR=detect diff --git a/etc/config.sh/unset b/etc/config.sh/unset index af44571f03..7a8ee309a9 100644 --- a/etc/config.sh/unset +++ b/etc/config.sh/unset @@ -145,6 +145,7 @@ unalias wm32 unalias wmSP unalias wmDP +unalias wmREFRESH unalias wmUNSET unalias wmSchedON From f317958d5a524df7cd37b376c6bdc2e271751acd Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 20 Jun 2016 11:04:25 +0200 Subject: [PATCH 09/17] BUG: wclean all does not use Allwclean in subdirectories (fixes #150) - also reported as http://bugs.openfoam.org/view.php?id=2125 --- wmake/wclean | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wmake/wclean b/wmake/wclean index c4f3808ba5..3e2c5f2b0b 100755 --- a/wmake/wclean +++ b/wmake/wclean @@ -157,8 +157,15 @@ then # For all the sub-directories containing a 'Make' directory for dir in `find . \( -type d -a -name Make \)` do + dir=${dir%/Make} # Parent directory - trim /Make from the end echo $dir - $0 ${dir%/Make} # Parent directory - trim /Make from the end + # If Allwclean exists execute otherwise wclean + if [ -e "$dir/Allwclean" ] + then + $dir/Allwclean + else + $0 $dir + fi done fi fi From 726aa8cdb9c5b1dd7eeb65cf85b6fda34c92ce35 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 20 Jun 2016 11:18:24 +0200 Subject: [PATCH 10/17] ENH: out of source build for paraview plugins - more consistent with the rest of the OpenFOAM source tree - improve wmake / wclean behaviour --- .../graphics/PVReaders/Allwclean | 3 +++ .../graphics/PVReaders/Allwmake | 4 +++ .../graphics/PVReaders/PVFoamReader/Allwclean | 10 ++++++- .../graphics/PVReaders/PVFoamReader/Allwmake | 26 ++++++++++++++----- .../PVReaders/PVblockMeshReader/Allwclean | 12 +++++++-- .../PVReaders/PVblockMeshReader/Allwmake | 26 ++++++++++++++----- .../graphics/runTimePostProcessing/Allwclean | 10 +++---- .../graphics/runTimePostProcessing/Allwmake | 4 +-- 8 files changed, 71 insertions(+), 24 deletions(-) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean index 0e2ae161c3..c8d0f03e86 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean @@ -6,4 +6,7 @@ wclean libso vtkPVReaders PVblockMeshReader/Allwclean PVFoamReader/Allwclean +# remove dummy directory (see Allwmake) +rmdir Make 2>/dev/null + #------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake index 0680975560..76a3697c6c 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake @@ -53,6 +53,10 @@ case "$ParaView_VERSION" in wmake $targetType vtkPVReaders PVblockMeshReader/Allwmake $* PVFoamReader/Allwmake $* + + # dummy directory to trigger proper 'wclean all' behaviour + # - the Allwclean will otherwise not be used + mkdir -p Make ) fi ;; diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean index 59f8be2f21..914ce6dd4e 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean @@ -1,11 +1,19 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Source the wmake functions +. $WM_DIR/scripts/wmakeFunctions + set -x # deal with client/server vs combined plugins rm -f $FOAM_LIBBIN/libPVFoamReader* 2>/dev/null -rm -rf PVFoamReader/Make +rm -rf PVFoamReader/Make # safety: old build location wclean libso vtkPVFoam +# Where are the generated files stored? +findObjectDir $PWD # remove entire top-level +rm -rf "$objectsDir" > /dev/null 2>&1 + #------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake index 70b8845d4b..313fdd2410 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake @@ -4,18 +4,30 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation targetType=libso . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x +# Source the wmake functions +. $WM_DIR/scripts/wmakeFunctions + +# C++ compiler for CMake +[ -n "$WM_CXX" ] && export CXX="$WM_CXX" + +set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] then wmake $targetType vtkPVFoam + sourceDir=$PWD/PVFoamReader + + # Where are any generated files stored? + findObjectDir $sourceDir ( - cd PVFoamReader - mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 - cd Make/$WM_OPTIONS - cmake ../.. - make - ) + mkdir -p $objectsDir \ + && cd $objectsDir \ + && cmake $sourceDir \ + && make + ) || { + echo + echo "WARNING: incomplete build of ParaView OpenFOAM plugin" + } fi #------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean index 5401dfdd07..afce206c8b 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean @@ -1,11 +1,19 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory + +# Source the wmake functions +. $WM_DIR/scripts/wmakeFunctions + set -x # deal with client/server vs combined plugins -rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null +rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null -rm -rf PVblockMeshReader/Make +rm -rf PVblockMeshReader/Make # safety: old build location wclean libso vtkPVblockMesh +# Where are the generated files stored? +findObjectDir $PWD # remove entire top-level +rm -rf "$objectsDir" > /dev/null 2>&1 + #------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake index 54b75743f9..76297f13a2 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake @@ -4,18 +4,30 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation targetType=libso . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -set -x +# Source the wmake functions +. $WM_DIR/scripts/wmakeFunctions + +# C++ compiler for CMake +[ -n "$WM_CXX" ] && export CXX="$WM_CXX" + +set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] then wmake $targetType vtkPVblockMesh + sourceDir=$PWD/PVblockMeshReader + + # Where are any generated files stored? + findObjectDir $sourceDir ( - cd PVblockMeshReader - mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 - cd Make/$WM_OPTIONS - cmake ../.. - make - ) + mkdir -p $objectsDir \ + && cd $objectsDir \ + && cmake $sourceDir \ + && make + ) || { + echo + echo "WARNING: incomplete build of ParaView BlockMesh plugin" + } fi #------------------------------------------------------------------------------ diff --git a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwclean b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwclean index 4cee715d32..1d94a698c5 100755 --- a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwclean +++ b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwclean @@ -4,8 +4,8 @@ cd ${0%/*} || exit 1 # Run from this directory # Source the wmake functions . $WM_DIR/scripts/wmakeFunctions -( - # Where are the generated files stored? - findObjectDir dummy.C - rm -rf "$objectsDir" > /dev/null 2>&1 -) +# Where are the generated files stored? +findObjectDir $PWD +rm -rf "$objectsDir" > /dev/null 2>&1 + +#------------------------------------------------------------------------------ diff --git a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake index ac92255621..727f9a20aa 100755 --- a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake +++ b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake @@ -4,11 +4,11 @@ cd ${0%/*} || exit 1 # Run from this directory # Source the wmake functions . $WM_DIR/scripts/wmakeFunctions -# Store current directory +# The source directory sourceDir=$PWD # Where are any generated files stored? -findObjectDir dummy.C +findObjectDir $sourceDir depDir="$objectsDir" echo From b4997ae091cdf41381e29fc4ee71d4a0b4423940 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 21 Jun 2016 12:23:44 +0200 Subject: [PATCH 11/17] CONFIG: only need one library variant for third-party openmpi - in 3rd-party we always build into lib$WM_COMPILER_LIB_ARCH and thus only need this one in LD_LIBRARY_PATH. --- etc/config.csh/mpi | 4 ---- etc/config.sh/mpi | 4 ---- 2 files changed, 8 deletions(-) diff --git a/etc/config.csh/mpi b/etc/config.csh/mpi index ff21379258..974555857a 100644 --- a/etc/config.csh/mpi +++ b/etc/config.csh/mpi @@ -61,11 +61,7 @@ case OPENMPI: setenv OPAL_PREFIX $MPI_ARCH_PATH _foamAddPath $MPI_ARCH_PATH/bin - - # 64-bit on OpenSuSE 12.1 uses lib64 others use lib _foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH - _foamAddLib $MPI_ARCH_PATH/lib - _foamAddMan $MPI_ARCH_PATH/share/man breaksw diff --git a/etc/config.sh/mpi b/etc/config.sh/mpi index 18c69af6ca..51e97f62de 100644 --- a/etc/config.sh/mpi +++ b/etc/config.sh/mpi @@ -58,11 +58,7 @@ OPENMPI) export OPAL_PREFIX=$MPI_ARCH_PATH _foamAddPath $MPI_ARCH_PATH/bin - - # 64-bit on OpenSuSE 12.1 uses lib64 others use lib _foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH - _foamAddLib $MPI_ARCH_PATH/lib - _foamAddMan $MPI_ARCH_PATH/share/man ;; From 95c9e53a14c9dbfccb50eac3cbd483b6a6bd06db Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 23 Jun 2016 16:15:27 +0200 Subject: [PATCH 12/17] STYLE: remove echo to stdout for profiling::writeNow() --- src/OpenFOAM/global/profiling/profiling.C | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/OpenFOAM/global/profiling/profiling.C b/src/OpenFOAM/global/profiling/profiling.C index a292172c21..e9c02687f7 100644 --- a/src/OpenFOAM/global/profiling/profiling.C +++ b/src/OpenFOAM/global/profiling/profiling.C @@ -90,8 +90,6 @@ bool Foam::profiling::writeNow() { if (pool_) { - Info<<"profiling::writeNow() at time = " - << pool_->owner().timeName() << endl; return pool_->write(); } else From 92f833db75bc72c2671432bcf33a378af5c0cd2e Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 23 Jun 2016 15:44:41 +0100 Subject: [PATCH 13/17] ENH: snappyHexMesh: walk through faceZones without attached cellZone If a side is not yet assigned to a cellZone (but the neighbour is) and the surface is not related to a faceZone, assign the neighbour cellZone. Fixes #156 --- .../meshRefinement/meshRefinement.H | 6 +- .../meshRefinement/meshRefinementBaffles.C | 68 ++++++++++++++----- 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.H b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.H index c0b2724da1..27c9f3b779 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.H +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinement.H @@ -678,12 +678,14 @@ private: ) const; //- Finds zone per cell. Uses topological walk with all faces - // marked in namedSurfaceIndex regarded as blocked. + // marked in unnamedSurfaceRegion (intersections with unnamed + // surfaces) and namedSurfaceIndex (intersections with named + // surfaces) regarded as blocked. void findCellZoneTopo ( const label backgroundZoneID, const pointField& locationsInMesh, - const labelList& allSurfaceIndex, + const labelList& unnamedSurfaceRegion, const labelList& namedSurfaceIndex, const labelList& surfaceToCellZone, labelList& cellToZone diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C index ebc759119f..e4ebecad7c 100644 --- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C @@ -1833,7 +1833,15 @@ bool Foam::meshRefinement::calcRegionToZone if (regionToCellZone[ownRegion] == -2) { - if (regionToCellZone[neiRegion] == surfZoneI) + if (surfZoneI == -1) + { + // Special: face is -on faceZone -not real boundary + // -not on cellZone + // so make regions same on either side + regionToCellZone[ownRegion] = regionToCellZone[neiRegion]; + changed = true; + } + else if (regionToCellZone[neiRegion] == surfZoneI) { // Face between unset and my region. Put unset // region into keepRegion @@ -1854,7 +1862,15 @@ bool Foam::meshRefinement::calcRegionToZone } else if (regionToCellZone[neiRegion] == -2) { - if (regionToCellZone[ownRegion] == surfZoneI) + if (surfZoneI == -1) + { + // Special: face is -on faceZone -not real boundary + // -not on cellZone + // so make regions same on either side + regionToCellZone[neiRegion] = regionToCellZone[ownRegion]; + changed = true; + } + else if (regionToCellZone[ownRegion] == surfZoneI) { // Face between unset and my region. Put unset // region into keepRegion @@ -1881,7 +1897,7 @@ void Foam::meshRefinement::findCellZoneTopo ( const label backgroundZoneID, const pointField& locationsInMesh, - const labelList& allSurfaceIndex, + const labelList& unnamedSurfaceRegion, const labelList& namedSurfaceIndex, const labelList& surfaceToCellZone, labelList& cellToZone @@ -1914,9 +1930,9 @@ void Foam::meshRefinement::findCellZoneTopo // Analyse regions. Reuse regionsplit boolList blockedFace(mesh_.nFaces()); - forAll(allSurfaceIndex, faceI) + forAll(unnamedSurfaceRegion, faceI) { - if (allSurfaceIndex[faceI] == -1) + if (unnamedSurfaceRegion[faceI] == -1 && namedSurfaceIndex[faceI] == -1) { blockedFace[faceI] = false; } @@ -2018,7 +2034,7 @@ void Foam::meshRefinement::findCellZoneTopo label surfI = namedSurfaceIndex[faceI]; // Connected even if no cellZone defined for surface - if (surfI != -1) + if (unnamedSurfaceRegion[faceI] == -1 && surfI != -1) { // Calculate region to zone from cellRegions on either side // of internal face. @@ -2058,7 +2074,7 @@ void Foam::meshRefinement::findCellZoneTopo label surfI = namedSurfaceIndex[faceI]; // Connected even if no cellZone defined for surface - if (surfI != -1) + if (unnamedSurfaceRegion[faceI] == -1 && surfI != -1) { bool changedCell = calcRegionToZone ( @@ -2353,6 +2369,7 @@ void Foam::meshRefinement::zonify labelList namedSurfaces(surfaceZonesInfo::getNamedSurfaces(surfZones)); + labelList unnamedSurfaces(surfaceZonesInfo::getUnnamedSurfaces(surfZones)); // Get map from surface to cellZone (or -1) labelList surfaceToCellZone; @@ -2379,15 +2396,17 @@ void Foam::meshRefinement::zonify // 1. Test all (unnamed & named) surfaces labelList globalRegion1; - labelList globalRegion2; - getIntersections - ( - identity(surfaces_.surfaces().size()), // surfacesToTest, - neiCc, - intersectedFaces(), // testFaces - globalRegion1, - globalRegion2 - ); + { + labelList globalRegion2; + getIntersections + ( + identity(surfaces_.surfaces().size()), // surfacesToTest, + neiCc, + intersectedFaces(), // testFaces + globalRegion1, + globalRegion2 + ); + } if (namedSurfaces.size()) { @@ -2555,12 +2574,25 @@ void Foam::meshRefinement::zonify Info<< "Walking from known cellZones; crossing a faceZone " << "face changes cellZone" << nl << endl; + labelList unnamedRegion1; + { + labelList unnamedRegion2; + getIntersections + ( + unnamedSurfaces, + neiCc, + intersectedFaces(), + unnamedRegion1, + unnamedRegion2 + ); + } + findCellZoneTopo ( backgroundZoneID, pointField(0), - globalRegion1, // To split up cells - namedSurfaceIndex, // Step across named surfaces to propagate + unnamedRegion1, // Intersections with unnamed surfaces + namedSurfaceIndex, // Intersections with named surfaces surfaceToCellZone, cellToZone ); From 704cfa1e0a58f3224a3fa8bc86deeaea037990d1 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 26 Jun 2016 15:39:43 +0200 Subject: [PATCH 14/17] ENH: add timing/memory info to foamToEnsight, foamToEnsightParts, foamToVTK - useful for performance comparisons --- .../foamToEnsight/foamToEnsight.C | 15 +++++++++++++- .../foamToEnsightParts/foamToEnsightParts.C | 16 ++++++++++++++- .../dataConversion/foamToVTK/foamToVTK.C | 20 +++++++++++++++++-- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C index 234c9d85b3..25e9905ac5 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C @@ -78,6 +78,8 @@ Note #include "cellSet.H" #include "fvMeshSubset.H" +#include "memInfo.H" + using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -153,6 +155,11 @@ int main(int argc, char *argv[]) const bool binary = !args.optionFound("ascii"); const bool nodeValues = args.optionFound("nodeValues"); + cpuTime timer; + memInfo mem; + Info<< "Initial memory " + << mem.update().size() << " kB" << endl; + #include "createTime.H" instantList Times = timeSelector::select0(runTime, args); @@ -743,6 +750,10 @@ int main(int argc, char *argv[]) } } } + + Info<< "Wrote in " + << timer.cpuTimeIncrement() << " s, " + << mem.update().size() << " kB" << endl; } #include "ensightCaseTail.H" @@ -752,7 +763,9 @@ int main(int argc, char *argv[]) delete ensightCaseFilePtr; } - Info<< "End\n" << endl; + Info<< "\nEnd: " + << timer.elapsedCpuTime() << " s, " + << mem.update().peak() << " kB (peak)\n" << endl; return 0; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C index 0a3cdf6509..ff67c2758d 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/foamToEnsightParts.C @@ -71,6 +71,8 @@ Note #include "ensightParts.H" #include "ensightOutputFunctions.H" +#include "memInfo.H" + using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -132,6 +134,12 @@ int main(int argc, char *argv[]) const char* geometryName = "geometry"; #include "setRootCase.H" + + cpuTime timer; + memInfo mem; + Info<< "Initial memory " + << mem.update().size() << " kB" << endl; + #include "createTime.H" // get times list @@ -468,11 +476,17 @@ int main(int argc, char *argv[]) // remember the time index cloudTimesUsed[cloudName].append(timeIndex); } + + Info<< "Wrote in " + << timer.cpuTimeIncrement() << " s, " + << mem.update().size() << " kB" << endl; } #include "ensightOutputCase.H" - Info<< "\nEnd\n"<< endl; + Info<< "\nEnd: " + << timer.elapsedCpuTime() << " s, " + << mem.update().peak() << " kB (peak)\n" << endl; return 0; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C index b4c26b21cf..fa46eeb5ce 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C @@ -160,6 +160,7 @@ Note #include "surfaceMeshWriter.H" #include "writeSurfFields.H" +#include "memInfo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -319,6 +320,12 @@ int main(int argc, char *argv[]) ); #include "setRootCase.H" + + cpuTime timer; + memInfo mem; + Info<< "Initial memory " + << mem.update().size() << " kB" << endl; + #include "createTime.H" const bool doWriteInternal = !args.optionFound("noInternal"); @@ -429,10 +436,13 @@ int main(int argc, char *argv[]) mkDir(fvPath); - // Mesh wrapper; does subsetting and decomposition vtkMesh vMesh(mesh, cellSetName); + Info<< "VTK mesh topology: " + << timer.cpuTimeIncrement() << " s, " + << mem.update().size() << " kB" << endl; + // Scan for all possible lagrangian clouds HashSet allCloudDirs; @@ -1242,6 +1252,10 @@ int main(int argc, char *argv[]) writer.writeParcelHeader(0); } } + + Info<< "Wrote in " + << timer.cpuTimeIncrement() << " s, " + << mem.update().size() << " kB" << endl; } @@ -1302,7 +1316,9 @@ int main(int argc, char *argv[]) } } - Info<< "End\n" << endl; + Info<< "\nEnd: " + << timer.elapsedCpuTime() << " s, " + << mem.update().peak() << " kB (peak)\n" << endl; return 0; } From cbc169adba4f2b7460bc51db4afa1176a779a674 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 27 Jun 2016 10:14:18 +0100 Subject: [PATCH 15/17] ENH: insideCells: does not run parallel. Fixes #162. --- .../utilities/mesh/manipulation/insideCells/insideCells.C | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/applications/utilities/mesh/manipulation/insideCells/insideCells.C b/applications/utilities/mesh/manipulation/insideCells/insideCells.C index 4b0845abcb..31d1473294 100644 --- a/applications/utilities/mesh/manipulation/insideCells/insideCells.C +++ b/applications/utilities/mesh/manipulation/insideCells/insideCells.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,6 +36,7 @@ Description #include "triSurface.H" #include "triSurfaceSearch.H" #include "cellSet.H" +#include "globalMeshData.H" using namespace Foam; @@ -51,7 +52,6 @@ int main(int argc, char *argv[]) "Surface must be closed and singly connected." ); - argList::noParallel(); argList::validArgs.append("surfaceFile"); argList::validArgs.append("cellSet"); @@ -84,7 +84,8 @@ int main(int argc, char *argv[]) } - Info<< "Selected " << insideCells.size() << " of " << mesh.nCells() + Info<< "Selected " << returnReduce(insideCells.size(), sumOp