summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2019-07-20 15:40:36 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2019-07-20 13:40:36 -0700
commit7d954720ff5826fe1e4048472d603814718ce043 (patch)
treeaa10e8e0647f4f3d98779f72bcea31aed8a26130 /lib
parenta2cb26f5207fa907860ee350d631afdfb4580bbd (diff)
downloadspack-7d954720ff5826fe1e4048472d603814718ce043.tar.gz
spack-7d954720ff5826fe1e4048472d603814718ce043.tar.bz2
spack-7d954720ff5826fe1e4048472d603814718ce043.tar.xz
spack-7d954720ff5826fe1e4048472d603814718ce043.zip
Add OpenMP flag for Apple Clang (#12049)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/clang.py5
-rw-r--r--lib/spack/spack/test/compilers.py3
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/spack/spack/compilers/clang.py b/lib/spack/spack/compilers/clang.py
index 352e842412..e4b109588b 100644
--- a/lib/spack/spack/compilers/clang.py
+++ b/lib/spack/spack/compilers/clang.py
@@ -83,10 +83,7 @@ class Clang(Compiler):
@property
def openmp_flag(self):
if self.is_apple:
- raise UnsupportedCompilerFlag(self,
- "OpenMP",
- "openmp_flag",
- "Xcode {0}".format(self.version))
+ return "-Xpreprocessor -fopenmp"
else:
return "-fopenmp"
diff --git a/lib/spack/spack/test/compilers.py b/lib/spack/spack/test/compilers.py
index 84233d604f..00a0fab41c 100644
--- a/lib/spack/spack/test/compilers.py
+++ b/lib/spack/spack/test/compilers.py
@@ -219,7 +219,8 @@ def test_clang_flags():
supported_flag_test("pic_flag", "-fPIC", "gcc@4.0")
# Apple Clang.
- unsupported_flag_test("openmp_flag", "clang@2.0.0-apple")
+ supported_flag_test(
+ "openmp_flag", "-Xpreprocessor -fopenmp", "clang@2.0.0-apple")
unsupported_flag_test("cxx11_flag", "clang@2.0.0-apple")
supported_flag_test("cxx11_flag", "-std=c++11", "clang@4.0.0-apple")
unsupported_flag_test("cxx14_flag", "clang@5.0.0-apple")