summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelly (KT) Thompson <KineticTheory@users.noreply.github.com>2019-10-28 16:31:23 -0600
committerAdam J. Stewart <ajstewart426@gmail.com>2019-10-28 17:31:23 -0500
commitffb4e02a53760dff03cccadd27f1f199c8303a2a (patch)
tree8eab5753103edff65fbfb9b0c07dd4a80fcd9c08
parent8786cb468a357edcb94905eb70e155885e641c9a (diff)
downloadspack-ffb4e02a53760dff03cccadd27f1f199c8303a2a.tar.gz
spack-ffb4e02a53760dff03cccadd27f1f199c8303a2a.tar.bz2
spack-ffb4e02a53760dff03cccadd27f1f199c8303a2a.tar.xz
spack-ffb4e02a53760dff03cccadd27f1f199c8303a2a.zip
Fix gcc recipe for RHEL7. (#13460)
* Fix gcc recipe for RHEL7. + It appears that macOS related changes to the gcc recipe broke gcc on RHEL7. This bug manifests as `libstdc++.so: undefined reference to libiconv` when gcc is used. + Fixes #13452 by moving `--with-libiconv-prefix={0}'.format(spec['libiconv'].prefix)` into the darwin OS section of the configuration. + Change qualification of `depends_on(libiconv)` to limit dependency to macOS. * Replace deprecated 'setup_environment' with 'setup_run_environment'. * Fix cut and paste error. * Rename 'run_env' to just 'env'.
-rw-r--r--var/spack/repos/builtin/packages/gcc/package.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py
index 836c018604..e42d977698 100644
--- a/var/spack/repos/builtin/packages/gcc/package.py
+++ b/var/spack/repos/builtin/packages/gcc/package.py
@@ -100,7 +100,7 @@ class Gcc(AutotoolsPackage):
depends_on('isl@0.15:0.18', when='@6:8.9')
depends_on('isl@0.15:0.20', when='@9:')
depends_on('zlib', when='@6:')
- depends_on('libiconv')
+ depends_on('libiconv', when='platform=darwin')
depends_on('gnat', when='languages=ada')
depends_on('binutils~libiberty', when='+binutils')
depends_on('zip', type='build', when='languages=java')
@@ -279,7 +279,6 @@ class Gcc(AutotoolsPackage):
','.join(spec.variants['languages'].value)),
# Drop gettext dependency
'--disable-nls',
- '--with-libiconv-prefix={0}'.format(spec['libiconv'].prefix),
'--with-mpfr={0}'.format(spec['mpfr'].prefix),
'--with-gmp={0}'.format(spec['gmp'].prefix),
]
@@ -328,7 +327,8 @@ class Gcc(AutotoolsPackage):
if sys.platform == 'darwin':
options.extend([
'--with-native-system-header-dir=/usr/include',
- '--with-sysroot={0}'.format(macos_sdk_path())
+ '--with-sysroot={0}'.format(macos_sdk_path()),
+ '--with-libiconv-prefix={0}'.format(spec['libiconv'].prefix)
])
return options
@@ -424,7 +424,7 @@ class Gcc(AutotoolsPackage):
self.prefix.lib, self.prefix.lib64))
set_install_permissions(specs_file)
- def setup_environment(self, spack_env, run_env):
+ def setup_run_environment(self, env):
# Search prefix directory for possibly modified compiler names
from spack.compilers.gcc import Gcc as Compiler
@@ -450,6 +450,6 @@ class Gcc(AutotoolsPackage):
continue
# Set the proper environment variable
- run_env.set(lang.upper(), abspath)
+ env.set(lang.upper(), abspath)
# Stop searching filename/regex combos for this language
break