summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-08-20 17:42:18 +0200
committerGitHub <noreply@github.com>2020-08-20 17:42:18 +0200
commit573ce3fe81b1a11443dc678b3e225e7959943604 (patch)
tree19e7fc7dcd77a79ef5c4ba798e08d4f9dbb6d629
parent1addcff7240deecb3dca992cd5e45a40d02eb92d (diff)
downloadspack-573ce3fe81b1a11443dc678b3e225e7959943604.tar.gz
spack-573ce3fe81b1a11443dc678b3e225e7959943604.tar.bz2
spack-573ce3fe81b1a11443dc678b3e225e7959943604.tar.xz
spack-573ce3fe81b1a11443dc678b3e225e7959943604.zip
gcc: fixed compilation on OpenSUSE (#18190)
Set location for dependencies specifying explicitly both the include and lib path. This permits to handle cases where the libraries are installed in lib64 instead of lib. fixes #17556 fixes #10842 closes #18150
-rw-r--r--var/spack/repos/builtin/packages/gcc/package.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py
index a5ceb46046..991f0fadb0 100644
--- a/var/spack/repos/builtin/packages/gcc/package.py
+++ b/var/spack/repos/builtin/packages/gcc/package.py
@@ -451,9 +451,7 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
'--enable-languages={0}'.format(
','.join(spec.variants['languages'].value)),
# Drop gettext dependency
- '--disable-nls',
- '--with-mpfr={0}'.format(spec['mpfr'].prefix),
- '--with-gmp={0}'.format(spec['gmp'].prefix),
+ '--disable-nls'
]
# Use installed libz
@@ -483,13 +481,23 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
'--enable-bootstrap',
])
- # MPC
- if 'mpc' in spec:
- options.append('--with-mpc={0}'.format(spec['mpc'].prefix))
+ # Configure include and lib directories explicitly for these
+ # dependencies since the short GCC option assumes that libraries
+ # are installed in "/lib" which might not be true on all OS
+ # (see #10842)
+ #
+ # More info at: https://gcc.gnu.org/install/configure.html
+ for dep_str in ('mpfr', 'gmp', 'mpc', 'isl'):
+ if dep_str not in spec:
+ continue
- # ISL
- if 'isl' in spec:
- options.append('--with-isl={0}'.format(spec['isl'].prefix))
+ dep_spec = spec[dep_str]
+ include_dir = dep_spec.headers.directories[0]
+ lib_dir = dep_spec.libs.directories[0]
+ options.extend([
+ '--with-{0}-include={1}'.format(dep_str, include_dir),
+ '--with-{0}-lib={1}'.format(dep_str, lib_dir)
+ ])
# nvptx-none offloading for host compiler
if spec.satisfies('+nvptx'):