Build older openfoam (#13071)

* adjust building of OpenFOAM 1806 and earlier

- spack now unpacks into spack-src, but earlier OpenFOAM versions
  still expect particular directory names (eg, OpenFOAM-v1806).

  Resolve by creating a symlink during patching.

* replace openfoam 1806 patch with URL version
This commit is contained in:
Mark Olesen 2019-10-09 03:42:44 +02:00 committed by Adam J. Stewart
parent 6a99b7e262
commit e3f69f8ce6
2 changed files with 18 additions and 19 deletions

View File

@ -1,17 +0,0 @@
--- OpenFOAM-v1806/wmake/scripts/have_kahip-ORIG 2018-06-28 16:39:32.000000000 +0200
+++ OpenFOAM-v1806/wmake/scripts/have_kahip 2018-08-11 13:37:18.250219013 +0200
@@ -83,10 +83,10 @@
# FOAM_EXT_LIBBIN is allowed to be unset
library=$(findFirstFile \
$FOAM_EXT_LIBBIN/$library \
- $METIS_ARCH_PATH/lib/$static \
- $METIS_ARCH_PATH/lib/$library \
- $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
- $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
+ $KAHIP_ARCH_PATH/lib/$static \
+ $KAHIP_ARCH_PATH/lib/$library \
+ $KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
+ $KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
)
elif isSystem "$KAHIP_ARCH_PATH"
then

View File

@ -337,7 +337,11 @@ class Openfoam(Package):
# Version-specific patches
patch('1612-spack-patches.patch', when='@1612')
patch('1806-have-kahip.patch', when='@1806')
# kahip patch (wmake)
patch('https://develop.openfoam.com/Development/OpenFOAM-plus/commit/4068c03c616a4964472e06d5fb5b9bc2dd0bf1b7.patch',
when='@1806',
sha256='21f1ab68c82dfa41ed1a4439427c94c43ddda02c84175c30da623d905d3e5d61'
)
# Some user config settings
# default: 'compile-option': 'RpathOpt',
@ -364,7 +368,7 @@ class Openfoam(Package):
#
def url_for_version(self, version):
# Prior to 'v1706' and additional '+' in the naming
# Prior to 1706 had additional '+' in the naming
fmt = self.list_url
if version <= Version('1612'):
fmt += 'v{0}+/OpenFOAM-v{0}+.tgz'
@ -481,6 +485,18 @@ def patch(self):
Where needed, apply filter as an alternative to normal patching."""
add_extra_files(self, self.common, self.assets)
# Prior to 1812, required OpenFOAM-v{VER} directory when sourcing
projdir = "OpenFOAM-v{0}".format(self.version)
if not os.path.exists(join_path(self.stage.path, projdir)):
tty.info('Added directory link {0}'.format(projdir))
os.symlink(
os.path.relpath(
self.stage.source_path,
self.stage.path
),
join_path(self.stage.path, projdir)
)
# Avoid WM_PROJECT_INST_DIR for ThirdParty
# This modification is non-critical
edits = {