Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{cae}[foss/2020b] OpenFOAM vv2112 #15731

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions easybuild/easyconfigs/o/OpenFOAM/OpenFOAM-v2112-cleanup.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Replaces OpenFOAM third-party libraries with EASYBUILD variants.
# Uses the OpenFOAM prefs mechanism and the FOAM_CONFIG_ETC variable
# to define the preferred settings without patching the original files
#
# Authors: Mark Olesen <Mark.Olesen@esi-group.com>
# -------------------------------------------------------------------------
--- /dev/null 2020-12-14 09:05:45.272769166 +0100
+++ OpenFOAM-v2112/etc/prefs.sh 2020-12-14 10:02:26.488430802 +0100
@@ -0,0 +1,7 @@
+##Easybuild## settings -*- sh -*-
+
+export FOAM_CONFIG_ETC="etc/easybuild"
+
+export WM_MPLIB=EASYBUILDMPI
+
+##Easybuild##
--- /dev/null 2020-12-14 09:05:45.272769166 +0100
+++ OpenFOAM-v2112/etc/easybuild/config.sh/CGAL 2020-12-14 10:10:55.991841204 +0100
@@ -0,0 +1,6 @@
+##Easybuild## settings -*- sh -*-
+
+export BOOST_ARCH_PATH="$EBROOTBOOST"
+export CGAL_ARCH_PATH="$EBROOTCGAL"
+
+##Easybuild##
--- /dev/null 2020-12-14 09:05:45.272769166 +0100
+++ OpenFOAM-v2112/etc/easybuild/config.sh/FFTW 2020-12-14 10:10:53.735843322 +0100
@@ -0,0 +1,5 @@
+##Easybuild## settings -*- sh -*-
+
+export FFTW_ARCH_PATH="$EBROOTFFTW"
+
+##EasyBuild##
--- /dev/null 2020-12-14 09:05:45.272769166 +0100
+++ OpenFOAM-v2112/etc/easybuild/config.sh/metis 2020-12-11 21:23:28.774934024 +0100
@@ -0,0 +1,6 @@
+##Easybuild## settings -*- sh -*-
+
+METIS_VERSION="metis-$EBVERSIONMETIS"
+[ -d "$METIS_ARCH_PATH" ] || METIS_ARCH_PATH="$METIS_ROOT"
+
+##Easybuild##
--- /dev/null 2020-12-14 09:05:45.272769166 +0100
+++ OpenFOAM-v2112/etc/easybuild/config.sh/readline 2020-12-11 21:23:22.534951043 +0100
@@ -0,0 +1,5 @@
+##Easybuild## settings -*- sh -*-
+
+export READLINE_ARCH_PATH="$EBROOTLIBREADLINE"
+
+##Easybuild##
--- /dev/null 2020-12-14 09:05:45.272769166 +0100
+++ OpenFOAM-v2112/etc/easybuild/config.sh/scotch 2020-12-11 21:23:17.586964539 +0100
@@ -0,0 +1,7 @@
+##Easybuild## settings -*- sh -*-
+
+export SCOTCH_VERSION="scotch_$EBVERSIONSCOTCH"
+export SCOTCH_ARCH_PATH="$EBROOTSCOTCH"
+[ -d "$SCOTCH_ARCH_PATH" ] || SCOTCH_ARCH_PATH="$SCOTCH_ROOT"
+
+##Easybuild##
--- /dev/null 2020-12-14 09:05:45.272769166 +0100
+++ OpenFOAM-v2112/etc/easybuild/config.sh/vtk 2020-12-11 21:22:55.463024882 +0100
@@ -0,0 +1,9 @@
+##Easybuild## settings -*- sh -*-
+
+export VTK_DIR="$EBROOTVTK"
+export MESA_ARCH_PATH="$EBROOTMESA"
+
+# Define paraview-mesa directory as required
+unset ParaView_MESA_DIR
+
+##Easybuild##
--- /dev/null 2020-12-14 09:05:45.272769166 +0100
+++ OpenFOAM-v2112/etc/easybuild/config.sh/paraview 2020-12-14 10:13:53.583674383 +0100
@@ -0,0 +1,75 @@
+##Easybuild## settings -*- sh -*-
+#
+# Largely a knockoff of the OpenFOAM etc/config.sh/paraview-system
+# readjusted for easybuild
+#
+# Copyright (C) 2020 OpenCFD Ltd.
+#
+#------------------------------------------------------------------------------
+# Compiler-specific location for ThirdParty installations
+archDir="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
+
+# Clean path and library path of previous settings
+eval \
+ "$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=PATH \
+ $ParaView_DIR $archDir/ParaView- $archDir/qt-)"
+
+eval \
+ "$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=LD_LIBRARY_PATH \
+ $ParaView_DIR $archDir/ParaView- $archDir/qt-)"
+
+
+#------------------------------------------------------------------------------
+
+##Easybuild## settings
+
+ParaView_VERSION="$EBVERSIONPARAVIEW"
+export ParaView_DIR="$EBROOTPARAVIEW"
+
+#------------------------------------------------------------------------------
+
+unset PV_PLUGIN_PATH
+
+# Set API to correspond to VERSION
+# pv_api is <digits>.<digits> from ParaView_VERSION
+#-
+# Extract API from VERSION
+pv_api=$(echo "$ParaView_VERSION" | \
+ sed -ne 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p')
+
+pv_plugin_dir="$FOAM_LIBBIN/paraview-$pv_api"
+
+# Set paths if binaries are present
+if [ -r "$ParaView_DIR" ]
+then
+ export PATH="$ParaView_DIR/bin:$PATH"
+
+ # ParaView libraries
+ # - 5.5 and later: lib/, but could also be lib64/
+ for libDir in lib64 lib
+ do
+ pvLibDir="$libDir/paraview-$pv_api"
+ if [ -d "$ParaView_DIR/$pvLibDir" ]
+ then
+ export LD_LIBRARY_PATH="$ParaView_DIR/$libDir:$LD_LIBRARY_PATH"
+ break
+ fi
+ done
+
+ # OpenFOAM plugin directory must be the first in PV_PLUGIN_PATH
+ # and have paraview-major.minor encoded in its name
+ if [ -d "$pv_plugin_dir" ]
+ then
+ export PV_PLUGIN_PATH="$pv_plugin_dir"
+ fi
+fi
+
+
+#------------------------------------------------------------------------------
+
+unset ParaView_VERSION
+
+unset archDir libDir
+unset pv_api pv_plugin_dir pvLibDir
+
+#------------------------------------------------------------------------------
47 changes: 47 additions & 0 deletions easybuild/easyconfigs/o/OpenFOAM/OpenFOAM-v2112-foss-2020b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
##
# Author: Robert Mijakovic <robert.mijakovic@lxp.lu>
##
# Modified by: Ben Langenberg <ben.langenberg@ufz.de>
##
name = 'OpenFOAM'
version = 'v2112'

homepage = 'https://www.openfoam.com/'
description = """OpenFOAM is a free, open source CFD software package.
OpenFOAM has an extensive range of features to solve anything from complex fluid flows
involving chemical reactions, turbulence and heat transfer,
to solid dynamics and electromagnetics."""

toolchain = {'name': 'foss', 'version': '2020b'}
toolchainopts = {'cstd': 'c++14', 'vectorize': False}
boegel marked this conversation as resolved.
Show resolved Hide resolved

source_urls = ['https://sourceforge.net/projects/openfoam/files/%(version)s/']
sources = [SOURCE_TGZ]
patches = [
('OpenFOAM-v2112-cleanup.patch', 1),
'OpenFOAM-v2112-wmake-ompi.patch',
]
checksums = [
'3e838731e79db1c288acc27aad8cc8a43d9dac1f24e5773e3b9fa91419a8c3f7', # OpenFOAM-v2112.tgz
'e883f628cb393b3ab60317304d7085d0a6ba7b8992feb12c2fab20389af34f1c', # OpenFOAM-v2112-cleanup.patch
'8cc2d9feac07b564abb4a16614f142a7c1aceedc4ad6ee02836e7d4f654410cd', # OpenFOAM-v2112-wmake-ompi.patch
]

builddependencies = [
('Bison', '3.7.1'),
('CMake', '3.18.4'),
('flex', '2.6.4'),
]

dependencies = [
('libreadline', '8.0'),
('ncurses', '6.2'),
# OpenFOAM requires 64 bit METIS using 32 bit indexes (array indexes)
('METIS', '5.1.0'),
('SCOTCH', '6.1.0'),
('CGAL', '5.2'),
('ParaView', '5.8.1', '-mpi'),
('gnuplot', '5.4.1'),
]

moduleclass = 'cae'
29 changes: 29 additions & 0 deletions easybuild/easyconfigs/o/OpenFOAM/OpenFOAM-v2112-wmake-ompi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# - Corrected output of "wmake -show-c" and "wmake -show-c++" with OpenMPI in order to allow compilation of paraFoam
#
# author: Jiri Furst <Jiri.Furst@gmail.com>
--- OpenFOAM-v2112/wmake/makefiles/info.orig 2019-11-07 18:12:53.000000000 +0100
+++ OpenFOAM-v2112/wmake/makefiles/info 2019-11-23 12:52:50.700688579 +0100
@@ -73,19 +73,19 @@

.PHONY: c
c:
- @echo "$(firstword $(cc))"
+ @echo "$(lastword $(cc))"

.PHONY: cxx
cxx:
- @echo "$(firstword $(CC))"
+ @echo "$(lastword $(CC))"

.PHONY: cflags
cflags:
- @echo "$(wordlist 2,$(words $(COMPILE_C)), $(COMPILE_C))"
+ @echo "$(wordlist 3,$(words $(COMPILE_C)), $(COMPILE_C))"

.PHONY: cxxflags
cxxflags:
- @echo "$(wordlist 2,$(words $(COMPILE_CXX)), $(COMPILE_CXX))"
+ @echo "$(wordlist 3,$(words $(COMPILE_CXX)), $(COMPILE_CXX))"

.PHONY: cflags-arch
cflags-arch: