summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/build_environment.py2
-rw-r--r--lib/spack/spack/compiler.py2
-rw-r--r--lib/spack/spack/compilers/clang.py10
-rw-r--r--lib/spack/spack/package.py4
-rw-r--r--var/spack/repos/builtin/packages/qt/package.py2
5 files changed, 15 insertions, 5 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 5e99d4552b..619877275d 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -224,7 +224,7 @@ def set_compiler_environment_variables(pkg, env):
for mod in compiler.modules:
load_module(mod)
- compiler.setup_custom_environment(env)
+ compiler.setup_custom_environment(pkg, env)
return env
diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py
index 0d9727c69e..92fa1ac4db 100644
--- a/lib/spack/spack/compiler.py
+++ b/lib/spack/spack/compiler.py
@@ -286,7 +286,7 @@ class Compiler(object):
"""
return path
- def setup_custom_environment(self, env):
+ def setup_custom_environment(self, pkg, env):
"""Set any environment variables necessary to use the compiler."""
pass
diff --git a/lib/spack/spack/compilers/clang.py b/lib/spack/spack/compilers/clang.py
index b2095defe5..14dc9d6476 100644
--- a/lib/spack/spack/compilers/clang.py
+++ b/lib/spack/spack/compilers/clang.py
@@ -148,7 +148,7 @@ class Clang(Compiler):
def f77_version(cls, f77):
return cls.fc_version(f77)
- def setup_custom_environment(self, env):
+ def setup_custom_environment(self, pkg, env):
"""Set the DEVELOPER_DIR environment for the Xcode toolchain.
On macOS, not all buildsystems support querying CC and CXX for the
@@ -160,9 +160,13 @@ class Clang(Compiler):
the 'DEVELOPER_DIR' environment variables to cause the xcrun and
related tools to use this Xcode.app.
"""
- super(Clang, self).setup_custom_environment(env)
+ super(Clang, self).setup_custom_environment(pkg, env)
- if not self.is_apple:
+ if not self.is_apple or not pkg.use_xcode:
+ # if we do it for all packages, we get into big troubles with MPI:
+ # filter_compilers(self) will use mockup XCode compilers on macOS
+ # with Clang. Those point to Spack's compiler wrappers and
+ # consequently render MPI non-functional outside of Spack.
return
xcode_select = Executable('xcode-select')
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 9c946844c6..31d08be456 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -487,6 +487,10 @@ class PackageBase(object):
"""By default do not run tests within package's install()"""
run_tests = False
+ # FIXME: this is a bad object-oriented design, should be moved to Clang.
+ """By default do not setup mockup XCode on macOS with Clang"""
+ use_xcode = False
+
"""Most packages are NOT extendable. Set to True if you want extensions."""
extendable = False
diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py
index 1db651c02b..6e6d4b95f6 100644
--- a/var/spack/repos/builtin/packages/qt/package.py
+++ b/var/spack/repos/builtin/packages/qt/package.py
@@ -92,6 +92,8 @@ class Qt(Package):
# depends_on("flac", when='+multimedia')
# depends_on("ogg", when='+multimedia')
+ use_xcode = True
+
def url_for_version(self, version):
# URL keeps getting more complicated with every release
url = self.list_url