summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorDenis Davydov <davydden@gmail.com>2017-03-29 22:24:18 +0300
committerAdam J. Stewart <ajstewart426@gmail.com>2017-03-29 14:24:18 -0500
commit782882c2a99815736bfd6ade56695fac499e4d67 (patch)
tree5cb9a1b96e68d14a2350e61267bcb712b06c71b3 /var
parent64a80ba822dc44fbf6535b614ef83aa9ed9b043f (diff)
downloadspack-782882c2a99815736bfd6ade56695fac499e4d67.tar.gz
spack-782882c2a99815736bfd6ade56695fac499e4d67.tar.bz2
spack-782882c2a99815736bfd6ade56695fac499e4d67.tar.xz
spack-782882c2a99815736bfd6ade56695fac499e4d67.zip
petsc: a workaround for macOS Clang 8.1.0 and XCode 8.3 (#3615)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/petsc/macos-clang-8.1.0.diff18
-rw-r--r--var/spack/repos/builtin/packages/petsc/package.py7
2 files changed, 25 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/petsc/macos-clang-8.1.0.diff b/var/spack/repos/builtin/packages/petsc/macos-clang-8.1.0.diff
new file mode 100644
index 0000000000..b4384d3ac3
--- /dev/null
+++ b/var/spack/repos/builtin/packages/petsc/macos-clang-8.1.0.diff
@@ -0,0 +1,18 @@
+diff --git a/config/BuildSystem/config/libraries.py b/config/BuildSystem/config/libraries.py
+index 0af92f0..8644b55 100644
+--- a/config/BuildSystem/config/libraries.py
++++ b/config/BuildSystem/config/libraries.py
+@@ -50,12 +50,7 @@ class Configure(config.base.Configure):
+ flagName = self.language[-1]+'SharedLinkerFlag'
+ flagSubst = self.language[-1].upper()+'_LINKER_SLFLAG'
+ dirname = os.path.dirname(library).replace('\\ ',' ').replace(' ', '\\ ').replace('\\(','(').replace('(', '\\(').replace('\\)',')').replace(')', '\\)')
+- if hasattr(self.setCompilers, flagName) and not getattr(self.setCompilers, flagName) is None:
+- return [getattr(self.setCompilers, flagName)+dirname,'-L'+dirname,'-l'+name]
+- if flagSubst in self.argDB:
+- return [self.argDB[flagSubst]+dirname,'-L'+dirname,'-l'+name]
+- else:
+- return ['-L'+dirname,' -l'+name]
++ return ['-L'+dirname,' -l'+name]
+ else:
+ return ['-l'+name]
+ if os.path.splitext(library)[1] == '.so':
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py
index 3e670cba63..b63172135e 100644
--- a/var/spack/repos/builtin/packages/petsc/package.py
+++ b/var/spack/repos/builtin/packages/petsc/package.py
@@ -74,6 +74,13 @@ class Petsc(Package):
variant('int64', default=False,
description='Compile with 64bit indices')
+ # temporary workaround Clang 8.1.0 with XCode 8.3 on macOS, see
+ # https://bitbucket.org/petsc/petsc/commits/4f290403fdd060d09d5cb07345cbfd52670e3cbc
+ # the patch is an adaptation of the original commit to 3.7.5
+ if sys.platform == "darwin":
+ patch('macos-clang-8.1.0.diff',
+ when='@3.7.5%clang@8.1.0:')
+
# Virtual dependencies
# Git repository needs sowing to build Fortran interface
depends_on('sowing', when='@develop')