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 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..93519fa98 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.1 + # + [ ! -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 # [ ! -z "$WM_THIRD_PARTY_USE_MVAPICH2_22" ] && { @@ -121,5 +130,3 @@ echo ======================================== echo # ----------------------------------------------------------------- end-of-file - - diff --git a/ThirdParty/AllMake.stage3 b/ThirdParty/AllMake.stage3 index 7f2aaabae..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 "" @@ -183,6 +190,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 "" @@ -191,6 +210,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/AllMake.stage4 b/ThirdParty/AllMake.stage4 index 9b79feead..aa84c82ad 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 "" @@ -124,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." @@ -172,5 +186,3 @@ echo ======================================== echo # ----------------------------------------------------------------- end-of-file - - 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..7d421de31 --- /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.5/ +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.5 + +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.5_plugins + +[ -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 + +# 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.5 + +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.5_plugins + +if ( -e \$PARAVIEW_BIN_DIR ) then + _foamAddPath \$PARAVIEW_BIN_DIR +endif + +if ( -e \$PARAVIEW_LIB_DIR/paraview-5.5 ) then + _foamAddLib \$PARAVIEW_LIB_DIR/paraview-5.5 +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/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/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/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/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/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec b/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.spec new file mode 100644 index 000000000..be52853b3 --- /dev/null +++ b/ThirdParty/rpmBuild/SPECS/openmpi-3.1.0.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.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 " 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/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/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/ThirdParty/tools/makeThirdPartyFunctionsForRPM b/ThirdParty/tools/makeThirdPartyFunctionsForRPM index 1fc376232..9430685b8 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 3600 \ + --retry 6 \ + --retry-delay 10 \ + --retry-max-time 60 \ + -L -k -O $_PACKAGE_URL ) fi fi @@ -284,22 +290,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 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/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 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/bashrc b/etc/bashrc index 2cfef00ca..bd56cf597 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -96,23 +96,23 @@ 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_311=1 # # For AllMake.stage3 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_064=1 -export WM_THIRD_PARTY_USE_HWLOC_1101=1 +export WM_THIRD_PARTY_USE_PYFOAM_069=1 +export WM_THIRD_PARTY_USE_HWLOC_201=1 # # For AllMake.stage4 -#export WM_THIRD_PARTY_USE_QT_486=1 -#export WM_THIRD_PARTY_USE_PARAVIEW_440=1 +#export WM_THIRD_PARTY_USE_QT_5111=1 +#export WM_THIRD_PARTY_USE_PARAVIEW_552=1 # Source files, possibly with some verbosity diff --git a/etc/cshrc b/etc/cshrc index 1d337f444..1214a2fd3 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -82,23 +82,23 @@ 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_311 1 # # For AllMake.stage3 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_064 1 -setenv WM_THIRD_PARTY_USE_HWLOC_1101 1 +setenv WM_THIRD_PARTY_USE_PYFOAM_069 1 +setenv WM_THIRD_PARTY_USE_HWLOC_201 1 # # For AllMake.stage4 -#setenv WM_THIRD_PARTY_USE_QT_486 1 -#setenv WM_THIRD_PARTY_USE_PARAVIEW_440 1 +#setenv WM_THIRD_PARTY_USE_QT_5111 1 +#setenv WM_THIRD_PARTY_USE_PARAVIEW_552 1 # Source files, possibly with some verbosity @@ -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..b7a3339af 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. @@ -199,11 +203,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_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 #setenv WM_THIRD_PARTY_USE_OPENMPI_165_ConfigureAdditionalArgs '--enable-mpi-cxx --with-openib' @@ -219,19 +225,20 @@ setenv WM_THIRD_PARTY_USE_OPENMPI_188 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 #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_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 # # For AllMake.stage4 -setenv WM_THIRD_PARTY_USE_QT_486 1 -setenv WM_THIRD_PARTY_USE_PARAVIEW_440 1 +setenv WM_THIRD_PARTY_USE_QT_511 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 4351e239c..a711257c7 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. @@ -211,12 +215,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_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 #export WM_THIRD_PARTY_USE_OPENMPI_165_ConfigureAdditionalArgs='--enable-mpi-cxx --with-openib' @@ -232,19 +238,20 @@ export WM_THIRD_PARTY_USE_OPENMPI_188=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 #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_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 # # For AllMake.stage4 -#export WM_THIRD_PARTY_USE_QT_580=1 -#export WM_THIRD_PARTY_USE_PARAVIEW_541=1 +#export WM_THIRD_PARTY_USE_QT_5111=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/prefs.sh.mingw b/etc/prefs.sh.mingw index 99e46fd58..4855ee194 100644 --- a/etc/prefs.sh.mingw +++ b/etc/prefs.sh.mingw @@ -224,18 +224,19 @@ 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 ##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 # # 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 5e9457ae4..778b1b6a3 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_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.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 + + 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 @@ -514,6 +522,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 # ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -559,6 +570,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 @@ -607,9 +621,18 @@ 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 # ~~~~~ +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 @@ -619,6 +642,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 @@ -628,6 +654,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 6e5778fd7..b4f03ae53 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_311 ] && [ -e $WM_THIRD_PARTY_DIR/packages/openmpi-3.1.1/platforms/$WM_OPTIONS ] + then + mpi_version=openmpi-3.1.1 + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + 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 + + 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" ] @@ -613,6 +622,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 @@ -662,6 +675,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 } @@ -718,6 +734,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 @@ -731,6 +753,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 } @@ -741,6 +766,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 } @@ -752,6 +781,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 } diff --git a/src/Allwmake b/src/Allwmake index 39ba00507..6ff5d803d 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -44,6 +44,9 @@ wmake libso lduSolvers wmake libso tetFiniteElement +# We can now compile this library from decompositionMethods +wmake libso decompositionMethods/decomposeReconstruct + # Make dynamicMesh tools dynamicMesh/AllwmakeLnInclude dynamicMesh/Allwmake diff --git a/src/ODE/sixDOF/sixDOFODE/constraints/translationalConstraints/periodicOscillation/periodicOscillation.C b/src/ODE/sixDOF/sixDOFODE/constraints/translationalConstraints/periodicOscillation/periodicOscillation.C index 4eee40b9e..fafbc66e9 100644 --- a/src/ODE/sixDOF/sixDOFODE/constraints/translationalConstraints/periodicOscillation/periodicOscillation.C +++ b/src/ODE/sixDOF/sixDOFODE/constraints/translationalConstraints/periodicOscillation/periodicOscillation.C @@ -131,7 +131,7 @@ void Foam::periodicOscillation::stabilise x -= (x & dir_)*dir_; // ... then add the correct displacement - x += dir_*sin(omega_*t + phi_); + x += dir_*a_*sin(omega_*t + phi_); // Set the velocity according to periodic oscillation @@ -140,7 +140,7 @@ void Foam::periodicOscillation::stabilise u -= (u & dir_)*dir_; // ... then add the correct velocity - u += dir_*cos(omega_*t + phi_); + u += dir_*a_*omega_*cos(omega_*t + phi_); } diff --git a/src/decompositionMethods/Allwmake b/src/decompositionMethods/Allwmake index 673719963..ddf3096ee 100755 --- a/src/decompositionMethods/Allwmake +++ b/src/decompositionMethods/Allwmake @@ -2,7 +2,8 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wmake libso decomposeReconstruct +# We need to recompile this library later, when all the dependencies are ready +#wmake libso decomposeReconstruct wmakeLnInclude decompositionMethods diff --git a/src/dynamicMesh/dynamicMesh/Make/files b/src/dynamicMesh/dynamicMesh/Make/files index ec3738647..c1ef188bb 100644 --- a/src/dynamicMesh/dynamicMesh/Make/files +++ b/src/dynamicMesh/dynamicMesh/Make/files @@ -37,8 +37,10 @@ $(slidingInterface)/decoupleSlidingInterface.C repatchCoverage = $(polyMeshModifiers)/repatchCoverage $(repatchCoverage)/repatchCoverage.C -polyhedralRefinement = $(polyMeshModifiers)/polyhedralRefinement -$(polyhedralRefinement)/polyhedralRefinement.C +refinement = $(polyMeshModifiers)/refinement +$(refinement)/refinement/refinement.C +$(refinement)/polyhedralRefinement/polyhedralRefinement.C +$(refinement)/prismatic2DRefinement/prismatic2DRefinement.C polyTopoChange/polyTopoChange/polyTopoChange.C polyTopoChange/polyTopoChange/actions/topoAction/topoActions.C diff --git a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/polyhedralRefinement/polyhedralRefinement.C b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/polyhedralRefinement/polyhedralRefinement.C similarity index 55% rename from src/dynamicMesh/dynamicMesh/polyMeshModifiers/polyhedralRefinement/polyhedralRefinement.C rename to src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/polyhedralRefinement/polyhedralRefinement.C index 697804f63..9264459dc 100644 --- a/src/dynamicMesh/dynamicMesh/polyMeshModifiers/polyhedralRefinement/polyhedralRefinement.C +++ b/src/dynamicMesh/dynamicMesh/polyMeshModifiers/refinement/polyhedralRefinement/polyhedralRefinement.C @@ -24,24 +24,12 @@ License Author Vuko Vukcevic, Wikki Ltd. All rights reserved. -Notes - Generalisation of hexRef8 for polyhedral cells and refactorisation into mesh - modifier engine. - \*---------------------------------------------------------------------------*/ #include "polyhedralRefinement.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 "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -91,1766 +79,6 @@ Foam::label Foam::polyhedralRefinement::getAnchorLevel } -void Foam::polyhedralRefinement::calcLevel0EdgeLength() -{ - if (cellLevel_.size() != mesh_.nCells()) - { - FatalErrorIn("scalar polyhedralRefinement::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); - - // 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]; - - 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; - } - } - } - - // 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); - } - } - - // 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<< "polyhedralRefinement::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 edge& e = meshEdges[cEdges[i]]; - const scalar edgeLenSqr = magSqr(e.vec(meshPoints)); - - maxEdgeLenSqr[cLevel] = max(maxEdgeLenSqr[cLevel], edgeLenSqr); - } - } - - // Get maximum per level over all processors - Pstream::listCombineGather(maxEdgeLenSqr, maxEqOp()); - Pstream::listCombineScatter(maxEdgeLenSqr); - - if (debug) - { - Pout<< "polyhedralRefinement::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<< "polyhedralRefinement::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<< "polyhedralRefinement::calcLevel0EdgeLength() :" - << "Edge length: " << Foam::sqrt(lenSqr) << ", " - << "with edge level: " << levelI << ", " - << "has equivalent level0 lenght of:" << level0EdgeLength_ - << endl; - } - - break; - } - } - - if (level0EdgeLength_ == -1) - { - FatalErrorIn("polyhedralRefinement::calcLevel0EdgeLength()") - << "Problem in definition of typical edge length squared: " - << typEdgeLenSqr << abort(FatalError); - } -} - - -void Foam::polyhedralRefinement::setInstance(const fileName& inst) const -{ - if (debug) - { - Pout<< "polyhedralRefinement::setInstance(const fileName& inst)" - << nl - << "Resetting file instance of refinement data to " << inst - << endl; - } - - cellLevel_.instance() = inst; - pointLevel_.instance() = inst; -} - - -void Foam::polyhedralRefinement::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::polyhedralRefinement::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::polyhedralRefinement::setPolyhedralRefinement -( - polyTopoChange& ref -) const -{ - // Note: assumes that cellsToRefine_ are set prior to the function call - - // Reset refinementLevelIndicator field. Note: the list is cleared in - // updateMesh member function after updating cell and point levels - if (refinementLevelIndicator_.empty()) - { - // List has been resetted correctly, initialise it for this iteration - refinementLevelIndicator_.setSize(mesh_.nCells(), UNCHANGED); - } - else - { - // List has not been resetted correctly, issue an error - FatalErrorIn - ( - "polyhedralRefinement::setPolyhedralRefinement(...)" - ) << "Refinement level indicator list has not been" - << " resetted properly." << nl - << "Either the call to updateMesh() after performing" - << " refinement has not been made or the call to" - << " setPolyhedralRefinement(...) and" - << " setPolyhedralUnrefinement(...) has not been made in" - << " correct order." << nl - << "Make sure to set refinement, set unrefinement and call" - << " updateMesh after performing the topo change." - << abort(FatalError); - } - - if (debug) - { - Pout<< "polyhedralRefinement::setPolyhedralRefinement(...)" << nl - << "Allocating " << cellsToRefine_.size() << " cell midpoints." - << endl; - } - - - // PART 1: Mark cells for refinement and add points at their cell centres - - // Get necessary mesh data - const faceList& meshFaces = mesh_.faces(); - const cellList& meshCells = mesh_.cells(); - const vectorField& meshCellCentres = mesh_.cellCentres(); - - // Mid point for refined cell (points at cell centres): - // Not refined = -1 - // Shall be refined > -1 (label of added mid point) - labelList cellMidPoint(mesh_.nCells(), -1); - - // Loop through cells to refine - forAll(cellsToRefine_, i) - { - // Get cell idnex - const label& cellI = cellsToRefine_[i]; - - cellMidPoint[cellI] = ref.setAction - ( - polyAddPoint - ( - meshCellCentres[cellI], // Point to add (cell centre) - -1, // Appended point: no master ID - -1, // Zone for point - true // Supports a cell - ) - ); - } - - // Write out split cells as a cell set for debug - if (debug) - { - // Note: cellSet is actually a hash table of labels - cellSet splitCells(mesh_, "splitCells", cellsToRefine_.size()); - - forAll(cellMidPoint, cellI) - { - if (cellMidPoint[cellI] > -1) - { - // Cell is marked for refinement, insert into cellSet - splitCells.insert(cellI); - } - } - - Pout<< "polyhedralRefinement::setPolyhedralRefinement(...)" << nl - << "Writing " << splitCells.size() - << " cells to split to cellSet " << splitCells.objectPath() - << endl; - - splitCells.write(); - } - - - // PART 2: Mark edges for refinement and add points to edge centres - - if (debug) - { - Pout<< "polyhedralRefinement::setPolyhedralRefinement(...)" << nl - << "Allocating edge midpoints." - << endl; - } - - // Refined edges are defined by having both their point levels lower than - // the cell level, i.e. if any cell that gets split uses this edge, the edge - // needs to be split as well - - // Get necessary mesh data - const labelListList& meshCellEdges = mesh_.cellEdges(); - const edgeList& meshEdges = mesh_.edges(); - - // Mid points for refined edge: - // No need to split edge = -1 - // Label of introduced mid point > -1 - labelList edgeMidPoint(mesh_.nEdges(), -1); - - // Note: Loop over all cells instead of all edges - forAll(cellMidPoint, cellI) - { - // Point is marked for refinement, proceed to look at the edges - if (cellMidPoint[cellI] > -1) - { - // Get edges of this cell - const labelList& cEdges = meshCellEdges[cellI]; - - forAll(cEdges, i) - { - // Get edge index and edge - const label& edgeI = cEdges[i]; - const edge& e = meshEdges[edgeI]; - - if - ( - pointLevel_[e[0]] <= cellLevel_[cellI] - && pointLevel_[e[1]] <= cellLevel_[cellI] - ) - { - // Point levels of both edge points are <= cell level, mark - // the edge for splitting - edgeMidPoint[edgeI] = 12345; - } - } - } - } - - // Synchronize edgeMidPoint across coupled patches. Note: use max so that - // any split takes precedence. - syncTools::syncEdgeList - ( - mesh_, - edgeMidPoint, - maxEqOp