summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDenis Davydov <davydden@gmail.com>2016-12-11 01:23:39 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2016-12-10 16:23:39 -0800
commit1570f90fde7a3c6623a1635bbe68f6a028369bf9 (patch)
tree85043ff4eb3be941a29147a02fe29471e6121d5d /lib
parentb03881d1bb30d03d81481bb90df5b29b185b1511 (diff)
downloadspack-1570f90fde7a3c6623a1635bbe68f6a028369bf9.tar.gz
spack-1570f90fde7a3c6623a1635bbe68f6a028369bf9.tar.bz2
spack-1570f90fde7a3c6623a1635bbe68f6a028369bf9.tar.xz
spack-1570f90fde7a3c6623a1635bbe68f6a028369bf9.zip
clang: do xcode mockup iff requested by a package (#2544)
* clang: do xcode mockup iff requested by a package * add a note * add pkg to setup_custom_environment() and decide whether or not to use mockup XCode there based on the package
Diffstat (limited to 'lib')
-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
4 files changed, 13 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