From 6aba1630eda366e0bf02b4f8b77044b9f7541f4d Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 24 Jun 2018 22:15:40 -0400 Subject: [PATCH 01/60] Minor corrections for compiling under macOS High Sierra (10.13.5) using the stock compiler Apple LLVM version 9.1.0 (clang-902.0.39.2) --- .../solvers/overset/simpleMRFOversetFoam/Make/options | 1 + .../solvers/overset/simpleOversetFoam/Make/options | 1 + src/foam/primitives/ints/uint64/uint64.H | 4 ++++ src/foam/primitives/ints/uint64/uint64IO.C | 8 ++++++++ 4 files changed, 14 insertions(+) diff --git a/applications/solvers/overset/simpleMRFOversetFoam/Make/options b/applications/solvers/overset/simpleMRFOversetFoam/Make/options index 1c5c9b88d..0b6d9bd5b 100644 --- a/applications/solvers/overset/simpleMRFOversetFoam/Make/options +++ b/applications/solvers/overset/simpleMRFOversetFoam/Make/options @@ -11,6 +11,7 @@ EXE_INC = \ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lfiniteVolume \ -loversetMesh \ -llduSolvers diff --git a/applications/solvers/overset/simpleOversetFoam/Make/options b/applications/solvers/overset/simpleOversetFoam/Make/options index 1c5c9b88d..0b6d9bd5b 100644 --- a/applications/solvers/overset/simpleOversetFoam/Make/options +++ b/applications/solvers/overset/simpleOversetFoam/Make/options @@ -11,6 +11,7 @@ EXE_INC = \ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTransportModels \ + -lincompressibleTurbulenceModel \ -lfiniteVolume \ -loversetMesh \ -llduSolvers diff --git a/src/foam/primitives/ints/uint64/uint64.H b/src/foam/primitives/ints/uint64/uint64.H index e31192fa0..2626e59f9 100644 --- a/src/foam/primitives/ints/uint64/uint64.H +++ b/src/foam/primitives/ints/uint64/uint64.H @@ -69,6 +69,10 @@ bool read(const char*, uint64_t&); Istream& operator>>(Istream&, uint64_t&); Ostream& operator<<(Ostream&, const uint64_t); +#if WM_ARCH_OPTION == 64 && darwin && __clang__ +Ostream& operator<<(Ostream&, const uintptr_t); +#endif + //- Template specialization for pTraits template<> class pTraits diff --git a/src/foam/primitives/ints/uint64/uint64IO.C b/src/foam/primitives/ints/uint64/uint64IO.C index 105f5d7f3..eae780175 100644 --- a/src/foam/primitives/ints/uint64/uint64IO.C +++ b/src/foam/primitives/ints/uint64/uint64IO.C @@ -98,5 +98,13 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const uint64_t i) return os; } +#if WM_ARCH_OPTION == 64 && darwin && __clang__ +Foam::Ostream& Foam::operator<<(Ostream& os, const uintptr_t i) +{ + os.write(label(i)); + os.check("Ostream& operator<<(Ostream&, const uintptr_t)"); + return os; +} +#endif // ************************************************************************* // From 8a12411d387dc4a62b0df5d1861dac325828d8a6 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Mon, 25 Jun 2018 22:37:58 -0400 Subject: [PATCH 02/60] ThirdParty: modification to the bash uninstallPackage() function. Make it easier to read, and more portable. --- .../tools/makeThirdPartyFunctionsForRPM | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/ThirdParty/tools/makeThirdPartyFunctionsForRPM b/ThirdParty/tools/makeThirdPartyFunctionsForRPM index 1fc376232..b5d9e19fb 100755 --- a/ThirdParty/tools/makeThirdPartyFunctionsForRPM +++ b/ThirdParty/tools/makeThirdPartyFunctionsForRPM @@ -284,22 +284,42 @@ uninstallPackage() pkg="$1"; echo "Removing ${pkg}" - [ -f $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}*.rpm ] && \ - rm -f $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}*.rpm || \ - echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}*.rpm" - [ -f $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz ] && \ - rm -f $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz || \ - echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz" - [ -f $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz ] && \ - rm -f $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz || \ - echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz" - [ -d $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}* ] && \ - rm -rf $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}* || \ - echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}*" - if [ "$2" = "alsoPackage" ]; then - [ -d $WM_THIRD_PARTY_DIR/packages/$pkg ] && \ - rm -rf $WM_THIRD_PARTY_DIR/packages/$pkg || \ - echo "Not found: $WM_THIRD_PARTY_DIR/packages/$pkg" + if [[ -f $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}-$WM_OPTIONS.$architecture.rpm ]]; then + rm -f $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}-$WM_OPTIONS.$architecture.rpm + else + echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}*.rpm" + fi + + if [[ -f $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz ]]; then + rm -f $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz + else + echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz" + fi + + if [[ -f $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz ]]; then + rm -f $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz + else + echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz" + fi + + foundDir=false + for dir_ in $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}* + do + if [[ -d "$dir_" ]]; then + rm -rf $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}* + foundDir=true + fi + done + if [ "$foundDir" = false ] ; then + echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}*" + fi + + if [[ "$2" = "alsoPackage" ]]; then + if [[ -d $WM_THIRD_PARTY_DIR/packages/$pkg ]]; then + rm -rf $WM_THIRD_PARTY_DIR/packages/$pkg + else + echo "Not found: $WM_THIRD_PARTY_DIR/packages/$pkg" + fi else echo "Add option alsoPackage to remove the installed files." fi From f2a471c5c8339b9ca17298aa4fbf5434d3519648 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Mon, 25 Jun 2018 22:59:38 -0400 Subject: [PATCH 03/60] ThirdParty: - Bumping cmake to version 3.11.4 - Bumping openmpi to version 3.1.0 --- ThirdParty/AllClean.stage1 | 3 +- ThirdParty/AllClean.stage2 | 3 +- ThirdParty/AllMake.stage1 | 9 +- ThirdParty/AllMake.stage2 | 19 +- ThirdParty/rpmBuild/SPECS/cmake-3.11.4.spec | 166 ++++++++++++ ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec | 262 +++++++++++++++++++ etc/bashrc | 2 +- etc/cshrc | 3 +- etc/prefs.csh-EXAMPLE | 6 +- etc/prefs.sh-EXAMPLE | 6 +- etc/settings.csh | 13 +- etc/settings.sh | 14 +- 12 files changed, 485 insertions(+), 21 deletions(-) create mode 100644 ThirdParty/rpmBuild/SPECS/cmake-3.11.4.spec create mode 100644 ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec diff --git a/ThirdParty/AllClean.stage1 b/ThirdParty/AllClean.stage1 index 4a151d513..65d8605f4 100755 --- a/ThirdParty/AllClean.stage1 +++ b/ThirdParty/AllClean.stage1 @@ -98,6 +98,7 @@ uninstallPackage cmake-2.8.11 $1 uninstallPackage cmake-2.8.12 $1 uninstallPackage cmake-3.2.2 $1 uninstallPackage cmake-3.3.2 $1 +uninstallPackage cmake-3.11.4 $1 echo @@ -107,5 +108,3 @@ echo ======================================== echo # ----------------------------------------------------------------- end-of-file - - diff --git a/ThirdParty/AllClean.stage2 b/ThirdParty/AllClean.stage2 index 63927bdc6..c0836c575 100755 --- a/ThirdParty/AllClean.stage2 +++ b/ThirdParty/AllClean.stage2 @@ -56,6 +56,7 @@ uninstallPackage openmpi-1.4.3 $1 uninstallPackage openmpi-1.5 $1 uninstallPackage openmpi-1.6.5 $1 uninstallPackage openmpi-1.8.4 $1 +uninstallPackage openmpi-3.1.0 $1 echo echo ======================================== @@ -64,5 +65,3 @@ echo ======================================== echo # ----------------------------------------------------------------- end-of-file - - diff --git a/ThirdParty/AllMake.stage1 b/ThirdParty/AllMake.stage1 index b1ff54715..ace238a28 100755 --- a/ThirdParty/AllMake.stage1 +++ b/ThirdParty/AllMake.stage1 @@ -182,11 +182,16 @@ echo ( rpm_make -p cmake-3.3.2 -s cmake-3.3.2.spec -u http://www.cmake.org/files/v3.3/cmake-3.3.2.tar.gz ) } +# cmake 3.11.4 +# +[ ! -z "$WM_THIRD_PARTY_USE_CMAKE_3114" ] && { + echo "Building cmake 3.11.4" + ( rpm_make -p cmake-3.11.4 -s cmake-3.11.4.spec -u http://www.cmake.org/files/v3.11/cmake-3.11.4.tar.gz ) +} + echo ======================================== echo Done ThirdParty AllMake: Stage1 echo ======================================== echo # ----------------------------------------------------------------- end-of-file - - diff --git a/ThirdParty/AllMake.stage2 b/ThirdParty/AllMake.stage2 index cb1e4da03..9bd65c8e0 100755 --- a/ThirdParty/AllMake.stage2 +++ b/ThirdParty/AllMake.stage2 @@ -31,10 +31,10 @@ # Communication libraries # # Once this stage is built, you would normally re-initialize your -# foam-extend environment in order redirect foam-extend toward the -# appropriate communication library +# foam-extend environment in order redirect foam-extend toward the +# appropriate communication library # -# NOTE: This stage is optional. Use it only if you want to override +# NOTE: This stage is optional. Use it only if you want to override # your system communication libraries # # Requirements: @@ -45,7 +45,7 @@ # # Author: # Martin Beaudoin, Hydro-Quebec, (2015) -# +# #------------------------------------------------------------------------------ # run from third-party directory only cd ${0%/*} || exit 1 @@ -104,6 +104,15 @@ then ( rpm_make -p openmpi-1.8.8 -s openmpi-1.8.8.spec -u https://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.8.tar.gz \ -f --define '_configureAdditionalArgs "$WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs"') } + + # openmpi 3.1.0 + # + [ ! -z "$WM_THIRD_PARTY_USE_OPENMPI_310" ] && { + echo "Building openmpi 3.1.0" + ( rpm_make -p openmpi-3.1.0 -s openmpi-3.1.0.spec -u https://www.open-mpi.org/software/ompi/v3.1/downloads/openmpi-3.1.0.tar.gz \ + -f --define '_configureAdditionalArgs "$WM_THIRD_PARTY_USE_OPENMPI_310_ConfigureAdditionalArgs"') + } + # mvipich2-2.2 # [ ! -z "$WM_THIRD_PARTY_USE_MVAPICH2_22" ] && { @@ -121,5 +130,3 @@ echo ======================================== echo # ----------------------------------------------------------------- end-of-file - - diff --git a/ThirdParty/rpmBuild/SPECS/cmake-3.11.4.spec b/ThirdParty/rpmBuild/SPECS/cmake-3.11.4.spec new file mode 100644 index 000000000..46466d871 --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/cmake-3.11.4.spec @@ -0,0 +1,166 @@ +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Script +# RPM spec file for cmake-3.11.4 +# +# Description +# RPM spec file for creating a relocatable RPM +# +# Author: +# Martin Beaudoin, (2018) +# Pascal Beckstein, HZDR, (2018) +# +#------------------------------------------------------------------------------ + +# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable +%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)} +%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)} + +# Disable the generation of debuginfo packages +%define debug_package %{nil} + +# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory +%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild +%define _tmppath %{_topdir}/tmp + +# Will install the package directly $WM_THIRD_PARTY_DIR +# Some comments about package relocation: +# By using this prefix for the Prefix: parameter in this file, you will make this +# package relocatable. +# +# This is fine, as long as your software is itself relocatable. +# +# Simply take note that libraries built with libtool are not relocatable because the +# prefix we specify will be hard-coded in the library .la files. +# Ref: http://sourceware.org/autobook/autobook/autobook_80.html +# +# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will +# not be able to reutilize this RPM, even though it is relocatable. You will need to +# regenerate the RPM. +# +%define _prefix %{_WM_THIRD_PARTY_DIR} + +%define name cmake +%define release %{_WM_OPTIONS} +%define version 3.11.4 + +%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root + +BuildRoot: %{buildroot} +Summary: cmake +License: Unkown +Name: %{name} +Version: %{version} +Release: %{release} +URL: http://www.cmake.org/files/v3.3/ +Source: %url/%{name}-%{version}.tar.gz +Prefix: %{_prefix} +Group: Development/Tools + + +%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS} + +%description +%{summary} + +%prep +%setup -q + +%build + # export WM settings in a form that GNU configure recognizes + [ -n "$WM_CC" ] && export CC="$WM_CC" + [ -n "$WM_CXX" ] && export CXX="$WM_CXX" + [ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS" + [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" + [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" + +%ifos darwin + # For Mac OSX: + # The configuration of cmake will be using the environment variable MACOSX_DEPLOYMENT_TARGET. + # This variable was initialized using 'sw_vers -productVersion' in etc/bashrc. + # We need to get rid of the revision number from this string. eg turn "10.7.5" into "10.7" + v=( ${MACOSX_DEPLOYMENT_TARGET//./ } ) + export MACOSX_DEPLOYMENT_TARGET="${v[0]}.${v[1]}" + echo "Resetting MACOSX_DEPLOYMENT_TARGET to ${MACOSX_DEPLOYMENT_TARGET}" + + # Recent version of Mac OSX (Yosemite) cannot compile cmake when gcc is the compiler + # Using clang instead + CC=clang + CXX=clang++ + +%endif + + ./configure \ + --prefix=%{_installPrefix} + + [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1 + make -j $WM_NCOMPPROCS + +%install + make install DESTDIR=$RPM_BUILD_ROOT + + # Creation of foam-extend specific .csh and .sh files" + + echo "" + echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}" + echo "" + # + # Generate package specific .sh file for foam-extend + # +mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc +cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export CMAKE_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +export CMAKE_BIN_DIR=\$CMAKE_DIR/bin + +# Enable access to the runtime package applications +[ -d \$CMAKE_BIN_DIR ] && _foamAddPath \$CMAKE_BIN_DIR +DOT_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv CMAKE_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +setenv CMAKE_BIN_DIR \$CMAKE_DIR/bin + +if ( -e \$CMAKE_BIN_DIR ) then + _foamAddPath \$CMAKE_BIN_DIR +endif +DOT_CSH_EOF + + #finally, generate a .tgz file for systems where using rpm for installing packages + # as a non-root user might be a problem. + (mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version}) + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_installPrefix} diff --git a/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec b/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec new file mode 100644 index 000000000..266d64c1c --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec @@ -0,0 +1,262 @@ +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Script +# RPM spec file for openmpi-3.1.0 +# +# Description +# RPM spec file for creating a relocatable RPM +# +# Author: +# Martin Beaudoin, (2018) +# +#------------------------------------------------------------------------------ + +# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable +%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)} +%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)} + +# Disable the generation of debuginfo packages +%define debug_package %{nil} + +# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory +%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild +%define _tmppath %{_topdir}/tmp + +# Will install the package directly $WM_THIRD_PARTY_DIR +# Some comments about package relocation: +# By using this prefix for the Prefix: parameter in this file, you will make this +# package relocatable. +# +# This is fine, as long as your software is itself relocatable. +# +# Simply take note that libraries built with libtool are not relocatable because the +# prefix we specify will be hard-coded in the library .la files. +# Ref: http://sourceware.org/autobook/autobook/autobook_80.html +# +# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will +# not be able to reutilize this RPM, even though it is relocatable. You will need to +# regenerate the RPM. +# +%define _prefix %{_WM_THIRD_PARTY_DIR} + +%define name openmpi +%define release %{_WM_OPTIONS} +%define version 3.1.0 + +%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root + +BuildRoot: %{buildroot} +Summary: openmpi +License: Unkown +Name: %{name} +Version: %{version} +Release: %{release} +URL: http://www.open-mpi.org/software/ompi/v1.8/downloads +Source: %url/%{name}-%{version}.tar.gz +Prefix: %{_prefix} +Group: Development/Tools + + +%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS} + +#-------------------------------------------------------------------------- +# +# Here, we define default compiling options for openmpi +# +# One can override the option on the commande line : --define='MACRO EXPR' +# +%{!?_configureAdditionalArgs: %define _configureAdditionalArgs Undefined} + + +%description +%{summary} + +%prep +%setup -q + + +%build + # export WM settings in a form that GNU configure recognizes + [ -n "$WM_CC" ] && export CC="$WM_CC" + [ -n "$WM_CXX" ] && export CXX="$WM_CXX" + [ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS" + [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" + [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" + + set +x + echo "" + echo "Compilation options:" + echo " _configureAdditionalArgs : %{_configureAdditionalArgs}" + echo "" + set -x + + unset mpiWith + # Enable GridEngine if it appears to be in use + # If you don't want any integration with SGE, simply unset the SGE + # environment variable + if [ -n "$SGE_ROOT" ] + then + mpiWith="$mpiWith --with-sge" + else + mpiWith="$mpiWith --without-sge" + mpiWith="$mpiWith --enable-mca-no-build=ras-gridengine,pls-gridengine" + fi + + # Infiniband support + # Adjust according to your local paths + # if [ -d /usr/local/ofed -a -d /usr/local/ofed/lib64 ] + # then + # mpiWith="$mpiWith --with-openib=/usr/local/ofed" + # mpiWith="$mpiWith --with-openib-libdir=/usr/local/ofed/lib64" + # fi + + ./configure \ + --prefix=%{_installPrefix} \ + --exec_prefix=%{_installPrefix} \ + --enable-mpirun-prefix-by-default \ + --enable-orterun-prefix-by-default \ + --enable-shared \ + --enable-mpi-cxx \ + --disable-static \ + --disable-mpi-fortran \ + --without-slurm \ + `echo %{?_configureAdditionalArgs}` + + [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1 + make -j $WM_NCOMPPROCS + +%install + make install DESTDIR=$RPM_BUILD_ROOT + + # Creation of foam-extend specific .csh and .sh files" + + echo "" + echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}" + echo "" + # + # Generate package specific .sh file for foam-extend + # +mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc +cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh +# Load %{name}-%{version} libraries and binaries +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +export OPENMPI_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +export OPENMPI_BIN_DIR=\$OPENMPI_DIR/bin +export OPENMPI_LIB_DIR=\$OPENMPI_DIR/lib + +# Enable access to the package runtime applications and libraries +[ -d \$OPENMPI_BIN_DIR ] && _foamAddPath \$OPENMPI_BIN_DIR +[ -d \$OPENMPI_LIB_DIR ] && _foamAddLib \$OPENMPI_LIB_DIR + +export MPI_HOME=\$OPENMPI_DIR +export MPI_ARCH_PATH=\$MPI_HOME +export OPAL_PREFIX=\$MPI_ARCH_PATH + +# We initialize the rest of the environment using mpicc --showme: +export OPENMPI_INCLUDE_DIR="\`mpicc --showme:incdirs\`" +export OPENMPI_COMPILE_FLAGS="\`mpicc --showme:compile\`" +export OPENMPI_LINK_FLAGS="\`mpicc --showme:link\`" + +# Set the foam-extend compilation flags +export PINC=\$OPENMPI_COMPILE_FLAGS +export PLIBS=\$OPENMPI_LINK_FLAGS + + +if [ "\$FOAM_VERBOSE" -a "\$PS1" ] +then + echo " Environment variables defined for OpenMPI:" + echo " OPENMPI_BIN_DIR : \$OPENMPI_BIN_DIR" + echo " OPENMPI_LIB_DIR : \$OPENMPI_LIB_DIR" + echo " OPENMPI_INCLUDE_DIR : \$OPENMPI_INCLUDE_DIR" + echo " OPENMPI_COMPILE_FLAGS : \$OPENMPI_COMPILE_FLAGS" + echo " OPENMPI_LINK_FLAGS : \$OPENMPI_LINK_FLAGS" + echo "" + echo " MPI_HOME : \$MPI_HOME" + echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH" + echo " OPAL_PREFIX : \$OPAL_PREFIX" + echo " PINC : \$PINC" + echo " PLIBS : \$PLIBS" +fi +DOT_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh +# Load %{name}-%{version} libraries and binaries +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv OPENMPI_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +setenv OPENMPI_BIN_DIR \$OPENMPI_DIR/bin +setenv OPENMPI_LIB_DIR \$OPENMPI_DIR/lib + +# Enable access to the package runtime applications and libraries +if ( -e \$OPENMPI_BIN_DIR ) then + _foamAddPath \$OPENMPI_BIN_DIR +endif + +if ( -e \$OPENMPI_LIB_DIR ) then + _foamAddLib \$OPENMPI_LIB_DIR +endif + +setenv MPI_HOME \$OPENMPI_DIR +setenv MPI_ARCH_PATH \$MPI_HOME +setenv OPAL_PREFIX \$MPI_ARCH_PATH + +# We initialize the rest of the environment using mpicc --showme: +setenv OPENMPI_INCLUDE_DIR "\`mpicc --showme:incdirs\`" +setenv OPENMPI_COMPILE_FLAGS "\`mpicc --showme:compile\`" +setenv OPENMPI_LINK_FLAGS "\`mpicc --showme:link\`" + +# Set the foam-extend compilation flags +setenv PINC "\$OPENMPI_COMPILE_FLAGS" +setenv PLIBS "\$OPENMPI_LINK_FLAGS" + + +if (\$?FOAM_VERBOSE && \$?prompt) then + echo " Environment variables defined for OpenMPI:" + echo " OPENMPI_BIN_DIR : \$OPENMPI_BIN_DIR" + echo " OPENMPI_LIB_DIR : \$OPENMPI_LIB_DIR" + echo " OPENMPI_INCLUDE_DIR : \$OPENMPI_INCLUDE_DIR" + echo " OPENMPI_COMPILE_FLAGS : \$OPENMPI_COMPILE_FLAGS" + echo " OPENMPI_LINK_FLAGS : \$OPENMPI_LINK_FLAGS" + echo "" + echo " MPI_HOME : \$MPI_HOME" + echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH" + echo " OPAL_PREFIX : \$OPAL_PREFIX" + echo " PINC : \$PINC" + echo " PLIBS : \$PLIBS" +endif +DOT_CSH_EOF + + #finally, generate a .tgz file for systems where using rpm for installing packages + # as a non-root user might be a problem. + (mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version}) + + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_installPrefix} diff --git a/etc/bashrc b/etc/bashrc index 2cfef00ca..6da62fd0a 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -96,7 +96,7 @@ export WM_THIRD_PARTY_DIR=$WM_PROJECT_DIR/ThirdParty # # For AllMake.stage2 -export WM_THIRD_PARTY_USE_OPENMPI_188=1 +export WM_THIRD_PARTY_USE_OPENMPI_310=1 # # For AllMake.stage3 diff --git a/etc/cshrc b/etc/cshrc index 1d337f444..5e7a3b200 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -82,7 +82,7 @@ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_DIR/ThirdParty # # For AllMake.stage2 -setenv WM_THIRD_PARTY_USE_OPENMPI_188 1 +setenv WM_THIRD_PARTY_USE_OPENMPI_310 1 # # For AllMake.stage3 @@ -424,4 +424,3 @@ unset cleanEnv cleanProg colonPath foamInstall foamOldDirs unalias _foamSource # ----------------------------------------------------------------------------- - diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index dc467a78b..db29e24a2 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -199,11 +199,13 @@ #setenv WM_THIRD_PARTY_USE_M4_1416 1 #setenv WM_THIRD_PARTY_USE_BISON_27 1 #setenv WM_THIRD_PARTY_USE_FLEX_2535 1 -setenv WM_THIRD_PARTY_USE_CMAKE_322 1 +#setenv WM_THIRD_PARTY_USE_CMAKE_322 1 +setenv WM_THIRD_PARTY_USE_CMAKE_3114 1 # # For AllMake.stage2 -setenv WM_THIRD_PARTY_USE_OPENMPI_188 1 +setenv WM_THIRD_PARTY_USE_OPENMPI_310 1 +#setenv WM_THIRD_PARTY_USE_OPENMPI_188 1 #setenv WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs '--enable-mpi-cxx --with-verbs' #setenv WM_THIRD_PARTY_USE_OPENMPI_165 1 #setenv WM_THIRD_PARTY_USE_OPENMPI_165_ConfigureAdditionalArgs '--enable-mpi-cxx --with-openib' diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index 4351e239c..d60fcd4ee 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -211,12 +211,14 @@ export FOAM_VERBOSE=1 #export WM_THIRD_PARTY_USE_M4_1416=1 #export WM_THIRD_PARTY_USE_BISON_27=1 #export WM_THIRD_PARTY_USE_FLEX_2535=1 +#export WM_THIRD_PARTY_USE_CMAKE_322=1 #export WM_THIRD_PARTY_USE_CMAKE_332=1 -export WM_THIRD_PARTY_USE_CMAKE_322=1 +export WM_THIRD_PARTY_USE_CMAKE_3114=1 # # For AllMake.stage2 -export WM_THIRD_PARTY_USE_OPENMPI_188=1 +export WM_THIRD_PARTY_USE_OPENMPI_310=1 +#export WM_THIRD_PARTY_USE_OPENMPI_188=1 #export WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs='--enable-mpi-cxx --with-verbs' #export WM_THIRD_PARTY_USE_OPENMPI_165=1 #export WM_THIRD_PARTY_USE_OPENMPI_165_ConfigureAdditionalArgs='--enable-mpi-cxx --with-openib' diff --git a/etc/settings.csh b/etc/settings.csh index d56468889..710502e3b 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -167,7 +167,15 @@ set mpi_version=unknown switch ("$WM_MPLIB") case OPENMPI: - if ($?WM_THIRD_PARTY_USE_OPENMPI_188 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-1.8.8/platforms/$WM_OPTIONS ) then + if ($?WM_THIRD_PARTY_USE_OPENMPI_310 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-3.1.0/platforms/$WM_OPTIONS ) then + set mpi_version=openmpi-3.1.0 + + if ($?FOAM_VERBOSE && $?prompt) then + echo "Using openmpi-3.1.0 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version" + endif + _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh + + else if ($?WM_THIRD_PARTY_USE_OPENMPI_188 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-1.8.8/platforms/$WM_OPTIONS ) then set mpi_version=openmpi-1.8.8 if ($?FOAM_VERBOSE && $?prompt) then @@ -547,6 +555,9 @@ endif # cmake # ~~~~~ +if ( $?CMAKE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_CMAKE_3114 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/cmake-3.11.4/platforms/$WM_OPTIONS ) then + _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-3.11.4/platforms/$WM_OPTIONS/etc/cmake-3.11.4.csh +endif if ( $?CMAKE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_CMAKE_332 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/cmake-3.3.2/platforms/$WM_OPTIONS ) then _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-3.3.2/platforms/$WM_OPTIONS/etc/cmake-3.3.2.csh endif diff --git a/etc/settings.sh b/etc/settings.sh index 1327cee6f..46f0db02a 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -213,7 +213,16 @@ unset MPI_ARCH_PATH mpi_version=unknown case "$WM_MPLIB" in OPENMPI) - if [ ! -z $WM_THIRD_PARTY_USE_OPENMPI_188 ] && [ -e $WM_THIRD_PARTY_DIR/packages/openmpi-1.8.8/platforms/$WM_OPTIONS ] + if [ ! -z $WM_THIRD_PARTY_USE_OPENMPI_310 ] && [ -e $WM_THIRD_PARTY_DIR/packages/openmpi-3.1.0/platforms/$WM_OPTIONS ] + then + mpi_version=openmpi-3.1.0 + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + echo "Using openmpi-3.1.0 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version" + fi + _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.sh + + elif [ ! -z $WM_THIRD_PARTY_USE_OPENMPI_188 ] && [ -e $WM_THIRD_PARTY_DIR/packages/openmpi-1.8.8/platforms/$WM_OPTIONS ] then mpi_version=openmpi-1.8.8 if [ "$FOAM_VERBOSE" -a "$PS1" ] @@ -650,6 +659,9 @@ export MPI_BUFFER_SIZE # Load cmake # ~~~~~~~~~~ +[ -z "$CMAKE_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_CMAKE_3114 ] && [ -e $WM_THIRD_PARTY_DIR/packages/cmake-3.11.4/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-3.11.4/platforms/$WM_OPTIONS/etc/cmake-3.11.4.sh +} [ -z "$CMAKE_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_CMAKE_332 ] && [ -e $WM_THIRD_PARTY_DIR/packages/cmake-3.3.2/platforms/$WM_OPTIONS ] && { _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-3.3.2/platforms/$WM_OPTIONS/etc/cmake-3.3.2.sh } From 454253dbe9bb1528584747ff621ebd9daeff425e Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Mon, 25 Jun 2018 23:53:45 -0400 Subject: [PATCH 04/60] ThirdParty: adding some retry/timeout robustness parameters to the curl download command for the packages' source code. --- ThirdParty/tools/makeThirdPartyFunctionsForRPM | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ThirdParty/tools/makeThirdPartyFunctionsForRPM b/ThirdParty/tools/makeThirdPartyFunctionsForRPM index b5d9e19fb..bdd315851 100755 --- a/ThirdParty/tools/makeThirdPartyFunctionsForRPM +++ b/ThirdParty/tools/makeThirdPartyFunctionsForRPM @@ -121,9 +121,15 @@ rpm_make() packageTarBall=`basename $_PACKAGE_URL` if [ ! -e "SOURCES/$packageTarBall" ]; then - echo "Download $packageTarBall from : $_PACKAGE_URL" - #( cd SOURCES; wget --no-check-certificate $_PACKAGE_URL ) - ( cd SOURCES; curl -L -k -O $_PACKAGE_URL ) + echo "Download $packageTarBall from : $_PACKAGE_URL" + #( cd SOURCES; wget --no-check-certificate $_PACKAGE_URL ) + + ( cd SOURCES; curl --connect-timeout 60 \ + --max-time 10 \ + --retry 6 \ + --retry-delay 10 \ + --retry-max-time 60 \ + -L -k -O $_PACKAGE_URL ) fi fi From 8201aa30bd4f60ae90fe7192b2b2d2c5114e421c Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Tue, 26 Jun 2018 22:21:14 -0400 Subject: [PATCH 05/60] Add a MPIRUN_OPTIONS environment variable when using the runParallel shell function. When using OpenMPI 3.1.0, one could specify the runtime parameter '-oversubscribe' to mpirun --- ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec | 2 ++ bin/tools/RunFunctions | 2 +- etc/prefs.csh-EXAMPLE | 4 ++++ etc/prefs.sh-EXAMPLE | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec b/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec index 266d64c1c..be52853b3 100644 --- a/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec +++ b/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec @@ -194,6 +194,7 @@ then echo "" echo " MPI_HOME : \$MPI_HOME" echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH" + echo " MPIRUN_OPTIONS : \$MPIRUN_OPTIONS" echo " OPAL_PREFIX : \$OPAL_PREFIX" echo " PINC : \$PINC" echo " PLIBS : \$PLIBS" @@ -243,6 +244,7 @@ if (\$?FOAM_VERBOSE && \$?prompt) then echo "" echo " MPI_HOME : \$MPI_HOME" echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH" + echo " MPIRUN_OPTIONS : \$MPIRUN_OPTIONS" echo " OPAL_PREFIX : \$OPAL_PREFIX" echo " PINC : \$PINC" echo " PLIBS : \$PLIBS" diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions index 2ecdeca1a..4799a993e 100644 --- a/bin/tools/RunFunctions +++ b/bin/tools/RunFunctions @@ -91,7 +91,7 @@ runParallel () fi cat system/fvSchemes > $LOG_NAME cat system/fvSolution >> $LOG_NAME - ( $mpirunProg -np $1 $APP_RUN -parallel < /dev/null > $LOG_NAME 2>&1 ) + ( $mpirunProg $MPIRUN_OPTIONS -np $1 $APP_RUN -parallel < /dev/null > $LOG_NAME 2>&1 ) fi } diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index db29e24a2..e8b838bd5 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -53,6 +53,10 @@ #setenv OPENMPI_COMPILE_FLAGS "`$OPENMPI_BIN_DIR/mpicc --showme:compile`" #setenv OPENMPI_LINK_FLAGS "`$OPENMPI_BIN_DIR/mpicc --showme:link`" +# MPI runtime options +#setenv MPI_BUFFER_SIZE 100000000 +#setenv MPIRUN_OPTIONS -oversubscribe # OpenMPI version 3.1 + # Specify system installed ThirdParty packages/libraries # NB: The packages installed under $WM_THIRD_PARTY_DIR # will always override these values. diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index d60fcd4ee..bd4c04fd9 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -55,6 +55,10 @@ export FOAM_VERBOSE=1 #export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`" #export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`" +# MPI runtime options +#export MPI_BUFFER_SIZE=100000000 +#export MPIRUN_OPTIONS=-oversubscribe # OpenMPI version 3.1 + # Specify system installed ThirdParty packages/libraries # NB: The packages installed under $WM_THIRD_PARTY_DIR # will always override these values. From 1e973d5fe638babb435c4c9238adeeb89d78ad01 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Wed, 27 Jun 2018 18:40:28 -0400 Subject: [PATCH 06/60] ThirdParty: bumping hwloc to version 2.0.1 --- ThirdParty/AllMake.stage3 | 7 + ThirdParty/rpmBuild/SPECS/hwloc-2.0.1.spec | 149 +++++++++++++++++++++ etc/bashrc | 2 +- etc/cshrc | 2 +- etc/prefs.csh-EXAMPLE | 3 +- etc/prefs.sh-EXAMPLE | 3 +- etc/prefs.sh.mingw | 1 + etc/settings.csh | 3 + etc/settings.sh | 3 + 9 files changed, 169 insertions(+), 4 deletions(-) create mode 100644 ThirdParty/rpmBuild/SPECS/hwloc-2.0.1.spec diff --git a/ThirdParty/AllMake.stage3 b/ThirdParty/AllMake.stage3 index 7f2aaabae..4ce9fbab9 100755 --- a/ThirdParty/AllMake.stage3 +++ b/ThirdParty/AllMake.stage3 @@ -191,6 +191,13 @@ fi # hwloc if [ -z "$HWLOC_SYSTEM" ] then + # hwloc 2.0.1 + # + [ ! -z "$WM_THIRD_PARTY_USE_HWLOC_201" ] && { + echo "Building hwloc 2.0.1" + ( rpm_make -p hwloc-2.0.1 -s hwloc-2.0.1.spec -u http://www.open-mpi.org/software/hwloc/v2.0/downloads/hwloc-2.0.1.tar.gz ) + # ( rpm_make -p hwloc-2.0.1 -s hwloc-2.0.1.spec -u http://downloads.sourceforge.net/project/foam-extend/ThirdParty/hwloc-2.0.1.tar.gz ) + } # hwloc 1.10.1 # [ ! -z "$WM_THIRD_PARTY_USE_HWLOC_1101" ] && { diff --git a/ThirdParty/rpmBuild/SPECS/hwloc-2.0.1.spec b/ThirdParty/rpmBuild/SPECS/hwloc-2.0.1.spec new file mode 100644 index 000000000..e5db37875 --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/hwloc-2.0.1.spec @@ -0,0 +1,149 @@ +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Script +# RPM spec file for hwloc-2.0.1 +# +# Description +# RPM spec file for creating a relocatable RPM +# +# Author: +# Martin Beaudoin (2018) +# +#------------------------------------------------------------------------------ + +# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable +%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)} +%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)} + +# Disable the generation of debuginfo packages +%define debug_package %{nil} + +# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory +%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild +%define _tmppath %{_topdir}/tmp + +# Will install the package directly $WM_THIRD_PARTY_DIR +# Some comments about package relocation: +# By using this prefix for the Prefix: parameter in this file, you will make this +# package relocatable. +# +# This is fine, as long as your software is itself relocatable. +# +# Simply take note that libraries built with libtool are not relocatable because the +# prefix we specify will be hard-coded in the library .la files. +# Ref: http://sourceware.org/autobook/autobook/autobook_80.html +# +# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will +# not be able to reutilize this RPM, even though it is relocatable. You will need to +# regenerate the RPM. +# +%define _prefix %{_WM_THIRD_PARTY_DIR} + +%define name hwloc +%define release %{_WM_OPTIONS} +%define version 2.0.1 + +%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root + +BuildRoot: %{buildroot} +Summary: hwloc +License: the New BSD license +Name: %{name} +Version: %{version} +Release: %{release} +URL: http://www.open-mpi.org/software/hwloc/v2.0/downloads/hwloc-2.0.1.tar.gz +Source: %url/%{name}-%{version}.tar.gz +Prefix: %{_prefix} +Group: Development/Tools + + +%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS} + +%description +%{summary} + +%prep +%setup -q + +%build + # export WM settings in a form that GNU configure recognizes + [ -n "$WM_CC" ] && export CC="$WM_CC" + [ -n "$WM_CXX" ] && export CXX="$WM_CXX" + [ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS" + [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" + [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" + + ./configure \ + --prefix=%{_installPrefix} + + [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1 + make -j $WM_NCOMPPROCS + +%install + make install DESTDIR=$RPM_BUILD_ROOT + + # Creation of foam-extend specific .csh and .sh files" + + echo "" + echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}" + echo "" + # + # Generate package specific .sh file for foam-extend + # +mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc +cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export HWLOC_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +export HWLOC_BIN_DIR=\$HWLOC_DIR/bin + +# Enable access to the runtime package applications +[ -d \$HWLOC_BIN_DIR ] && _foamAddPath \$HWLOC_BIN_DIR +DOT_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv HWLOC_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +setenv HWLOC_BIN_DIR \$HWLOC_DIR/bin + +if ( -e \$HWLOC_BIN_DIR ) then + _foamAddPath \$HWLOC_BIN_DIR +endif +DOT_CSH_EOF + + #finally, generate a .tgz file for systems where using rpm for installing packages + # as a non-root user might be a problem. + (mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version}) + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_installPrefix} diff --git a/etc/bashrc b/etc/bashrc index 6da62fd0a..bc0be3e30 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -107,7 +107,7 @@ export WM_THIRD_PARTY_USE_MESQUITE_212=1 export WM_THIRD_PARTY_USE_SCOTCH_604=1 export WM_THIRD_PARTY_USE_PARMETIS_403=1 export WM_THIRD_PARTY_USE_PYFOAM_064=1 -export WM_THIRD_PARTY_USE_HWLOC_1101=1 +export WM_THIRD_PARTY_USE_HWLOC_201=1 # # For AllMake.stage4 diff --git a/etc/cshrc b/etc/cshrc index 5e7a3b200..b695d7bfa 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -93,7 +93,7 @@ setenv WM_THIRD_PARTY_USE_MESQUITE_212 1 setenv WM_THIRD_PARTY_USE_SCOTCH_604 1 setenv WM_THIRD_PARTY_USE_PARMETIS_403 1 setenv WM_THIRD_PARTY_USE_PYFOAM_064 1 -setenv WM_THIRD_PARTY_USE_HWLOC_1101 1 +setenv WM_THIRD_PARTY_USE_HWLOC_201 1 # # For AllMake.stage4 diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index e8b838bd5..db0e87e98 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -231,7 +231,8 @@ setenv WM_THIRD_PARTY_USE_SCOTCH_604 1 setenv WM_THIRD_PARTY_USE_PARMETIS_403 1 #setenv WM_THIRD_PARTY_USE_ZOLTAN_36 1 setenv WM_THIRD_PARTY_USE_PYFOAM_064 1 -setenv WM_THIRD_PARTY_USE_HWLOC_1101 1 +setenv WM_THIRD_PARTY_USE_HWLOC_201 1 +#setenv WM_THIRD_PARTY_USE_HWLOC_1101 1 #setenv WM_THIRD_PARTY_USE_HWLOC_172 1 # diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index bd4c04fd9..a0df31222 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -244,7 +244,8 @@ export WM_THIRD_PARTY_USE_SCOTCH_604=1 export WM_THIRD_PARTY_USE_PARMETIS_403=1 #export WM_THIRD_PARTY_USE_ZOLTAN_36=1 export WM_THIRD_PARTY_USE_PYFOAM_064=1 -export WM_THIRD_PARTY_USE_HWLOC_1101=1 +export WM_THIRD_PARTY_USE_HWLOC_201=1 +#export WM_THIRD_PARTY_USE_HWLOC_1101=1 #export WM_THIRD_PARTY_USE_HWLOC_172=1 # diff --git a/etc/prefs.sh.mingw b/etc/prefs.sh.mingw index 99e46fd58..07acfccaa 100644 --- a/etc/prefs.sh.mingw +++ b/etc/prefs.sh.mingw @@ -230,6 +230,7 @@ export PARAVIEW_BIN_DIR=$PARAVIEW_DIR/bin #export WM_THIRD_PARTY_USE_PARMETIS_403=1 ##export WM_THIRD_PARTY_USE_ZOLTAN_36=1 #export WM_THIRD_PARTY_USE_PYFOAM_064=1 +#export WM_THIRD_PARTY_USE_HWLOC_201=1 #export WM_THIRD_PARTY_USE_HWLOC_1101=1 #export WM_THIRD_PARTY_USE_HWLOC_172=1 diff --git a/etc/settings.csh b/etc/settings.csh index 710502e3b..187163500 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -609,6 +609,9 @@ endif # hwloc # ~~~~~ +if ( $?HWLOC_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_HWLOC_201 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/hwloc-2.0.1/platforms/$WM_OPTIONS ) then + _foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-2.0.1/platforms/$WM_OPTIONS/etc/hwloc-2.0.1.csh +endif if ( $?HWLOC_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_HWLOC_1101 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/hwloc-1.10.1/platforms/$WM_OPTIONS ) then _foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-1.10.1/platforms/$WM_OPTIONS/etc/hwloc-1.10.1.csh endif diff --git a/etc/settings.sh b/etc/settings.sh index 46f0db02a..01ca5b2cd 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -731,6 +731,9 @@ fi # Load hwloc # ~~~~~~~~~~~ +[ -z "$HWLOC_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_HWLOC_201 ] && [ -e $WM_THIRD_PARTY_DIR/packages/hwloc-2.0.1/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-2.0.1/platforms/$WM_OPTIONS/etc/hwloc-2.0.1.sh +} [ -z "$HWLOC_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_HWLOC_1101 ] && [ -e $WM_THIRD_PARTY_DIR/packages/hwloc-1.10.1/platforms/$WM_OPTIONS ] && { _foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-1.10.1/platforms/$WM_OPTIONS/etc/hwloc-1.10.1.sh } From 17a3e1276322eca9ea8e6ad3a1ea689f76e26e2d Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Wed, 27 Jun 2018 22:56:01 -0400 Subject: [PATCH 07/60] ThirdParty: add support for PyFoam version 0.6.6 and 0.6.9. Make PyFoam 0.6.9 the default version --- ThirdParty/AllMake.stage3 | 12 ++ ThirdParty/rpmBuild/SPECS/PyFoam-0.6.6.spec | 205 ++++++++++++++++++++ ThirdParty/rpmBuild/SPECS/PyFoam-0.6.9.spec | 205 ++++++++++++++++++++ etc/bashrc | 2 +- etc/cshrc | 2 +- etc/prefs.csh-EXAMPLE | 2 +- etc/prefs.sh-EXAMPLE | 2 +- etc/prefs.sh.mingw | 2 +- etc/settings.csh | 6 + etc/settings.sh | 6 + 10 files changed, 439 insertions(+), 5 deletions(-) create mode 100644 ThirdParty/rpmBuild/SPECS/PyFoam-0.6.6.spec create mode 100644 ThirdParty/rpmBuild/SPECS/PyFoam-0.6.9.spec diff --git a/ThirdParty/AllMake.stage3 b/ThirdParty/AllMake.stage3 index 4ce9fbab9..a54a1d3ac 100755 --- a/ThirdParty/AllMake.stage3 +++ b/ThirdParty/AllMake.stage3 @@ -183,6 +183,18 @@ then echo "Building PyFoam 0.6.4" ( rpm_make -p PyFoam-0.6.4 -s PyFoam-0.6.4.spec -u http://openfoamwiki.net/images/3/3b/PyFoam-0.6.4.tar.gz -n PyFoam-0.6.4-1.noarch -a noarch) } + # PyFoam 0.6.6 + # + [ ! -z "$WM_THIRD_PARTY_USE_PYFOAM_066" ] && { + echo "Building PyFoam 0.6.6" + ( rpm_make -p PyFoam-0.6.6 -s PyFoam-0.6.6.spec -u https://openfoamwiki.net/images/a/af/PyFoam-0.6.6.tar.gz -n PyFoam-0.6.6-1.noarch -a noarch) + } + # PyFoam 0.6.9 + # + [ ! -z "$WM_THIRD_PARTY_USE_PYFOAM_069" ] && { + echo "Building PyFoam 0.6.9" + ( rpm_make -p PyFoam-0.6.9 -s PyFoam-0.6.9.spec -u https://files.pythonhosted.org/packages/78/f5/8f65b66c8ac0e5415f785809e182dd0f0dc562a42094e1a86bd22c7d7ece/PyFoam-0.6.9.tar.gz -n PyFoam-0.6.9-1.noarch -a noarch) + } else echo "Using system installed PyFoam" echo "" diff --git a/ThirdParty/rpmBuild/SPECS/PyFoam-0.6.6.spec b/ThirdParty/rpmBuild/SPECS/PyFoam-0.6.6.spec new file mode 100644 index 000000000..86665fe1a --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/PyFoam-0.6.6.spec @@ -0,0 +1,205 @@ +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Script +# RPM spec file for PyFoam-0.6.6 +# +# Description +# RPM spec file for PyFoam version 0.6.6 +# +# Author: +# Martin Beaudoin (2018) +# +#------------------------------------------------------------------------------ + +# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable +%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)} +%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)} + +# Disable the generation of debuginfo packages +%define debug_package %{nil} + +# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory +%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild +%define _tmppath %{_topdir}/tmp + +# Will install the package directly $WM_THIRD_PARTY_DIR +# Some comments about package relocation: +# By using this prefix for the Prefix: parameter in this file, you will make this +# package relocatable. +# +# This is fine, as long as your software is itself relocatable. +# +# Simply take note that libraries built with libtool are not relocatable because the +# prefix we specify will be hard-coded in the library .la files. +# Ref: http://sourceware.org/autobook/autobook/autobook_80.html +# +# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will +# not be able to reutilize this RPM, even though it is relocatable. You will need to +# regenerate the RPM. +# +%define _prefix %{_WM_THIRD_PARTY_DIR} + +%define name PyFoam +%define release 1 +%define version 0.6.6 + +%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root + +BuildRoot: %{buildroot} +Summary: PyFoam +License: Unkown +Name: %{name} +Version: %{version} +Release: %{release} +BuildArch: noarch +URL: https://openfoamwiki.net/images/a/af/PyFoam-0.6.6.tar.gz +Source: %url/%{name}-%{version}.tar.gz +Prefix: %{_prefix} +Group: Development/Tools + +%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/noarch + +%description +%{summary} + +%prep +%setup -q -n PyFoam-%{version} + +%build + # Make the shebang line portable + python setup.py build --executable "/usr/bin/env python" + +%install + %define pythonVersion $(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'}) + + # Temporary settings for the installation + mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/lib/python%{pythonVersion}/site-packages + export PYTHONPATH=$RPM_BUILD_ROOT/%{_installPrefix}/lib/python%{pythonVersion}/site-packages:$PYTHONPATH + python setup.py install --prefix=$RPM_BUILD_ROOT/%{_installPrefix} + + + # Creation of foam-extend specific .csh and .sh files" + + echo "" + echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}" + echo "" + # + # Generate package specific .sh file for foam-extend + # +mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc +cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export PYFOAM_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch +export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH + +# Enable access to the package applications if present +[ -d \$PYFOAM_DIR/bin ] && _foamAddPath \$PYFOAM_DIR/bin + +DOT_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv PYFOAM_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch + +if ! \$?PYTHONPATH then + setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages +else + setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH +endif + + +if ( -e \$PYFOAM_DIR/bin ) then + _foamAddPath \$PYFOAM_DIR/bin +endif + +if \$?PYFOAM_SITE_DIR then + if ( -e \$PYFOAM_SITE_DIR/bin ) then + _foamAddPath \$PYFOAM_SITE_DIR/bin + endif +endif +DOT_CSH_EOF + +cat << DOT_HARDCODED_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.sh +# In this version of the configuration script, the paths are hardcoded, +# which makes it easier to load PyFoam without the foam-extend environment +# variables +# +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export PYFOAM_DIR=$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch +export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH + +# Enable access to the package applications if present +[ -d \$PYFOAM_DIR/bin ] && export PATH=\$PYFOAM_DIR/bin:\$PATH + +DOT_HARDCODED_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_HARDCODED_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.csh +# In this version of the configuration script, the paths are hardcoded, +# which makes it easier to load PyFoam without the foam-extend environment +# variables +# +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv PYFOAM_DIR $WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch + +if ! \$?PYTHONPATH then + setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages +else + setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH +endif + + +if ( -e \$PYFOAM_DIR/bin ) then + _foamAddPath \$PYFOAM_DIR/bin +endif + +if \$?PYFOAM_SITE_DIR then + if ( -e \$PYFOAM_SITE_DIR/bin ) then + _foamAddPath \$PYFOAM_SITE_DIR/bin + endif +endif +DOT_HARDCODED_CSH_EOF + + #finally, generate a .tgz file for systems where using rpm for installing packages + # as a non-root user might be a problem. + (mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version}) + + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_installPrefix} diff --git a/ThirdParty/rpmBuild/SPECS/PyFoam-0.6.9.spec b/ThirdParty/rpmBuild/SPECS/PyFoam-0.6.9.spec new file mode 100644 index 000000000..8581c63d6 --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/PyFoam-0.6.9.spec @@ -0,0 +1,205 @@ +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Script +# RPM spec file for PyFoam-0.6.9 +# +# Description +# RPM spec file for PyFoam version 0.6.9 +# +# Author: +# Martin Beaudoin (2018) +# +#------------------------------------------------------------------------------ + +# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable +%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)} +%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)} + +# Disable the generation of debuginfo packages +%define debug_package %{nil} + +# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory +%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild +%define _tmppath %{_topdir}/tmp + +# Will install the package directly $WM_THIRD_PARTY_DIR +# Some comments about package relocation: +# By using this prefix for the Prefix: parameter in this file, you will make this +# package relocatable. +# +# This is fine, as long as your software is itself relocatable. +# +# Simply take note that libraries built with libtool are not relocatable because the +# prefix we specify will be hard-coded in the library .la files. +# Ref: http://sourceware.org/autobook/autobook/autobook_80.html +# +# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will +# not be able to reutilize this RPM, even though it is relocatable. You will need to +# regenerate the RPM. +# +%define _prefix %{_WM_THIRD_PARTY_DIR} + +%define name PyFoam +%define release 1 +%define version 0.6.9 + +%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root + +BuildRoot: %{buildroot} +Summary: PyFoam +License: Unkown +Name: %{name} +Version: %{version} +Release: %{release} +BuildArch: noarch +URL: https://files.pythonhosted.org/packages/78/f5/8f65b66c8ac0e5415f785809e182dd0f0dc562a42094e1a86bd22c7d7ece/PyFoam-0.6.9.tar.gz +Source: %url/%{name}-%{version}.tar.gz +Prefix: %{_prefix} +Group: Development/Tools + +%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/noarch + +%description +%{summary} + +%prep +%setup -q -n PyFoam-%{version} + +%build + # Make the shebang line portable + python setup.py build --executable "/usr/bin/env python" + +%install + %define pythonVersion $(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'}) + + # Temporary settings for the installation + mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/lib/python%{pythonVersion}/site-packages + export PYTHONPATH=$RPM_BUILD_ROOT/%{_installPrefix}/lib/python%{pythonVersion}/site-packages:$PYTHONPATH + python setup.py install --prefix=$RPM_BUILD_ROOT/%{_installPrefix} + + + # Creation of foam-extend specific .csh and .sh files" + + echo "" + echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}" + echo "" + # + # Generate package specific .sh file for foam-extend + # +mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc +cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export PYFOAM_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch +export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH + +# Enable access to the package applications if present +[ -d \$PYFOAM_DIR/bin ] && _foamAddPath \$PYFOAM_DIR/bin + +DOT_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv PYFOAM_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch + +if ! \$?PYTHONPATH then + setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages +else + setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH +endif + + +if ( -e \$PYFOAM_DIR/bin ) then + _foamAddPath \$PYFOAM_DIR/bin +endif + +if \$?PYFOAM_SITE_DIR then + if ( -e \$PYFOAM_SITE_DIR/bin ) then + _foamAddPath \$PYFOAM_SITE_DIR/bin + endif +endif +DOT_CSH_EOF + +cat << DOT_HARDCODED_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.sh +# In this version of the configuration script, the paths are hardcoded, +# which makes it easier to load PyFoam without the foam-extend environment +# variables +# +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export PYFOAM_DIR=$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch +export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH + +# Enable access to the package applications if present +[ -d \$PYFOAM_DIR/bin ] && export PATH=\$PYFOAM_DIR/bin:\$PATH + +DOT_HARDCODED_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_HARDCODED_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.csh +# In this version of the configuration script, the paths are hardcoded, +# which makes it easier to load PyFoam without the foam-extend environment +# variables +# +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv PYFOAM_DIR $WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch + +if ! \$?PYTHONPATH then + setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages +else + setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH +endif + + +if ( -e \$PYFOAM_DIR/bin ) then + _foamAddPath \$PYFOAM_DIR/bin +endif + +if \$?PYFOAM_SITE_DIR then + if ( -e \$PYFOAM_SITE_DIR/bin ) then + _foamAddPath \$PYFOAM_SITE_DIR/bin + endif +endif +DOT_HARDCODED_CSH_EOF + + #finally, generate a .tgz file for systems where using rpm for installing packages + # as a non-root user might be a problem. + (mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version}) + + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_installPrefix} diff --git a/etc/bashrc b/etc/bashrc index bc0be3e30..da1b4816d 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -106,7 +106,7 @@ export WM_THIRD_PARTY_USE_LIBCCMIO_261=1 export WM_THIRD_PARTY_USE_MESQUITE_212=1 export WM_THIRD_PARTY_USE_SCOTCH_604=1 export WM_THIRD_PARTY_USE_PARMETIS_403=1 -export WM_THIRD_PARTY_USE_PYFOAM_064=1 +export WM_THIRD_PARTY_USE_PYFOAM_069=1 export WM_THIRD_PARTY_USE_HWLOC_201=1 # diff --git a/etc/cshrc b/etc/cshrc index b695d7bfa..ee2e50dc1 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -92,7 +92,7 @@ setenv WM_THIRD_PARTY_USE_LIBCCMIO_261 1 setenv WM_THIRD_PARTY_USE_MESQUITE_212 1 setenv WM_THIRD_PARTY_USE_SCOTCH_604 1 setenv WM_THIRD_PARTY_USE_PARMETIS_403 1 -setenv WM_THIRD_PARTY_USE_PYFOAM_064 1 +setenv WM_THIRD_PARTY_USE_PYFOAM_069 1 setenv WM_THIRD_PARTY_USE_HWLOC_201 1 # diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index db0e87e98..4edcdd9e1 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -230,7 +230,7 @@ setenv WM_THIRD_PARTY_USE_SCOTCH_604 1 #setenv WM_THIRD_PARTY_USE_SCOTCH_600 1 setenv WM_THIRD_PARTY_USE_PARMETIS_403 1 #setenv WM_THIRD_PARTY_USE_ZOLTAN_36 1 -setenv WM_THIRD_PARTY_USE_PYFOAM_064 1 +setenv WM_THIRD_PARTY_USE_PYFOAM_069 1 setenv WM_THIRD_PARTY_USE_HWLOC_201 1 #setenv WM_THIRD_PARTY_USE_HWLOC_1101 1 #setenv WM_THIRD_PARTY_USE_HWLOC_172 1 diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index a0df31222..a93be19ff 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -243,7 +243,7 @@ export WM_THIRD_PARTY_USE_SCOTCH_604=1 #export WM_THIRD_PARTY_USE_SCOTCH_600=1 export WM_THIRD_PARTY_USE_PARMETIS_403=1 #export WM_THIRD_PARTY_USE_ZOLTAN_36=1 -export WM_THIRD_PARTY_USE_PYFOAM_064=1 +export WM_THIRD_PARTY_USE_PYFOAM_069=1 export WM_THIRD_PARTY_USE_HWLOC_201=1 #export WM_THIRD_PARTY_USE_HWLOC_1101=1 #export WM_THIRD_PARTY_USE_HWLOC_172=1 diff --git a/etc/prefs.sh.mingw b/etc/prefs.sh.mingw index 07acfccaa..6b8d19835 100644 --- a/etc/prefs.sh.mingw +++ b/etc/prefs.sh.mingw @@ -229,7 +229,7 @@ export PARAVIEW_BIN_DIR=$PARAVIEW_DIR/bin ##export WM_THIRD_PARTY_USE_SCOTCH_600=1 #export WM_THIRD_PARTY_USE_PARMETIS_403=1 ##export WM_THIRD_PARTY_USE_ZOLTAN_36=1 -#export WM_THIRD_PARTY_USE_PYFOAM_064=1 +#export WM_THIRD_PARTY_USE_PYFOAM_069=1 #export WM_THIRD_PARTY_USE_HWLOC_201=1 #export WM_THIRD_PARTY_USE_HWLOC_1101=1 #export WM_THIRD_PARTY_USE_HWLOC_172=1 diff --git a/etc/settings.csh b/etc/settings.csh index 187163500..6465ff0aa 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -606,6 +606,12 @@ endif if ( $?PYFOAM_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PYFOAM_064 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.6.4/platforms/noarch ) then _foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.4/platforms/noarch/etc/PyFoam-0.6.4.csh endif +if ( $?PYFOAM_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PYFOAM_066 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.6.6/platforms/noarch ) then + _foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.6/platforms/noarch/etc/PyFoam-0.6.6.csh +endif +if ( $?PYFOAM_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PYFOAM_069 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.6.9/platforms/noarch ) then + _foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.9/platforms/noarch/etc/PyFoam-0.6.9.csh +endif # hwloc # ~~~~~ diff --git a/etc/settings.sh b/etc/settings.sh index 01ca5b2cd..8084d2569 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -718,6 +718,12 @@ export MPI_BUFFER_SIZE [ -z "$PYFOAM_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PYFOAM_064 ] && [ -e $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.4/platforms/noarch ] && { _foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.4/platforms/noarch/etc/PyFoam-0.6.4.sh } +[ -z "$PYFOAM_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PYFOAM_066 ] && [ -e $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.6/platforms/noarch ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.6/platforms/noarch/etc/PyFoam-0.6.6.sh +} +[ -z "$PYFOAM_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PYFOAM_069 ] && [ -e $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.9/platforms/noarch ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.9/platforms/noarch/etc/PyFoam-0.6.9.sh +} [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PYFOAM_DIR is initialized to: $PYFOAM_DIR" # Make sure that there is a special directory for special PyFoam-scripts From 6be52fe7e84539e023cc400cff3e58ab34568442 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Thu, 28 Jun 2018 20:40:30 -0400 Subject: [PATCH 08/60] ThirdParty: bumping mesquite to version 2.3.0 --- ThirdParty/AllMake.stage3 | 7 + ThirdParty/rpmBuild/SPECS/mesquite-2.3.0.spec | 175 ++++++++++++++++++ etc/bashrc | 2 +- etc/cshrc | 2 +- etc/prefs.csh-EXAMPLE | 2 +- etc/prefs.sh-EXAMPLE | 2 +- etc/prefs.sh.mingw | 2 +- etc/settings.csh | 3 + etc/settings.sh | 4 + 9 files changed, 194 insertions(+), 5 deletions(-) create mode 100644 ThirdParty/rpmBuild/SPECS/mesquite-2.3.0.spec diff --git a/ThirdParty/AllMake.stage3 b/ThirdParty/AllMake.stage3 index a54a1d3ac..9b2139e1d 100755 --- a/ThirdParty/AllMake.stage3 +++ b/ThirdParty/AllMake.stage3 @@ -108,6 +108,13 @@ then echo "Building Mesquite 2.1.2" ( rpm_make -p mesquite-2.1.2 -s mesquite-2.1.2.spec -u http://downloads.sourceforge.net/project/foam-extend/ThirdParty/mesquite-2.1.2.tar.gz ) } + # Mesquite 2.3.0 + # + [ ! -z "$WM_THIRD_PARTY_USE_MESQUITE_230" ] && { + echo "Building Mesquite 2.3.0" + ( rpm_make -p mesquite-2.3.0 -s mesquite-2.3.0.spec -u https://software.sandia.gov/mesquite/mesquite-2.3.0.tar.gz ) + # ( rpm_make -p mesquite-2.3.0 -s mesquite-2.3.0.spec -u http://downloads.sourceforge.net/project/foam-extend/ThirdParty/mesquite-2.3.0.tar.gz ) + } else echo "Using system installed Mesquite" echo "" diff --git a/ThirdParty/rpmBuild/SPECS/mesquite-2.3.0.spec b/ThirdParty/rpmBuild/SPECS/mesquite-2.3.0.spec new file mode 100644 index 000000000..ce422678d --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/mesquite-2.3.0.spec @@ -0,0 +1,175 @@ +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Script +# RPM spec file for mesquite-2.3.0 +# +# Description +# RPM spec file for creating a relocatable RPM +# +# Author: +# Martin Beaudoin (2018) +# +# Contributor: +# Philippose Rajan : patch0 for gcc 4.6.x +# +#------------------------------------------------------------------------------ + +# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable +%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)} +%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)} + +# Disable the generation of debuginfo packages +%define debug_package %{nil} + +# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory +%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild +%define _tmppath %{_topdir}/tmp + +# Will install the package directly $WM_THIRD_PARTY_DIR +# Some comments about package relocation: +# By using this prefix for the Prefix: parameter in this file, you will make this +# package relocatable. +# +# This is fine, as long as your software is itself relocatable. +# +# Simply take note that libraries built with libtool are not relocatable because the +# prefix we specify will be hard-coded in the library .la files. +# Ref: http://sourceware.org/autobook/autobook/autobook_80.html +# +# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will +# not be able to reutilize this RPM, even though it is relocatable. You will need to +# regenerate the RPM. +# +%define _prefix %{_WM_THIRD_PARTY_DIR} + +%define name mesquite +%define release %{_WM_OPTIONS} +%define version 2.3.0 + +%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root + +BuildRoot: %{buildroot} +Summary: mesquite +License: Unkown +Name: %{name} +Version: %{version} +Release: %{release} +URL: https://software.sandia.gov/mesquite +Source: %url/%{name}-%{version}.tar.gz +Prefix: %{_prefix} +Group: Development/Tools + +%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS} + +%description +%{summary} + +%prep +%setup -q + + +%build + # export WM settings in a form that GNU configure recognizes + [ -n "$WM_CC" ] && export CC="$WM_CC" + [ -n "$WM_FC" ] && export FC="$WM_FC" + [ -n "$WM_CXX" ] && export CXX="$WM_CXX" + [ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS" + [ -n "$WM_FCFLAGS" ] && export FCFLAGS="$WM_FCFLAGS" + [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" + [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" + + ./configure \ + --prefix=%{_installPrefix} \ + --libdir=%{_installPrefix}/lib \ + --enable-release \ + --disable-debug-assertions \ + --enable-shared \ + --without-cppunit \ + --enable-trap-fpe \ + --disable-function-timers + + # Remove the file include/Mesquite_all_headers.hpp + # This file will be regenerated during the compilation process + [ -e include/Mesquite_all_headers.hpp ] && rm -f include/Mesquite_all_headers.hpp + + [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1 + make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -mtune=native -fPIC" + +%install + make install DESTDIR=$RPM_BUILD_ROOT + + # Creation of foam-extend specific .csh and .sh files" + + echo "" + echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}" + echo "" + # + # Generate package specific .sh file for foam-extend + # +mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc +cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export MESQUITE_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +export MESQUITE_BIN_DIR=\$MESQUITE_DIR/bin +export MESQUITE_LIB_DIR=\$MESQUITE_DIR/lib +export MESQUITE_INCLUDE_DIR=\$MESQUITE_DIR/include + +# Enable access to the package runtime applications and libraries +[ -d \$MESQUITE_BIN_DIR ] && _foamAddPath \$MESQUITE_BIN_DIR +[ -d \$MESQUITE_LIB_DIR ] && _foamAddLib \$MESQUITE_LIB_DIR +DOT_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv MESQUITE_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +setenv MESQUITE_BIN_DIR \$MESQUITE_DIR/bin +setenv MESQUITE_LIB_DIR \$MESQUITE_DIR/lib +setenv MESQUITE_INCLUDE_DIR \$MESQUITE_DIR/include + +if ( -e \$MESQUITE_BIN_DIR ) then + _foamAddPath \$MESQUITE_BIN_DIR +endif + +if ( -e \$MESQUITE_LIB_DIR ) then + _foamAddLib \$MESQUITE_LIB_DIR +endif +DOT_CSH_EOF + + #finally, generate a .tgz file for systems where using rpm for installing packages + # as a non-root user might be a problem. + (mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version}) + + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_installPrefix} diff --git a/etc/bashrc b/etc/bashrc index da1b4816d..d50791216 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -103,7 +103,7 @@ export WM_THIRD_PARTY_USE_OPENMPI_310=1 export WM_THIRD_PARTY_USE_METIS_510=1 export WM_THIRD_PARTY_USE_PARMGRIDGEN_10=1 export WM_THIRD_PARTY_USE_LIBCCMIO_261=1 -export WM_THIRD_PARTY_USE_MESQUITE_212=1 +export WM_THIRD_PARTY_USE_MESQUITE_230=1 export WM_THIRD_PARTY_USE_SCOTCH_604=1 export WM_THIRD_PARTY_USE_PARMETIS_403=1 export WM_THIRD_PARTY_USE_PYFOAM_069=1 diff --git a/etc/cshrc b/etc/cshrc index ee2e50dc1..c6c940c2d 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -89,7 +89,7 @@ setenv WM_THIRD_PARTY_USE_OPENMPI_310 1 setenv WM_THIRD_PARTY_USE_METIS_510 1 setenv WM_THIRD_PARTY_USE_PARMGRIDGEN_10 1 setenv WM_THIRD_PARTY_USE_LIBCCMIO_261 1 -setenv WM_THIRD_PARTY_USE_MESQUITE_212 1 +setenv WM_THIRD_PARTY_USE_MESQUITE_230 1 setenv WM_THIRD_PARTY_USE_SCOTCH_604 1 setenv WM_THIRD_PARTY_USE_PARMETIS_403 1 setenv WM_THIRD_PARTY_USE_PYFOAM_069 1 diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index 4edcdd9e1..3a4c445df 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -225,7 +225,7 @@ setenv WM_THIRD_PARTY_USE_OPENMPI_310 1 setenv WM_THIRD_PARTY_USE_METIS_510 1 setenv WM_THIRD_PARTY_USE_PARMGRIDGEN_10 1 setenv WM_THIRD_PARTY_USE_LIBCCMIO_261 1 -setenv WM_THIRD_PARTY_USE_MESQUITE_212 1 +setenv WM_THIRD_PARTY_USE_MESQUITE_230 1 setenv WM_THIRD_PARTY_USE_SCOTCH_604 1 #setenv WM_THIRD_PARTY_USE_SCOTCH_600 1 setenv WM_THIRD_PARTY_USE_PARMETIS_403 1 diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index a93be19ff..4418fb7d6 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -238,7 +238,7 @@ export WM_THIRD_PARTY_USE_OPENMPI_310=1 export WM_THIRD_PARTY_USE_METIS_510=1 export WM_THIRD_PARTY_USE_PARMGRIDGEN_10=1 export WM_THIRD_PARTY_USE_LIBCCMIO_261=1 -export WM_THIRD_PARTY_USE_MESQUITE_212=1 +export WM_THIRD_PARTY_USE_MESQUITE_230=1 export WM_THIRD_PARTY_USE_SCOTCH_604=1 #export WM_THIRD_PARTY_USE_SCOTCH_600=1 export WM_THIRD_PARTY_USE_PARMETIS_403=1 diff --git a/etc/prefs.sh.mingw b/etc/prefs.sh.mingw index 6b8d19835..7b28d20e5 100644 --- a/etc/prefs.sh.mingw +++ b/etc/prefs.sh.mingw @@ -224,7 +224,7 @@ export PARAVIEW_BIN_DIR=$PARAVIEW_DIR/bin #export WM_THIRD_PARTY_USE_METIS_510=1 #export WM_THIRD_PARTY_USE_PARMGRIDGEN_10=1 #export WM_THIRD_PARTY_USE_LIBCCMIO_261=1 -#export WM_THIRD_PARTY_USE_MESQUITE_212=1 +#export WM_THIRD_PARTY_USE_MESQUITE_230=1 #export WM_THIRD_PARTY_USE_SCOTCH_604=1 ##export WM_THIRD_PARTY_USE_SCOTCH_600=1 #export WM_THIRD_PARTY_USE_PARMETIS_403=1 diff --git a/etc/settings.csh b/etc/settings.csh index 6465ff0aa..ae945eccb 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -510,6 +510,9 @@ endif if ( $?MESQUITE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_MESQUITE_212 != 0 && -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS ) then _foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS/etc/mesquite-2.1.2.csh endif +if ( $?MESQUITE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_MESQUITE_230 != 0 && -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.3.0/platforms/$WM_OPTIONS ) then + _foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.3.0/platforms/$WM_OPTIONS/etc/mesquite-2.3.0.csh +endif # Metis library if available # ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/etc/settings.sh b/etc/settings.sh index 8084d2569..bc851aa08 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -610,6 +610,10 @@ export MPI_BUFFER_SIZE _foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS/etc/mesquite-2.1.2.sh } [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " MESQUITE_DIR is initialized to: $MESQUITE_DIR" +[ -z "$MESQUITE_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_MESQUITE_230 ] && [ -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.3.0/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.3.0/platforms/$WM_OPTIONS/etc/mesquite-2.3.0.sh +} +[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " MESQUITE_DIR is initialized to: $MESQUITE_DIR" # Load Metis library From 814ed82294e3995a6ce255067ecb868a9a10d012 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 1 Jul 2018 12:57:35 -0400 Subject: [PATCH 09/60] ThirdParty: adjust maximum timeout for curl downloads --- ThirdParty/tools/makeThirdPartyFunctionsForRPM | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThirdParty/tools/makeThirdPartyFunctionsForRPM b/ThirdParty/tools/makeThirdPartyFunctionsForRPM index bdd315851..9430685b8 100755 --- a/ThirdParty/tools/makeThirdPartyFunctionsForRPM +++ b/ThirdParty/tools/makeThirdPartyFunctionsForRPM @@ -125,7 +125,7 @@ rpm_make() #( cd SOURCES; wget --no-check-certificate $_PACKAGE_URL ) ( cd SOURCES; curl --connect-timeout 60 \ - --max-time 10 \ + --max-time 3600 \ --retry 6 \ --retry-delay 10 \ --retry-max-time 60 \ From f8cfd5a100e3e7c0cfd79438c41d6668bb89a060 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 1 Jul 2018 13:13:57 -0400 Subject: [PATCH 10/60] Ignoring .xz file for Git --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ac2886e38..bc7352b7e 100644 --- a/.gitignore +++ b/.gitignore @@ -93,6 +93,7 @@ PlyParser_FoamFileParser_parsetab.py *.tar *.tgz *.gtgz +*.xz # ignore the persistent .build tag in the main directory /.build From 99c20324fcbee350051af42f72daa1c44ee533d4 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 1 Jul 2018 13:16:26 -0400 Subject: [PATCH 11/60] ThirdParty: bumping the QT library to version 5.11.1. Improving the compilation configuration options based on Kitware's ParaView-Superbuild package --- ThirdParty/AllMake.stage4 | 8 +- .../SPECS/qt-everywhere-src-5.11.1.spec | 198 ++++++++++++++++++ etc/bashrc | 2 +- etc/cshrc | 2 +- etc/prefs.csh-EXAMPLE | 2 +- etc/prefs.sh-EXAMPLE | 2 +- etc/prefs.sh.mingw | 2 +- etc/settings.csh | 3 + etc/settings.sh | 4 + 9 files changed, 216 insertions(+), 7 deletions(-) create mode 100644 ThirdParty/rpmBuild/SPECS/qt-everywhere-src-5.11.1.spec diff --git a/ThirdParty/AllMake.stage4 b/ThirdParty/AllMake.stage4 index 9b79feead..f24c51f79 100755 --- a/ThirdParty/AllMake.stage4 +++ b/ThirdParty/AllMake.stage4 @@ -71,6 +71,12 @@ then echo "Building Qt 5.8.0" ( rpm_make -p qt-everywhere-opensource-src-5.8.0 -s qt-everywhere-opensource-src-5.8.0.spec -u http://download.qt.io/archive/qt/5.8/5.8.0/single/qt-everywhere-opensource-src-5.8.0.tar.gz ) } + # Qt 5.11.1 + # + [ ! -z "$WM_THIRD_PARTY_USE_QT_5111" ] && { + echo "Building Qt 5.11.1" + ( rpm_make -p qt-everywhere-src-5.11.1 -s qt-everywhere-src-5.11.1.spec -u http://download.qt.io/archive/qt/5.11/5.11.1/single/qt-everywhere-src-5.11.1.tar.xz ) + } else echo "Using system installed QT" echo "" @@ -172,5 +178,3 @@ echo ======================================== echo # ----------------------------------------------------------------- end-of-file - - diff --git a/ThirdParty/rpmBuild/SPECS/qt-everywhere-src-5.11.1.spec b/ThirdParty/rpmBuild/SPECS/qt-everywhere-src-5.11.1.spec new file mode 100644 index 000000000..cc9040bbe --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/qt-everywhere-src-5.11.1.spec @@ -0,0 +1,198 @@ +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Script +# RPM spec file for qt-everywhere-src-5.11.1 +# +# Description +# RPM spec file for creating a relocatable RPM +# +# Author: +# Martin Beaudoin, (2018) +# +#------------------------------------------------------------------------------ + +# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable +%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)} +%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)} + +# Disable the generation of debuginfo packages +%define debug_package %{nil} + +# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory +%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild +%define _tmppath %{_topdir}/tmp + +# Will install the package directly $WM_THIRD_PARTY_DIR +# Some comments about package relocation: +# By using this prefix for the Prefix: parameter in this file, you will make this +# package relocatable. +# +# This is fine, as long as your software is itself relocatable. +# +# Simply take note that libraries built with libtool are not relocatable because the +# prefix we specify will be hard-coded in the library .la files. +# Ref: http://sourceware.org/autobook/autobook/autobook_80.html +# +# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will +# not be able to reutilize this RPM, even though it is relocatable. You will need to +# regenerate the RPM. +# +%define _prefix %{_WM_THIRD_PARTY_DIR} + +%define name qt-everywhere-src +%define release %{_WM_OPTIONS} +%define version 5.11.1 + +%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root + +%define _unpackaged_files_terminate_build 0 +%define _missing_doc_files_terminate_build 0 + +BuildRoot: %{buildroot} +Summary: qt-everywhere-src +License: Unkown +Name: %{name} +Version: %{version} +Release: %{release} +URL: http://download.qt.io/archive/qt/5.11/5.11.1/single +Source: %url/%{name}-%{version}.tar.xz +Prefix: %{_prefix} +Group: Development/Tools + + +%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS} + +%description +%{summary} + +%prep +%setup -q + +%build + # export WM settings in a form that GNU configure recognizes + [ -n "$WM_CC" ] && export CC="$WM_CC" + [ -n "$WM_CXX" ] && export CXX="$WM_CXX" + [ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS" + [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" + [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" + + # The configure options are taken from the QT5 configuration + # of the ParaView-Superbuild + ./configure \ + -opensource \ + -confirm-license \ + -release \ + -skip qtconnectivity \ + -skip qtgamepad \ + -skip qtlocation \ + -skip qtmultimedia \ + -skip qtsensors \ + -skip qtserialport \ + -skip qtwayland \ + -skip qtwebchannel \ + -skip qtwebengine \ + -skip qtwebsockets \ + -nomake examples \ + -nomake tests \ + -no-dbus \ + -qt-libjpeg \ + -qt-pcre \ + -system-zlib \ + -no-openssl \ + -skip qtsvg \ + -qt-xcb \ + -system-libpng \ + -fontconfig \ + -prefix %{_installPrefix} + + # Explicitely specify LD_LIBRARY_PATH so it can find QT own libraries + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{_builddir}/%{name}-%{version}/lib + + [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1 + # On a computer with limited memory, say less than 4 GB, you may need to compile + # with only one parallel job to avoid running out of memory. + # So make sure to adjust $WM_NCOMPPROCS accordingly + make -j $WM_NCOMPPROCS + +%install + # Makefiles generated by qmake do not to support the DESTDIR= option + # We need to use the INSTALL_ROOT= option instead + + # Somehow, we need to clean up for the RPM to install properly + rm -rf %{_installPrefix} + + make install INSTALL_ROOT=$RPM_BUILD_ROOT + + # Creation of foam-extend specific .csh and .sh files" + + echo "" + echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}" + echo "" + # + # Generate package specific .sh file for foam-extend + # +mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc +cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export QT_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +export QT_BIN_DIR=\$QT_DIR/bin +export QT_LIB_DIR=\$QT_DIR/lib + +# Enable access to the runtime package applications +[ -d \$QT_BIN_DIR ] && _foamAddPath \$QT_BIN_DIR +[ -d \$QT_LIB_DIR ] && _foamAddLib \$QT_LIB_DIR +DOT_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv QT_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +setenv QT_BIN_DIR \$QT_DIR/bin +setenv QT_LIB_DIR \$QT_DIR/lib + +if ( -e \$QT_BIN_DIR ) then + _foamAddPath \$QT_BIN_DIR +endif + +if ( -e \$QT_LIB_DIR ) then + _foamAddLib \$QT_LIB_DIR +endif +DOT_CSH_EOF + + #finally, generate a .tgz file for systems where using rpm for installing packages + # as a non-root user might be a problem. + (mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version}) + + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_installPrefix} diff --git a/etc/bashrc b/etc/bashrc index d50791216..a324e7342 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -111,7 +111,7 @@ export WM_THIRD_PARTY_USE_HWLOC_201=1 # # For AllMake.stage4 -#export WM_THIRD_PARTY_USE_QT_486=1 +#export WM_THIRD_PARTY_USE_QT_5111=1 #export WM_THIRD_PARTY_USE_PARAVIEW_440=1 diff --git a/etc/cshrc b/etc/cshrc index c6c940c2d..5b05b2bd9 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -97,7 +97,7 @@ setenv WM_THIRD_PARTY_USE_HWLOC_201 1 # # For AllMake.stage4 -#setenv WM_THIRD_PARTY_USE_QT_486 1 +#setenv WM_THIRD_PARTY_USE_QT_5111 1 #setenv WM_THIRD_PARTY_USE_PARAVIEW_440 1 diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index 3a4c445df..ae6dab3ce 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -237,7 +237,7 @@ setenv WM_THIRD_PARTY_USE_HWLOC_201 1 # # For AllMake.stage4 -setenv WM_THIRD_PARTY_USE_QT_486 1 +setenv WM_THIRD_PARTY_USE_QT_511 1 setenv WM_THIRD_PARTY_USE_PARAVIEW_440 1 #setenv WM_THIRD_PARTY_USE_PARAVIEW_431 1 #setenv WM_THIRD_PARTY_USE_PARAVIEW_410 1 diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index 4418fb7d6..d147b18b7 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -250,7 +250,7 @@ export WM_THIRD_PARTY_USE_HWLOC_201=1 # # For AllMake.stage4 -#export WM_THIRD_PARTY_USE_QT_580=1 +#export WM_THIRD_PARTY_USE_QT_5111=1 #export WM_THIRD_PARTY_USE_PARAVIEW_541=1 export WM_THIRD_PARTY_USE_QT_486=1 export WM_THIRD_PARTY_USE_PARAVIEW_440=1 diff --git a/etc/prefs.sh.mingw b/etc/prefs.sh.mingw index 7b28d20e5..4855ee194 100644 --- a/etc/prefs.sh.mingw +++ b/etc/prefs.sh.mingw @@ -236,7 +236,7 @@ export PARAVIEW_BIN_DIR=$PARAVIEW_DIR/bin # # For AllMake.stage4 -#export WM_THIRD_PARTY_USE_QT_486=1 +#export WM_THIRD_PARTY_USE_QT_5111=1 #export WM_THIRD_PARTY_USE_PARAVIEW_431=1 #export WM_THIRD_PARTY_USE_PARAVIEW_410=1 diff --git a/etc/settings.csh b/etc/settings.csh index ae945eccb..bbe12ee34 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -630,6 +630,9 @@ endif # QT # ~~~~~ +if ( $?QT_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_QT_5111 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/qt-everywhere-src-5.11.1/platforms/$WM_OPTIONS )then + _foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-src-5.11.1/platforms/$WM_OPTIONS/etc/qt-everywhere-src-5.11.1.csh +endif if ( $?QT_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_QT_580 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/qt-everywhere-opensource-src-5.8.0/platforms/$WM_OPTIONS )then _foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-5.8.0/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-5.8.0.csh endif diff --git a/etc/settings.sh b/etc/settings.sh index bc851aa08..32a3e6c4c 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -754,6 +754,10 @@ fi # Load QT # ~~~~~~~ +[ ! -z "$QT_THIRD_PARTY" ] && [ ! -z $WM_THIRD_PARTY_USE_QT_5111 ] && [ -e $WM_THIRD_PARTY_DIR/packages/qt-everywhere-src-5.11.1/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-src-5.11.1/platforms/$WM_OPTIONS/etc/qt-everywhere-src-5.11.1.sh +} +# ~~~~~~~ [ ! -z "$QT_THIRD_PARTY" ] && [ ! -z $WM_THIRD_PARTY_USE_QT_580 ] && [ -e $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-5.8.0/platforms/$WM_OPTIONS ] && { _foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-5.8.0/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-5.8.0.sh } From e8c1beed0e62b3273a2f2aad16bf9b799633ff87 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 1 Jul 2018 20:41:56 -0400 Subject: [PATCH 12/60] ThirdParty: bumping Paraview to version 5.5.2 --- ThirdParty/AllMake.stage4 | 8 + .../rpmBuild/SOURCES/ParaView-5.5.2.patch | 122 ++++++++ ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec | 295 ++++++++++++++++++ etc/bashrc | 2 +- etc/cshrc | 2 +- etc/prefs.csh-EXAMPLE | 2 +- etc/prefs.sh-EXAMPLE | 2 +- etc/settings.csh | 3 + etc/settings.sh | 3 + 9 files changed, 435 insertions(+), 4 deletions(-) create mode 100644 ThirdParty/rpmBuild/SOURCES/ParaView-5.5.2.patch create mode 100644 ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec diff --git a/ThirdParty/AllMake.stage4 b/ThirdParty/AllMake.stage4 index f24c51f79..aa84c82ad 100755 --- a/ThirdParty/AllMake.stage4 +++ b/ThirdParty/AllMake.stage4 @@ -130,6 +130,14 @@ then -f --define='_qmakePath $QT_BIN_DIR/qmake' ) } + # ParaView 5.5.2 + # + [ ! -z "$WM_THIRD_PARTY_USE_PARAVIEW_552" ] && { + echo "Building ParaView 5.5.2" + ( rpm_make -p ParaView-5.5.2 -s ParaView-5.5.2.spec -u http://www.paraview.org/files/v5.5/ParaView-v5.5.2.tar.gz \ + -f --define='_qmakePath $QT_BIN_DIR/qmake' + ) + } else echo "WARNING: " echo "WARNING: Skipping the installation of ParaView-4.x.x." diff --git a/ThirdParty/rpmBuild/SOURCES/ParaView-5.5.2.patch b/ThirdParty/rpmBuild/SOURCES/ParaView-5.5.2.patch new file mode 100644 index 000000000..d52162e20 --- /dev/null +++ b/ThirdParty/rpmBuild/SOURCES/ParaView-5.5.2.patch @@ -0,0 +1,122 @@ +# From https://gitlab.kitware.com/bob.obara/paraview/commit/931c779dde8460fe32aa8a3d19956b175b96e4f9.patch +diff --git a/Plugins/SLACTools/pqSLACDataLoadManager.cxx b/Plugins/SLACTools/pqSLACDataLoadManager.cxx +index 3ba019c26b177f2cd93d19f01a0b3a280aaf6ac2..ce38396f6844e7628d4d225d165f2ac4f6598f19 100644 +--- a/Plugins/SLACTools/pqSLACDataLoadManager.cxx ++++ b/Plugins/SLACTools/pqSLACDataLoadManager.cxx +@@ -34,6 +34,7 @@ + #include "vtkSMProperty.h" + #include "vtkSMSourceProxy.h" + ++#include + #include + #include + +diff --git a/Qt/ApplicationComponents/pqColorMapEditor.cxx b/Qt/ApplicationComponents/pqColorMapEditor.cxx +index 0395185e0ab17a544233e9add78cc926ae19f2cd..88b56745eb0d58e5a6b2f2d2cacd62e66c230901 100644 +--- a/Qt/ApplicationComponents/pqColorMapEditor.cxx ++++ b/Qt/ApplicationComponents/pqColorMapEditor.cxx +@@ -59,6 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include + #include + #include ++#include + #include + + class pqColorMapEditor::pqInternals +diff --git a/Qt/ApplicationComponents/pqDoubleRangeSliderPropertyWidget.cxx b/Qt/ApplicationComponents/pqDoubleRangeSliderPropertyWidget.cxx +index 908e4598e025fab059a7b6b4097ceddf9cffef6a..820361a2b34abc0af6e4f317d7f77c6a954f7129 100644 +--- a/Qt/ApplicationComponents/pqDoubleRangeSliderPropertyWidget.cxx ++++ b/Qt/ApplicationComponents/pqDoubleRangeSliderPropertyWidget.cxx +@@ -43,6 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "vtkSMUncheckedPropertyHelper.h" + + #include ++#include + + class pqDoubleRangeSliderPropertyWidget::pqInternals + { +diff --git a/Qt/ApplicationComponents/pqStandardViewFrameActionsImplementation.cxx b/Qt/ApplicationComponents/pqStandardViewFrameActionsImplementation.cxx +index c297dc3d9e7acab31d5fe326a6207fb326893e73..501633f63a1facae26371e9ea75eccdab582a6cc 100644 +--- a/Qt/ApplicationComponents/pqStandardViewFrameActionsImplementation.cxx ++++ b/Qt/ApplicationComponents/pqStandardViewFrameActionsImplementation.cxx +@@ -69,6 +69,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include + #include + #include ++#include + + //----------------------------------------------------------------------------- + pqStandardViewFrameActionsImplementation::pqStandardViewFrameActionsImplementation( +diff --git a/Qt/ApplicationComponents/pqTimeInspectorWidget.cxx b/Qt/ApplicationComponents/pqTimeInspectorWidget.cxx +index 6774c2e48e61e6e8278da02075a47b0ecabcd396..e85e614f042143700f938cc855ef486f9f8be2d7 100644 +--- a/Qt/ApplicationComponents/pqTimeInspectorWidget.cxx ++++ b/Qt/ApplicationComponents/pqTimeInspectorWidget.cxx +@@ -49,6 +49,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "vtkSMPropertyHelper.h" + #include "vtkSMSourceProxy.h" + ++#include + #include + #include + #include +diff --git a/Qt/ApplicationComponents/pqTransferFunctionWidgetPropertyDialog.cxx b/Qt/ApplicationComponents/pqTransferFunctionWidgetPropertyDialog.cxx +index 55d31464474eff2f965d959f99dd2db0b5c185bf..93cd995d92e1bbe361857bb9e88d710463da9914 100644 +--- a/Qt/ApplicationComponents/pqTransferFunctionWidgetPropertyDialog.cxx ++++ b/Qt/ApplicationComponents/pqTransferFunctionWidgetPropertyDialog.cxx +@@ -36,6 +36,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "vtkPiecewiseFunction.h" + #include + ++#include ++ + class pqTransferFunctionWidgetPropertyDialog::pqInternals + { + public: +diff --git a/Qt/ApplicationComponents/pqViewResolutionPropertyWidget.cxx b/Qt/ApplicationComponents/pqViewResolutionPropertyWidget.cxx +index 6d2865431ef930a13a9fa0796474dbfb126fc4ac..8d2c4b61cd1038836feb610437f6539dcc6e00bd 100644 +--- a/Qt/ApplicationComponents/pqViewResolutionPropertyWidget.cxx ++++ b/Qt/ApplicationComponents/pqViewResolutionPropertyWidget.cxx +@@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "vtkSMProxy.h" + + #include ++#include + + class pqViewResolutionPropertyWidget::pqInternals + { +diff --git a/Qt/Components/pqChangeInputDialog.cxx b/Qt/Components/pqChangeInputDialog.cxx +index 8a67b10095ee037ad3ee1179b342c72d62d11db9..86db3de01c7dccb0727148e709616d9f4c7debe6 100644 +--- a/Qt/Components/pqChangeInputDialog.cxx ++++ b/Qt/Components/pqChangeInputDialog.cxx +@@ -45,6 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "vtkSMProxy.h" + #include "vtkSmartPointer.h" + ++#include + #include + #include + #include +diff --git a/Qt/Components/pqCinemaTrackSelection.cxx b/Qt/Components/pqCinemaTrackSelection.cxx +index 3d6d9dde19f3860c3f0af54f088e4f3b28d1f7b9..eea2e37680126ced46921749c4e70b1295680032 100644 +--- a/Qt/Components/pqCinemaTrackSelection.cxx ++++ b/Qt/Components/pqCinemaTrackSelection.cxx +@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ========================================================================*/ + #include ++#include + + #include "vtkPVArrayInformation.h" + #include "vtkPVDataInformation.h" +diff --git a/Qt/Python/pqPythonShell.cxx b/Qt/Python/pqPythonShell.cxx +index 3d01fd0a96deda60a5c946820b10c54992a6c9fb..bc1a0149360a1d4ae2caa8622ac76f2176608109 100644 +--- a/Qt/Python/pqPythonShell.cxx ++++ b/Qt/Python/pqPythonShell.cxx +@@ -52,6 +52,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include "vtkStringOutputWindow.h" + #include "vtkWeakPointer.h" + ++#include + #include + #include + #include diff --git a/ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec b/ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec new file mode 100644 index 000000000..4d862977f --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec @@ -0,0 +1,295 @@ +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Script +# RPM spec file for ParaView-5.5.2 +# +# Description +# RPM spec file for creating a relocatable RPM +# +# Authors: +# Martin Beaudoin, (2018) +# Andreas Feymark, Chalmers University of Technology, (2013) +# Pascal Beckstein, HZDR, (2018) +# +#------------------------------------------------------------------------------ + +# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable +%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)} +%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)} + +# Disable the generation of debuginfo packages +%define debug_package %{nil} + +# Turning off the Fascist build policy +# Useful for debugging the install section +%define _unpackaged_files_terminate_build 0 + +# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory +%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild +%define _tmppath %{_topdir}/tmp + +# Will install the package directly $WM_THIRD_PARTY_DIR +# Some comments about package relocation: +# By using this prefix for the Prefix: parameter in this file, you will make this +# package relocatable. +# +# This is fine, as long as your software is itself relocatable. +# +# Simply take note that libraries built with libtool are not relocatable because the +# prefix we specify will be hard-coded in the library .la files. +# Ref: http://sourceware.org/autobook/autobook/autobook_80.html +# +# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will +# not be able to reutilize this RPM, even though it is relocatable. You will need to +# regenerate the RPM. +# +%define _prefix %{_WM_THIRD_PARTY_DIR} + +%define name ParaView +%define release %{_WM_OPTIONS} +%define version 5.5.2 + +%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root + +BuildRoot: %{buildroot} +Summary: ParaView +License: Unkown +Name: %{name} +Version: %{version} +Release: %{release} +URL: http://www.paraview.org/files/v5.4/ +Source: %url/%{name}-v%{version}.tar.gz +Prefix: %{_prefix} +Group: Development/Tools +Patch0: ParaView-5.5.2.patch + +%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS} + +#-------------------------------------------------------------------------- +# +# Here, we define default compiling options for cmake +# +# One can override the option on the commande line : --define='MACRO EXPR' +# +%{!?_withVerbose: %define _withVerbose false} +%{!?_withMesa: %define _withMesa false} +%{!?_withMPI: %define _withMPI false} +%{!?_withPython: %define _withPython false} +%{!?_withQt: %define _withQt true} +%{!?_qmakePath: %define _qmakePath Undefined} +%{!?_mesaIncludePath: %define _mesaIncludePath Undefined} +%{!?_mesaLibPath: %define _mesaLibPath Undefined} +%{!?_pythonLibPath: %define _pythonLibPath Undefined} + +#-------------------------------------------------------------------------- + +%description +%{summary} + +%prep +%setup -q -n %{name}-v%{version} + +%patch0 -p1 + +%build +# +# set CMake cache variables +# + addCMakeVariable() + { + while [ -n "$1" ] + do + CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1" + shift + done + } + + # export WM settings in a form that GNU configure recognizes + [ -n "$WM_CC" ] && export CC="$WM_CC" + [ -n "$WM_CXX" ] && export CXX="$WM_CXX" + [ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS" + [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" + [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" + + set +x + echo "" + echo "Compilation options:" + echo " _withVerbose : %{_withVerbose}" + echo " _withMesa : %{_withMesa}" + echo " _withMPI : %{_withMPI}" + echo " _withPython : %{_withPython}" + echo " _withQt : %{_withQt}" + echo " _qmakePath : %{_qmakePath}" + echo " _mesaIncludePath : %{_mesaIncludePath}" + echo " _mesaLibPath : %{_mesaLibPath}" + echo " _pythonLibPath : %{_pythonLibPath}" + echo "" + set -x + + # start with these general settings + addCMakeVariable BUILD_SHARED_LIBS:BOOL=ON + addCMakeVariable CMAKE_BUILD_TYPE:STRING=Release + addCMakeVariable BUILD_TESTING:BOOL=OFF + + # We build with Python. This is ust too useful + addCMakeVariable PARAVIEW_ENABLE_PYTHON:BOOL=ON + + # include development files in "make install" + addCMakeVariable PARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON + +%ifos darwin + # Additional installation rules for Mac OSX + addCMakeVariable PARAVIEW_EXTRA_INSTALL_RULES_FILE:FILEPATH=%{_topdir}/BUILD/%{name}-v%{version}-source/Applications/ParaView-4.4.0_extra_install_Darwin.cmake + + # We activate the new Unix-style installation for Mac OS X + addCMakeVariable PARAVIEW_DO_UNIX_STYLE_INSTALLS:BOOL=ON + + # Recent version of Mac OSX (Yosemite) cannot compile ParaView with the gcc compiler + # Using clang instead + CC=clang + CXX=clang++ +%endif + + # Add the value of _qmakePath for QT_QMAKE_EXECUTABLE + addCMakeVariable QT_QMAKE_EXECUTABLE:FILEPATH=%{_qmakePath} + + echo "CMAKE_VARIABLES: $CMAKE_VARIABLES" + + mkdir -p ./buildObj + cd ./buildObj + + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=%{_installPrefix} \ + $CMAKE_VARIABLES \ + .. + + [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1 + make -j $WM_NCOMPPROCS + +%install + # On OpenSUSE, rpmbuild, will choke when detecting unreferenced symlinks + # created during installation. + # Qt version 4.8.0 will generate some unreferenced symlinks when + # ParaView is compiled and installed. By enabling the following + # environment variable, the command brp-symlink will still complain + # about missing link targets, but it won't stop rpmbuild from generating + # the final rpm. + # For all other Unix distros, this is a no-op. + export NO_BRP_STALE_LINK_ERROR=yes + + cd buildObj + make install DESTDIR=$RPM_BUILD_ROOT + +%ifos darwin + # Cleaning up some strange install side effect from option + # PARAVIEW_DO_UNIX_STYLE_INSTALLS + # Need to revisit this section eventually. + if [ -d "$RPM_BUILD_ROOT/$RPM_BUILD_ROOT" ]; then + mv $RPM_BUILD_ROOT/$RPM_BUILD_ROOT/%{_installPrefix}/bin/* $RPM_BUILD_ROOT/%{_installPrefix}/bin + fi +%endif + + # Creation of foam-extend specific .csh and .sh files" + + echo "" + echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}" + echo "" + # + # Generate package specific .sh file for foam-extend + # +mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc +cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export PARAVIEW_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +export PARAVIEW_BIN_DIR=\$PARAVIEW_DIR/bin +export PARAVIEW_LIB_DIR=\$PARAVIEW_DIR/lib +export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include/paraview-5.4 + +export PARAVIEW_VERSION=%{version} + +# NB: It is important to set the PV_PLUGIN_PATH location to a directory containing only the ParaView plugins. +# Otherwise, paraview will try to automatically autoload each and every dynamic library it can find in the +# specified directory to see if a given library is a paraview plugin. +# In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the +# startup of paraview or even make paraview crash on startup. +export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-5.4_plugins + +[ -d \$PARAVIEW_LIB_DIR/paraview-5.4 ] && _foamAddLib \$PARAVIEW_LIB_DIR/paraview-5.4 + +# Enable access to the package applications if present +[ -d \$PARAVIEW_BIN_DIR ] && _foamAddPath \$PARAVIEW_BIN_DIR + +# Additional binary path if running on Mac OS X +[ -d \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS ] && _foamAddPath \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS + +DOT_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh +# Load %{name}-%{version} libraries and binaries if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv PARAVIEW_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +setenv PARAVIEW_BIN_DIR \$PARAVIEW_DIR/bin +setenv PARAVIEW_LIB_DIR \$PARAVIEW_DIR/lib +setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include/paraview-5.4 + +setenv PARAVIEW_VERSION %{version} + +# NB: It is important to set the PV_PLUGIN_PATH location to a directory containing only the ParaView plugins. +# Otherwise, paraview will try to automatically autoload each and every dynamic library it can find in the +# specified directory to see if a given library is a paraview plugin. +# In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the +# startup of paraview or even make paraview crash on startup. +setenv PV_PLUGIN_PATH \$FOAM_LIBBIN/paraview-5.4_plugins + +if ( -e \$PARAVIEW_BIN_DIR ) then + _foamAddPath \$PARAVIEW_BIN_DIR +endif + +if ( -e \$PARAVIEW_LIB_DIR/paraview-5.4 ) then + _foamAddLib \$PARAVIEW_LIB_DIR/paraview-5.4 +endif + + +# Additional binary path if running on Mac OS X +if ( -e \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS ) then + _foamAddPath \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS +endif +DOT_CSH_EOF + + #finally, generate a .tgz file for systems where using rpm for installing packages + # as a non-root user might be a problem. + (mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version}) + +%clean + +%files +%defattr(-,root,root) +%{_installPrefix} + + diff --git a/etc/bashrc b/etc/bashrc index a324e7342..e6a0797ae 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -112,7 +112,7 @@ export WM_THIRD_PARTY_USE_HWLOC_201=1 # # For AllMake.stage4 #export WM_THIRD_PARTY_USE_QT_5111=1 -#export WM_THIRD_PARTY_USE_PARAVIEW_440=1 +#export WM_THIRD_PARTY_USE_PARAVIEW_552=1 # Source files, possibly with some verbosity diff --git a/etc/cshrc b/etc/cshrc index 5b05b2bd9..d96b84d9c 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -98,7 +98,7 @@ setenv WM_THIRD_PARTY_USE_HWLOC_201 1 # # For AllMake.stage4 #setenv WM_THIRD_PARTY_USE_QT_5111 1 -#setenv WM_THIRD_PARTY_USE_PARAVIEW_440 1 +#setenv WM_THIRD_PARTY_USE_PARAVIEW_552 1 # Source files, possibly with some verbosity diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index ae6dab3ce..d3851af10 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -238,7 +238,7 @@ setenv WM_THIRD_PARTY_USE_HWLOC_201 1 # # For AllMake.stage4 setenv WM_THIRD_PARTY_USE_QT_511 1 -setenv WM_THIRD_PARTY_USE_PARAVIEW_440 1 +setenv WM_THIRD_PARTY_USE_PARAVIEW_552 1 #setenv WM_THIRD_PARTY_USE_PARAVIEW_431 1 #setenv WM_THIRD_PARTY_USE_PARAVIEW_410 1 diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index d147b18b7..5a07a6f94 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -251,7 +251,7 @@ export WM_THIRD_PARTY_USE_HWLOC_201=1 # # For AllMake.stage4 #export WM_THIRD_PARTY_USE_QT_5111=1 -#export WM_THIRD_PARTY_USE_PARAVIEW_541=1 +#export WM_THIRD_PARTY_USE_PARAVIEW_552=1 export WM_THIRD_PARTY_USE_QT_486=1 export WM_THIRD_PARTY_USE_PARAVIEW_440=1 #export WM_THIRD_PARTY_USE_PARAVIEW_431=1 diff --git a/etc/settings.csh b/etc/settings.csh index bbe12ee34..9d1b777dd 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -642,6 +642,9 @@ endif # PARAVIEW # ~~~~~ +if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_552 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-5.5.2/platforms/$WM_OPTIONS ) then + _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-5.5.2/platforms/$WM_OPTIONS/etc/ParaView-5.5.2.csh +endif if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_541 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-5.4.1/platforms/$WM_OPTIONS ) then _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-5.4.1/platforms/$WM_OPTIONS/etc/ParaView-5.4.1.csh endif diff --git a/etc/settings.sh b/etc/settings.sh index 32a3e6c4c..313415c06 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -769,6 +769,9 @@ fi # Load ParaView # ~~~~~~~~~~~~~ +[ -z "$PARAVIEW_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PARAVIEW_552 ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParaView-5.5.2/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-5.5.2/platforms/$WM_OPTIONS/etc/ParaView-5.5.2.sh +} [ -z "$PARAVIEW_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PARAVIEW_541 ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParaView-5.4.1/platforms/$WM_OPTIONS ] && { _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-5.4.1/platforms/$WM_OPTIONS/etc/ParaView-5.4.1.sh } From 903e06f5ab7b61c4e46f3fabe27ee7e244876e44 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 1 Jul 2018 22:48:52 -0400 Subject: [PATCH 13/60] ThirdParty: ParaView-5.5.2: adjustments to automatically generated .sh and .csh package configuration files --- ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec b/ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec index 4d862977f..7d421de31 100644 --- a/ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec +++ b/ThirdParty/rpmBuild/SPECS/ParaView-5.5.2.spec @@ -78,7 +78,7 @@ License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: http://www.paraview.org/files/v5.4/ +URL: http://www.paraview.org/files/v5.5/ Source: %url/%{name}-v%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools @@ -226,7 +226,7 @@ cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh export PARAVIEW_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS export PARAVIEW_BIN_DIR=\$PARAVIEW_DIR/bin export PARAVIEW_LIB_DIR=\$PARAVIEW_DIR/lib -export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include/paraview-5.4 +export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include/paraview-5.5 export PARAVIEW_VERSION=%{version} @@ -235,9 +235,9 @@ export PARAVIEW_VERSION=%{version} # specified directory to see if a given library is a paraview plugin. # In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the # startup of paraview or even make paraview crash on startup. -export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-5.4_plugins +export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-5.5_plugins -[ -d \$PARAVIEW_LIB_DIR/paraview-5.4 ] && _foamAddLib \$PARAVIEW_LIB_DIR/paraview-5.4 +[ -d \$PARAVIEW_LIB_DIR/paraview-5.5 ] && _foamAddLib \$PARAVIEW_LIB_DIR/paraview-5.5 # Enable access to the package applications if present [ -d \$PARAVIEW_BIN_DIR ] && _foamAddPath \$PARAVIEW_BIN_DIR @@ -256,7 +256,7 @@ cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.cs setenv PARAVIEW_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS setenv PARAVIEW_BIN_DIR \$PARAVIEW_DIR/bin setenv PARAVIEW_LIB_DIR \$PARAVIEW_DIR/lib -setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include/paraview-5.4 +setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include/paraview-5.5 setenv PARAVIEW_VERSION %{version} @@ -265,14 +265,14 @@ setenv PARAVIEW_VERSION %{version} # specified directory to see if a given library is a paraview plugin. # In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the # startup of paraview or even make paraview crash on startup. -setenv PV_PLUGIN_PATH \$FOAM_LIBBIN/paraview-5.4_plugins +setenv PV_PLUGIN_PATH \$FOAM_LIBBIN/paraview-5.5_plugins if ( -e \$PARAVIEW_BIN_DIR ) then _foamAddPath \$PARAVIEW_BIN_DIR endif -if ( -e \$PARAVIEW_LIB_DIR/paraview-5.4 ) then - _foamAddLib \$PARAVIEW_LIB_DIR/paraview-5.4 +if ( -e \$PARAVIEW_LIB_DIR/paraview-5.5 ) then + _foamAddLib \$PARAVIEW_LIB_DIR/paraview-5.5 endif From 1c5b0bc3cc2a1231abc781c8e76377940dd1b064 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Sun, 1 Jul 2018 22:51:57 -0400 Subject: [PATCH 14/60] ParaView plugin compilation: syntax adjustments for newer versions of CMake --- .../PVReaders/PVFoamReader/CMakeLists.txt | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt index 4b688def7..a9c7d5a70 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt @@ -65,13 +65,24 @@ ADD_PARAVIEW_PLUGIN( if(NOT FOAM_FOUND) # Config when compiling FOAM library with wmake - TARGET_LINK_LIBRARIES( - PVFoamReader_SM - foam - finiteVolume - vtkPVFoam - pqCore - ) + if(${CMAKE_VERSION} VERSION_LESS "2.8.12") + TARGET_LINK_LIBRARIES( + PVFoamReader_SM + foam + finiteVolume + vtkPVFoam + pqCore + ) + else() + TARGET_LINK_LIBRARIES( + PVFoamReader_SM + PUBLIC foam + finiteVolume + vtkPVFoam + pqCore + ) + endif() + else() # Config when compiling FOAM library with cmake From b59cad23fd32f0ac0543091e3d3ce15c48f76798 Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Wed, 4 Jul 2018 22:54:35 -0400 Subject: [PATCH 15/60] ThirdParty: bumping openmpi to version 3.1.1 --- ThirdParty/AllMake.stage2 | 10 +- ThirdParty/rpmBuild/SPECS/openmpi-3.1.1.spec | 264 +++++++++++++++++++ etc/bashrc | 2 +- etc/cshrc | 2 +- etc/prefs.csh-EXAMPLE | 2 +- etc/prefs.sh-EXAMPLE | 2 +- etc/settings.csh | 6 +- etc/settings.sh | 6 +- 8 files changed, 279 insertions(+), 15 deletions(-) create mode 100644 ThirdParty/rpmBuild/SPECS/openmpi-3.1.1.spec diff --git a/ThirdParty/AllMake.stage2 b/ThirdParty/AllMake.stage2 index 9bd65c8e0..93519fa98 100755 --- a/ThirdParty/AllMake.stage2 +++ b/ThirdParty/AllMake.stage2 @@ -105,12 +105,12 @@ then -f --define '_configureAdditionalArgs "$WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs"') } - # openmpi 3.1.0 + # openmpi 3.1.1 # - [ ! -z "$WM_THIRD_PARTY_USE_OPENMPI_310" ] && { - echo "Building openmpi 3.1.0" - ( rpm_make -p openmpi-3.1.0 -s openmpi-3.1.0.spec -u https://www.open-mpi.org/software/ompi/v3.1/downloads/openmpi-3.1.0.tar.gz \ - -f --define '_configureAdditionalArgs "$WM_THIRD_PARTY_USE_OPENMPI_310_ConfigureAdditionalArgs"') + [ ! -z "$WM_THIRD_PARTY_USE_OPENMPI_311" ] && { + echo "Building openmpi 3.1.1" + ( rpm_make -p openmpi-3.1.1 -s openmpi-3.1.1.spec -u https://www.open-mpi.org/software/ompi/v3.1/downloads/openmpi-3.1.1.tar.gz \ + -f --define '_configureAdditionalArgs "$WM_THIRD_PARTY_USE_OPENMPI_311_ConfigureAdditionalArgs"') } # mvipich2-2.2 diff --git a/ThirdParty/rpmBuild/SPECS/openmpi-3.1.1.spec b/ThirdParty/rpmBuild/SPECS/openmpi-3.1.1.spec new file mode 100644 index 000000000..2c882b529 --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/openmpi-3.1.1.spec @@ -0,0 +1,264 @@ +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | foam-extend: Open Source CFD +# \\ / O peration | +# \\ / A nd | For copyright notice see file Copyright +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of foam-extend. +# +# foam-extend 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. +# +# foam-extend 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 foam-extend. If not, see . +# +# Script +# RPM spec file for openmpi-3.1.1 +# +# Description +# RPM spec file for creating a relocatable RPM +# +# Author: +# Martin Beaudoin, (2018) +# +#------------------------------------------------------------------------------ + +# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable +%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)} +%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)} + +# Disable the generation of debuginfo packages +%define debug_package %{nil} + +# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory +%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild +%define _tmppath %{_topdir}/tmp + +# Will install the package directly $WM_THIRD_PARTY_DIR +# Some comments about package relocation: +# By using this prefix for the Prefix: parameter in this file, you will make this +# package relocatable. +# +# This is fine, as long as your software is itself relocatable. +# +# Simply take note that libraries built with libtool are not relocatable because the +# prefix we specify will be hard-coded in the library .la files. +# Ref: http://sourceware.org/autobook/autobook/autobook_80.html +# +# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will +# not be able to reutilize this RPM, even though it is relocatable. You will need to +# regenerate the RPM. +# +%define _prefix %{_WM_THIRD_PARTY_DIR} + +%define name openmpi +%define release %{_WM_OPTIONS} +%define version 3.1.1 + +%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root + +BuildRoot: %{buildroot} +Summary: openmpi +License: Unkown +Name: %{name} +Version: %{version} +Release: %{release} +URL: http://www.open-mpi.org/software/ompi/v1.8/downloads +Source: %url/%{name}-%{version}.tar.gz +Prefix: %{_prefix} +Group: Development/Tools + + +%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS} + +#-------------------------------------------------------------------------- +# +# Here, we define default compiling options for openmpi +# +# One can override the option on the commande line : --define='MACRO EXPR' +# +%{!?_configureAdditionalArgs: %define _configureAdditionalArgs Undefined} + + +%description +%{summary} + +%prep +%setup -q + + +%build + # export WM settings in a form that GNU configure recognizes + [ -n "$WM_CC" ] && export CC="$WM_CC" + [ -n "$WM_CXX" ] && export CXX="$WM_CXX" + [ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS" + [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" + [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" + + set +x + echo "" + echo "Compilation options:" + echo " _configureAdditionalArgs : %{_configureAdditionalArgs}" + echo "" + set -x + + unset mpiWith + # Enable GridEngine if it appears to be in use + # If you don't want any integration with SGE, simply unset the SGE + # environment variable + if [ -n "$SGE_ROOT" ] + then + mpiWith="$mpiWith --with-sge" + else + mpiWith="$mpiWith --without-sge" + mpiWith="$mpiWith --enable-mca-no-build=ras-gridengine,pls-gridengine" + fi + + # Infiniband support + # Adjust according to your local paths + # if [ -d /usr/local/ofed -a -d /usr/local/ofed/lib64 ] + # then + # mpiWith="$mpiWith --with-openib=/usr/local/ofed" + # mpiWith="$mpiWith --with-openib-libdir=/usr/local/ofed/lib64" + # fi + + ./configure \ + --prefix=%{_installPrefix} \ + --exec_prefix=%{_installPrefix} \ + --enable-mpirun-prefix-by-default \ + --enable-orterun-prefix-by-default \ + --enable-shared \ + --enable-mpi-cxx \ + --disable-static \ + --disable-mpi-fortran \ + --without-slurm \ + `echo %{?_configureAdditionalArgs}` + + [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1 + make -j $WM_NCOMPPROCS + +%install + make install DESTDIR=$RPM_BUILD_ROOT + + # Creation of foam-extend specific .csh and .sh files" + + echo "" + echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}" + echo "" + # + # Generate package specific .sh file for foam-extend + # +mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc +cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh +# Load %{name}-%{version} libraries and binaries +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +export OPENMPI_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +export OPENMPI_BIN_DIR=\$OPENMPI_DIR/bin +export OPENMPI_LIB_DIR=\$OPENMPI_DIR/lib + +# Enable access to the package runtime applications and libraries +[ -d \$OPENMPI_BIN_DIR ] && _foamAddPath \$OPENMPI_BIN_DIR +[ -d \$OPENMPI_LIB_DIR ] && _foamAddLib \$OPENMPI_LIB_DIR + +export MPI_HOME=\$OPENMPI_DIR +export MPI_ARCH_PATH=\$MPI_HOME +export OPAL_PREFIX=\$MPI_ARCH_PATH + +# We initialize the rest of the environment using mpicc --showme: +export OPENMPI_INCLUDE_DIR="\`mpicc --showme:incdirs\`" +export OPENMPI_COMPILE_FLAGS="\`mpicc --showme:compile\`" +export OPENMPI_LINK_FLAGS="\`mpicc --showme:link\`" + +# Set the foam-extend compilation flags +export PINC=\$OPENMPI_COMPILE_FLAGS +export PLIBS=\$OPENMPI_LINK_FLAGS + + +if [ "\$FOAM_VERBOSE" -a "\$PS1" ] +then + echo " Environment variables defined for OpenMPI:" + echo " OPENMPI_BIN_DIR : \$OPENMPI_BIN_DIR" + echo " OPENMPI_LIB_DIR : \$OPENMPI_LIB_DIR" + echo " OPENMPI_INCLUDE_DIR : \$OPENMPI_INCLUDE_DIR" + echo " OPENMPI_COMPILE_FLAGS : \$OPENMPI_COMPILE_FLAGS" + echo " OPENMPI_LINK_FLAGS : \$OPENMPI_LINK_FLAGS" + echo "" + echo " MPI_HOME : \$MPI_HOME" + echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH" + echo " MPIRUN_OPTIONS : \$MPIRUN_OPTIONS" + echo " OPAL_PREFIX : \$OPAL_PREFIX" + echo " PINC : \$PINC" + echo " PLIBS : \$PLIBS" +fi +DOT_SH_EOF + + # + # Generate package specific .csh file for foam-extend + # +cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh +# Load %{name}-%{version} libraries and binaries +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +setenv OPENMPI_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS +setenv OPENMPI_BIN_DIR \$OPENMPI_DIR/bin +setenv OPENMPI_LIB_DIR \$OPENMPI_DIR/lib + +# Enable access to the package runtime applications and libraries +if ( -e \$OPENMPI_BIN_DIR ) then + _foamAddPath \$OPENMPI_BIN_DIR +endif + +if ( -e \$OPENMPI_LIB_DIR ) then + _foamAddLib \$OPENMPI_LIB_DIR +endif + +setenv MPI_HOME \$OPENMPI_DIR +setenv MPI_ARCH_PATH \$MPI_HOME +setenv OPAL_PREFIX \$MPI_ARCH_PATH + +# We initialize the rest of the environment using mpicc --showme: +setenv OPENMPI_INCLUDE_DIR "\`mpicc --showme:incdirs\`" +setenv OPENMPI_COMPILE_FLAGS "\`mpicc --showme:compile\`" +setenv OPENMPI_LINK_FLAGS "\`mpicc --showme:link\`" + +# Set the foam-extend compilation flags +setenv PINC "\$OPENMPI_COMPILE_FLAGS" +setenv PLIBS "\$OPENMPI_LINK_FLAGS" + + +if (\$?FOAM_VERBOSE && \$?prompt) then + echo " Environment variables defined for OpenMPI:" + echo " OPENMPI_BIN_DIR : \$OPENMPI_BIN_DIR" + echo " OPENMPI_LIB_DIR : \$OPENMPI_LIB_DIR" + echo " OPENMPI_INCLUDE_DIR : \$OPENMPI_INCLUDE_DIR" + echo " OPENMPI_COMPILE_FLAGS : \$OPENMPI_COMPILE_FLAGS" + echo " OPENMPI_LINK_FLAGS : \$OPENMPI_LINK_FLAGS" + echo "" + echo " MPI_HOME : \$MPI_HOME" + echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH" + echo " MPIRUN_OPTIONS : \$MPIRUN_OPTIONS" + echo " OPAL_PREFIX : \$OPAL_PREFIX" + echo " PINC : \$PINC" + echo " PLIBS : \$PLIBS" +endif +DOT_CSH_EOF + + #finally, generate a .tgz file for systems where using rpm for installing packages + # as a non-root user might be a problem. + (mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version}) + + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_installPrefix} diff --git a/etc/bashrc b/etc/bashrc index e6a0797ae..bd56cf597 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -96,7 +96,7 @@ export WM_THIRD_PARTY_DIR=$WM_PROJECT_DIR/ThirdParty # # For AllMake.stage2 -export WM_THIRD_PARTY_USE_OPENMPI_310=1 +export WM_THIRD_PARTY_USE_OPENMPI_311=1 # # For AllMake.stage3 diff --git a/etc/cshrc b/etc/cshrc index d96b84d9c..1214a2fd3 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -82,7 +82,7 @@ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_DIR/ThirdParty # # For AllMake.stage2 -setenv WM_THIRD_PARTY_USE_OPENMPI_310 1 +setenv WM_THIRD_PARTY_USE_OPENMPI_311 1 # # For AllMake.stage3 diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE index d3851af10..b7a3339af 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/prefs.csh-EXAMPLE @@ -208,7 +208,7 @@ setenv WM_THIRD_PARTY_USE_CMAKE_3114 1 # # For AllMake.stage2 -setenv WM_THIRD_PARTY_USE_OPENMPI_310 1 +setenv WM_THIRD_PARTY_USE_OPENMPI_311 1 #setenv WM_THIRD_PARTY_USE_OPENMPI_188 1 #setenv WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs '--enable-mpi-cxx --with-verbs' #setenv WM_THIRD_PARTY_USE_OPENMPI_165 1 diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE index 5a07a6f94..a711257c7 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/prefs.sh-EXAMPLE @@ -221,7 +221,7 @@ export WM_THIRD_PARTY_USE_CMAKE_3114=1 # # For AllMake.stage2 -export WM_THIRD_PARTY_USE_OPENMPI_310=1 +export WM_THIRD_PARTY_USE_OPENMPI_311=1 #export WM_THIRD_PARTY_USE_OPENMPI_188=1 #export WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs='--enable-mpi-cxx --with-verbs' #export WM_THIRD_PARTY_USE_OPENMPI_165=1 diff --git a/etc/settings.csh b/etc/settings.csh index 9d1b777dd..a62ed4370 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -167,11 +167,11 @@ set mpi_version=unknown switch ("$WM_MPLIB") case OPENMPI: - if ($?WM_THIRD_PARTY_USE_OPENMPI_310 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-3.1.0/platforms/$WM_OPTIONS ) then - set mpi_version=openmpi-3.1.0 + if ($?WM_THIRD_PARTY_USE_OPENMPI_311 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-3.1.1/platforms/$WM_OPTIONS ) then + set mpi_version=openmpi-3.1.1 if ($?FOAM_VERBOSE && $?prompt) then - echo "Using openmpi-3.1.0 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version" + echo "Using openmpi-3.1.1 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version" endif _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh diff --git a/etc/settings.sh b/etc/settings.sh index 313415c06..f2dca4d3b 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -213,12 +213,12 @@ unset MPI_ARCH_PATH mpi_version=unknown case "$WM_MPLIB" in OPENMPI) - if [ ! -z $WM_THIRD_PARTY_USE_OPENMPI_310 ] && [ -e $WM_THIRD_PARTY_DIR/packages/openmpi-3.1.0/platforms/$WM_OPTIONS ] + if [ ! -z $WM_THIRD_PARTY_USE_OPENMPI_311 ] && [ -e $WM_THIRD_PARTY_DIR/packages/openmpi-3.1.1/platforms/$WM_OPTIONS ] then - mpi_version=openmpi-3.1.0 + mpi_version=openmpi-3.1.1 if [ "$FOAM_VERBOSE" -a "$PS1" ] then - echo "Using openmpi-3.1.0 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version" + echo "Using openmpi-3.1.1 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version" fi _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.sh From 7524014a37ccb045523d40c1f194b49eddd81a00 Mon Sep 17 00:00:00 2001 From: Vuko Vukcevic Date: Wed, 6 Jun 2018 10:52:57 +0200 Subject: [PATCH 16/60] 2D AMR: prismatic2DRefinement polyMeshModifier Ported prismatic2DRefinement class from other temporary repository. Basically a version of polyhedralRefinement specifically designed for 2D cases. Status: Refinement seems to work well on simple cases: 1. 4 by 4 hex cells (quad prisms), 2. 28 triangular prisms, 3. Tested both in serial and parallel up to 9 refinement levels. To do: 1. Implement proper 2D unrefinement, 2. Refactor prismatic2DRefinement and polyhedralRefinement to avoid duplicate functions used by both classes. --- src/dynamicMesh/dynamicMesh/Make/files | 4 +- .../prismatic2DRefinement.C | 5368 +++++++++++++++++ .../prismatic2DRefinement.H | 557 ++ 3 files changed, 5927 insertions(+), 2 deletions(-) create mode 100644 src/dynamicMesh/dynamicMesh/polyMeshModifiers/prismatic2DRefinement/prismatic2DRefinement.C create mode 100644 src/dynamicMesh/dynamicMesh/polyMeshModifiers/prismatic2DRefinement/prismatic2DRefinement.H diff --git a/src/dynamicMesh/dynamicMesh/Make/files b/src/dynamicMesh/dynamicMesh/Make/files index ec3738647..7400b7e69 100644 --- a/src/dynamicMesh/dynamicMesh/Make/files +++ b/src/dynamicMesh/dynamicMesh/Make/files @@ -37,8 +37,8 @@ $(slidingInterface)/decoupleSlidingInterface.C repatchCoverage = $(polyMeshModifiers)/repatchCoverage $(repatchCoverage)/repatchCoverage.C -polyhedralRefinement = $(polyMeshModifiers)/polyhedralRefinement -$(polyhedralRefinement)/polyhedralRefinement.C +$(polyMeshModifiers)/polyhedralRefinement/polyhedralRefinement.C +$(polyMeshModifiers)/prismatic2DRefinement/prismatic2DRefinement.C polyTopoChange/polyTopoChange/polyTopoChange.C polyTopoChange/polyTopoChange/actions/topoAction/topoActions.C diff --git a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/prismatic2DRefinement/prismatic2DRefinement.C b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/prismatic2DRefinement/prismatic2DRefinement.C new file mode 100644 index 000000000..ed0cfe212 --- /dev/null +++ b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/prismatic2DRefinement/prismatic2DRefinement.C @@ -0,0 +1,5368 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend 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. + + foam-extend 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 foam-extend. If not, see . + +Author + Vuko Vukcevic, Wikki Ltd. All rights reserved. + +Notes + Specialisation of prismatic2DRefinement for 2D simulations on arbitrary + prismatic meshes (tet, hex, etc). + +\*---------------------------------------------------------------------------*/ + +#include "prismatic2DRefinement.H" +#include "polyTopoChanger.H" +#include "polyMesh.H" +#include "foamTime.H" +#include "primitiveMesh.H" +#include "polyTopoChange.H" +#include "syncTools.H" +#include "meshTools.H" +#include "cellSet.H" +#include "faceSet.H" +#include "pointSet.H" +#include "mapPolyMesh.H" +#include "emptyPolyPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(prismatic2DRefinement, 0); + addToRunTimeSelectionTable + ( + polyMeshModifier, + prismatic2DRefinement, + dictionary + ); +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::label Foam::prismatic2DRefinement::getAnchorLevel +( + const label faceI, + const label nPoints +) const +{ + // Get the face + const face& f = mesh_.faces()[faceI]; + + // Sanity check for expected number of points + if (nPoints != 3 && nPoints != 4) + { + FatalErrorIn + ( + "label prismatic2DRefinement::getAnchorLevel" + "\n(" + "\n const label faceI," + "\n const label nPoints" + "\n) const" + ) << "Trying to find anchor level with " << nPoints << " points" + << " smaller than anchor level. Only nPoints = 3 and 4 are" + << " supported." + << abort(FatalError); + } + + // Sanity check: if we are expecting to find 4 points on a face which is not + // on empty patch and we find a face with 3 points, issue an error + if (f.size() <= 3 && nPoints == 4) + { + FatalErrorIn + ( + "label prismatic2DRefinement::getAnchorLevel" + "\n(" + "\n const label faceI," + "\n const label nPoints" + "\n) const" + ) << "Expected to find at least 4 points with level lower than" + << " anchor level." + << nl + << "Make sure to call this function with nPoints = 4 only if" + << " you do not expect triangular faces." + << abort(FatalError); + } + + if (f.size() <= nPoints) + { + return pointLevel_[f[findMaxLevel(f)]]; + } + else + { + const label& ownLevel = cellLevel_[mesh_.faceOwner()[faceI]]; + + if (countAnchors(f, ownLevel) >= nPoints) + { + return ownLevel; + } + else if (countAnchors(f, ownLevel + 1) >= nPoints) + { + return ownLevel + 1; + } + else + { + return -1; + } + } +} + + +void Foam::prismatic2DRefinement::calcLevel0EdgeLength() +{ + if (cellLevel_.size() != mesh_.nCells()) + { + FatalErrorIn("scalar prismatic2DRefinement::getLevel0EdgeLength() const") + << "Number of cells in mesh:" << mesh_.nCells() + << " does not equal size of cellLevel:" << cellLevel_.size() + << endl + << "This might be because of a restart with inconsistent cellLevel." + << abort(FatalError); + } + + // Determine minimum edge length per refinement level + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + const scalar GREAT2 = sqr(GREAT); + + const label nLevels = gMax(cellLevel_) + 1; + + // Initialise typical edge length squared to dummy large value + scalarField typEdgeLenSqr(nLevels, GREAT2); + + + // 1. Look only at edges surrounded by cellLevel cells only + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Edge list containing cellLevel of connected cells. + // Note: + // - If not set = -1 + // - Levels of connected cells = from 0 to nLevels - 1 + // - If different levels = labelMax + labelList edgeLevel(mesh_.nEdges(), -1); + + // Mark edges on empty patches. This will be used to skip edges on internal + // faces and ordinary boundaries + boolList edgeOnEmptyPatch(mesh_.nEdges() , false); + + // Get boundary mesh + const polyBoundaryMesh& boundaryMesh = mesh_.boundaryMesh(); + + // Get face-edge addressing + const labelListList& meshFaceEdges = mesh_.faceEdges(); + + // Loop through all patches + forAll (boundaryMesh, patchI) + { + // Get current patch + const polyPatch& curPatch = boundaryMesh[patchI]; + + // Check whether this patch is emptyPolyPatch + if (isA(curPatch)) + { + // Get start and end face labels + const label startFaceI = curPatch.start(); + const label endFaceI = startFaceI + curPatch.size(); + + // Mark all the faces and edges on the patch + for (label faceI = startFaceI; faceI < endFaceI; ++faceI) + { + // Get edges of this face + const labelList& curEdges = meshFaceEdges[faceI]; + + // Mark all edges + forAll (curEdges, i) + { + edgeOnEmptyPatch[curEdges[i]] = true; + } + } // End for all patch faces + } // End if the patch is empty + } // End for all patches + + // Get cell edges + const labelListList& meshCellEdges = mesh_.cellEdges(); + + // Loop through cells + forAll(cellLevel_, cellI) + { + // Get cell level and cell edges + const label& cLevel = cellLevel_[cellI]; + const labelList& edges = meshCellEdges[cellI]; + + // Loop through all edges + forAll(edges, i) + { + const label& edgeI = edges[i]; + + // Check whether the edge is on empty patch + if (edgeOnEmptyPatch[edgeI]) + { + if (edgeLevel[edgeI] == -1) + { + // Edge level not set, mark it with current cell level + edgeLevel[edgeI] = cLevel; + } + else if (edgeLevel[edgeI] == labelMax) + { + // Already marked as on different cellLevels + } + else if (edgeLevel[edgeI] != cLevel) + { + // Edge level with different cell levels + edgeLevel[edgeI] = labelMax; + } + } + // Else leave edgeLevel to dummy -1 value + } + } + + // Make sure that edges with different levels on different processors + // are also marked. Do the same test (edgeLevel != cLevel) on coupled + // edges. + syncTools::syncEdgeList + ( + mesh_, + edgeLevel, + ifEqEqAssignFirstOp(), + labelMin, + false // no separation + ); + + // Now use the edgeLevel with a valid value to determine the + // length per level. + + // Get mesh edges and points + const edgeList& meshEdges = mesh_.edges(); + const pointField& meshPoints = mesh_.points(); + + forAll(edgeLevel, edgeI) + { + // Get edge level + const label& eLevel = edgeLevel[edgeI]; + + // Edge has unique cell level (both cells have the same level) + if (eLevel > -1 && eLevel < labelMax) + { + // Get the edge and calculate the square of the length + const edge& e = meshEdges[edgeI]; + const scalar edgeLenSqr = magSqr(e.vec(meshPoints)); + + typEdgeLenSqr[eLevel] = min(typEdgeLenSqr[eLevel], edgeLenSqr); + } + // Else typical edge length squared is not affected + } + + // Get the minimum per level over all processors. Note: using minEqOp + // because if the cells are not cubic, we end up using the smallest edge + Pstream::listCombineGather(typEdgeLenSqr, minEqOp()); + Pstream::listCombineScatter(typEdgeLenSqr); + + if (debug) + { + Pout<< "prismatic2DRefinement::calcLevel0EdgeLength() :" + << " Initial edge lengths squared per refinementlevel:" + << typEdgeLenSqr << endl; + } + + + // 2. For any levels where we haven't determined a valid length yet + // use any surrounding cell level. Here we use the max so we don't + // pick up levels between cellLevel and higher cellLevel (will have + // edges sized according to highest cellLevel) + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Initialise maximum edge length to dummy large value + scalarField maxEdgeLenSqr(nLevels, -GREAT2); + + // Loop through cells + forAll(cellLevel_, cellI) + { + // Get cell level and cell edges + const label& cLevel = cellLevel_[cellI]; + const labelList& cEdges = meshCellEdges[cellI]; + + // Loop through edges + forAll(cEdges, i) + { + // Get the edge + const label& edgeI = cEdges[i]; + + if (edgeOnEmptyPatch[edgeI]) + { + // Edge is on empty patch, calculate the max edge length + const edge& e = meshEdges[cEdges[i]]; + const scalar edgeLenSqr = magSqr(e.vec(meshPoints)); + + maxEdgeLenSqr[cLevel] = max(maxEdgeLenSqr[cLevel], edgeLenSqr); + } + // Else typical max edge length squared is not affected + } + } + + // Get maximum per level over all processors + Pstream::listCombineGather(maxEdgeLenSqr, maxEqOp()); + Pstream::listCombineScatter(maxEdgeLenSqr); + + if (debug) + { + Pout<< "prismatic2DRefinement::calcLevel0EdgeLength() :" + << " Basic edge lengths squared per refinementlevel:" + << maxEdgeLenSqr << endl; + } + + + // 3. Combine the two sets of lengths + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + forAll(typEdgeLenSqr, levelI) + { + if + ( + equal(typEdgeLenSqr[levelI], GREAT2) + && maxEdgeLenSqr[levelI] >= 0 + ) + { + typEdgeLenSqr[levelI] = maxEdgeLenSqr[levelI]; + } + } + + if (debug) + { + Pout<< "prismatic2DRefinement::calcLevel0EdgeLength() :" + << " Final edge lengths squared per refinementlevel:" + << typEdgeLenSqr << endl; + } + + // Find lowest length present across all levels + level0EdgeLength_ = -1; + + forAll(typEdgeLenSqr, levelI) + { + const scalar& lenSqr = typEdgeLenSqr[levelI]; + + if (lenSqr < GREAT2) + { + // Note: use power instead of left shift operator to multiply the + // length with appropriate level. Easier to read. VV, 5/Jan/2018. + level0EdgeLength_ = Foam::sqrt(lenSqr)*(Foam::pow(2, levelI)); + + if (debug) + { + Pout<< "prismatic2DRefinement::calcLevel0EdgeLength() :" + << " Edge length: " << Foam::sqrt(lenSqr) << ", " + << "with edge level: " << levelI << ", " + << "has equivalent level0 lenght of:" << level0EdgeLength_ + << endl; + } + + break; + } + } + + if (level0EdgeLength_ == -1) + { + FatalErrorIn("prismatic2DRefinement::calcLevel0EdgeLength()") + << "Problem in definition of typical edge length squared: " + << typEdgeLenSqr << abort(FatalError); + } +} + + +void Foam::prismatic2DRefinement::setInstance(const fileName& inst) const +{ + if (debug) + { + Pout<< "prismatic2DRefinement::setInstance(const fileName& inst)" + << nl + << "Resetting file instance of refinement data to " << inst + << endl; + } + + cellLevel_.instance() = inst; + pointLevel_.instance() = inst; +} + + +void Foam::prismatic2DRefinement::extendMarkedCellsAcrossFaces +( + boolList& markedCell +) const +{ + // Mark all faces for all marked cells + const label nFaces = mesh_.nFaces(); + boolList markedFace(nFaces, false); + + // Get mesh cells + const cellList& meshCells = mesh_.cells(); + + // Loop through all cells + forAll (markedCell, cellI) + { + if (markedCell[cellI]) + { + // This cell is marked, get its faces + const cell& cFaces = meshCells[cellI]; + + forAll (cFaces, i) + { + markedFace[cFaces[i]] = true; + } + } + } + + // Snyc the face list across processor boundaries + syncTools::syncFaceList(mesh_, markedFace, orEqOp(), false); + + // Get necessary mesh data + const label nInternalFaces = mesh_.nInternalFaces(); + const labelList& owner = mesh_.faceOwner(); + const labelList& neighbour = mesh_.faceNeighbour(); + + // Internal faces + for (label faceI = 0; faceI < nInternalFaces; ++faceI) + { + if (markedFace[faceI]) + { + // Face will be marked, mark both owner and neighbour + markedCell[owner[faceI]] = true; + markedCell[neighbour[faceI]] = true; + } + } + + // Boundary faces + for (label faceI = nInternalFaces; faceI < nFaces; ++faceI) + { + if (markedFace[faceI]) + { + // Face will be markedd, mark owner + markedCell[owner[faceI]] = true; + } + } +} + + +void Foam::prismatic2DRefinement::extendMarkedCellsAcrossPoints +( + boolList& markedCell +) const +{ + // Mark all points for all marked cells + const label nPoints = mesh_.nPoints(); + boolList markedPoint(nPoints, false); + + // Get cell points + const labelListList& meshCellPoints = mesh_.cellPoints(); + + // Loop through all cells + forAll (markedCell, cellI) + { + if (markedCell[cellI]) + { + // This cell is marked, get its points + const labelList& cPoints = meshCellPoints[cellI]; + + forAll (cPoints, i) + { + markedPoint[cPoints[i]] = true; + } + } + } + + // Snyc point list across processor boundaries + syncTools::syncPointList + ( + mesh_, + markedPoint, + orEqOp(), + true, // Default value + true // Apply separation for parallel cyclics + ); + + // Get point cells + const labelListList& meshPointCells = mesh_.pointCells(); + + // Loop through all points + forAll (markedPoint, pointI) + { + if (markedPoint[pointI]) + { + // This point is marked, mark all of its cells + const labelList& pCells = meshPointCells[pointI]; + + forAll (pCells, i) + { + markedCell[pCells[i]] = true; + } + } + } +} + + +void Foam::prismatic2DRefinement::appendFaceSplitInfo +( + const label& faceI, + const boolList& edgeOnEmptyPatch, + const labelList& edgeMidPoint, + DynamicList