From 7b517916254ec1a6a4f6e09de3e861145c17d8a1 Mon Sep 17 00:00:00 2001 From: Brian Van Essen Date: Tue, 15 Aug 2017 14:57:11 -0700 Subject: [PATCH] Openblas clang fix (#5065) * Added a package for the MDAnalysis toolkit. * Openblas now builds with clang when using 0.2.20 * Fixed flake8 error * Added a guard to fail for openblas+openmp when on OSX systems * Changed the guard to look for Apple's build of clang and to improve the error messages. * Removed blank line. --- .../repos/builtin/packages/openblas/package.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 7fe07a283e..73b89fcd23 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -84,12 +84,15 @@ def check_compilers(self): 'OpenBLAS requires both C and Fortran compilers!' ) # Add support for OpenMP - if '+openmp' in self.spec and self.spec.satisfies('%clang'): - # Openblas (as of 0.2.18) hardcoded that OpenMP cannot - # be used with any (!) compiler named clang, bummer. - raise InstallError( - 'OpenBLAS does not support OpenMP with clang!' - ) + if (('+openmp' in self.spec) and self.spec.satisfies('%clang')): + if str(self.spec.compiler.version).endswith('-apple'): + raise InstallError("Apple's clang does not support OpenMP") + if '@:0.2.19' in self.spec: + # Openblas (as of 0.2.19) hardcoded that OpenMP cannot + # be used with any (!) compiler named clang, bummer. + raise InstallError( + 'OpenBLAS @:0.2.19 does not support OpenMP with clang!' + ) @property def make_defs(self):