Merge pull request #255 from LLNL/bugfix/254-libtool-compiler-name-issues
Fix #254: libtool & distutils want certain compiler names.
This commit is contained in:
commit
dccfcd10f7
14
lib/spack/env/cc
vendored
14
lib/spack/env/cc
vendored
@ -86,22 +86,22 @@ done
|
|||||||
#
|
#
|
||||||
command=$(basename "$0")
|
command=$(basename "$0")
|
||||||
case "$command" in
|
case "$command" in
|
||||||
cc|gcc|c89|c99|clang|xlc)
|
cc|c89|c99|gcc|clang|icc|pgcc|xlc)
|
||||||
command="$SPACK_CC"
|
command="$SPACK_CC"
|
||||||
language="C"
|
language="C"
|
||||||
;;
|
;;
|
||||||
c++|CC|g++|clang++|xlC)
|
c++|CC|g++|clang++|icpc|pgCC|xlc++)
|
||||||
command="$SPACK_CXX"
|
command="$SPACK_CXX"
|
||||||
language="C++"
|
language="C++"
|
||||||
;;
|
;;
|
||||||
f77|xlf)
|
f90|fc|f95|gfortran|ifort|pgf90|xlf90)
|
||||||
command="$SPACK_F77"
|
|
||||||
language="Fortran 77"
|
|
||||||
;;
|
|
||||||
fc|f90|f95|xlf90)
|
|
||||||
command="$SPACK_FC"
|
command="$SPACK_FC"
|
||||||
language="Fortran 90"
|
language="Fortran 90"
|
||||||
;;
|
;;
|
||||||
|
f77|gfortran|ifort|pgf77|xlf)
|
||||||
|
command="$SPACK_F77"
|
||||||
|
language="Fortran 77"
|
||||||
|
;;
|
||||||
cpp)
|
cpp)
|
||||||
mode=cpp
|
mode=cpp
|
||||||
;;
|
;;
|
||||||
|
1
lib/spack/env/clang/clang
vendored
Symbolic link
1
lib/spack/env/clang/clang
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/clang/clang++
vendored
Symbolic link
1
lib/spack/env/clang/clang++
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/gcc/g++
vendored
Symbolic link
1
lib/spack/env/gcc/g++
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/gcc/gcc
vendored
Symbolic link
1
lib/spack/env/gcc/gcc
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/gcc/gfortran
vendored
Symbolic link
1
lib/spack/env/gcc/gfortran
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/intel/icc
vendored
Symbolic link
1
lib/spack/env/intel/icc
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/intel/icpc
vendored
Symbolic link
1
lib/spack/env/intel/icpc
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/intel/ifort
vendored
Symbolic link
1
lib/spack/env/intel/ifort
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/pgi/case-insensitive/pgCC
vendored
Symbolic link
1
lib/spack/env/pgi/case-insensitive/pgCC
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../cc
|
1
lib/spack/env/pgi/pgcc
vendored
Symbolic link
1
lib/spack/env/pgi/pgcc
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/pgi/pgf77
vendored
Symbolic link
1
lib/spack/env/pgi/pgf77
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/pgi/pgf90
vendored
Symbolic link
1
lib/spack/env/pgi/pgf90
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/xl/xlc
vendored
Symbolic link
1
lib/spack/env/xl/xlc
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/xl/xlc++
vendored
Symbolic link
1
lib/spack/env/xl/xlc++
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/xl/xlf
vendored
Symbolic link
1
lib/spack/env/xl/xlf
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
1
lib/spack/env/xl/xlf90
vendored
Symbolic link
1
lib/spack/env/xl/xlf90
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
@ -88,10 +88,14 @@ def set_compiler_environment_variables(pkg):
|
|||||||
compiler = pkg.compiler
|
compiler = pkg.compiler
|
||||||
|
|
||||||
# Set compiler variables used by CMake and autotools
|
# Set compiler variables used by CMake and autotools
|
||||||
os.environ['CC'] = join_path(spack.build_env_path, 'cc')
|
assert all(key in pkg.compiler.link_paths
|
||||||
os.environ['CXX'] = join_path(spack.build_env_path, 'c++')
|
for key in ('cc', 'cxx', 'f77', 'fc'))
|
||||||
os.environ['F77'] = join_path(spack.build_env_path, 'f77')
|
|
||||||
os.environ['FC'] = join_path(spack.build_env_path, 'f90')
|
link_dir = spack.build_env_path
|
||||||
|
os.environ['CC'] = join_path(link_dir, pkg.compiler.link_paths['cc'])
|
||||||
|
os.environ['CXX'] = join_path(link_dir, pkg.compiler.link_paths['cxx'])
|
||||||
|
os.environ['F77'] = join_path(link_dir, pkg.compiler.link_paths['f77'])
|
||||||
|
os.environ['FC'] = join_path(link_dir, pkg.compiler.link_paths['fc'])
|
||||||
|
|
||||||
# Set SPACK compiler variables so that our wrapper knows what to call
|
# Set SPACK compiler variables so that our wrapper knows what to call
|
||||||
if compiler.cc:
|
if compiler.cc:
|
||||||
@ -110,11 +114,23 @@ def set_build_environment_variables(pkg):
|
|||||||
"""This ensures a clean install environment when we build packages.
|
"""This ensures a clean install environment when we build packages.
|
||||||
"""
|
"""
|
||||||
# Add spack build environment path with compiler wrappers first in
|
# Add spack build environment path with compiler wrappers first in
|
||||||
# the path. We handle case sensitivity conflicts like "CC" and
|
# the path. We add both spack.env_path, which includes default
|
||||||
# "cc" by putting one in the <build_env_path>/case-insensitive
|
# wrappers (cc, c++, f77, f90), AND a subdirectory containing
|
||||||
|
# compiler-specific symlinks. The latter ensures that builds that
|
||||||
|
# are sensitive to the *name* of the compiler see the right name
|
||||||
|
# when we're building wtih the wrappers.
|
||||||
|
#
|
||||||
|
# Conflicts on case-insensitive systems (like "CC" and "cc") are
|
||||||
|
# handled by putting one in the <build_env_path>/case-insensitive
|
||||||
# directory. Add that to the path too.
|
# directory. Add that to the path too.
|
||||||
env_paths = [spack.build_env_path,
|
env_paths = []
|
||||||
join_path(spack.build_env_path, 'case-insensitive')]
|
def add_env_path(path):
|
||||||
|
env_paths.append(path)
|
||||||
|
ci = join_path(path, 'case-insensitive')
|
||||||
|
if os.path.isdir(ci): env_paths.append(ci)
|
||||||
|
add_env_path(spack.build_env_path)
|
||||||
|
add_env_path(join_path(spack.build_env_path, pkg.compiler.name))
|
||||||
|
|
||||||
path_put_first("PATH", env_paths)
|
path_put_first("PATH", env_paths)
|
||||||
path_set(SPACK_ENV_PATH, env_paths)
|
path_set(SPACK_ENV_PATH, env_paths)
|
||||||
|
|
||||||
|
@ -37,6 +37,12 @@ class Clang(Compiler):
|
|||||||
# Subclasses use possible names of Fortran 90 compiler
|
# Subclasses use possible names of Fortran 90 compiler
|
||||||
fc_names = []
|
fc_names = []
|
||||||
|
|
||||||
|
# Named wrapper links within spack.build_env_path
|
||||||
|
link_paths = { 'cc' : 'clang/clang',
|
||||||
|
'cxx' : 'clang/clang++',
|
||||||
|
# Use default wrappers for fortran, in case provided in compilers.yaml
|
||||||
|
'f77' : 'f77',
|
||||||
|
'fc' : 'f90' }
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def default_version(self, comp):
|
def default_version(self, comp):
|
||||||
|
@ -42,6 +42,12 @@ class Gcc(Compiler):
|
|||||||
# MacPorts builds gcc versions with prefixes and -mp-X.Y suffixes.
|
# MacPorts builds gcc versions with prefixes and -mp-X.Y suffixes.
|
||||||
suffixes = [r'-mp-\d\.\d']
|
suffixes = [r'-mp-\d\.\d']
|
||||||
|
|
||||||
|
# Named wrapper links within spack.build_env_path
|
||||||
|
link_paths = {'cc' : 'gcc/gcc',
|
||||||
|
'cxx' : 'gcc/g++',
|
||||||
|
'f77' : 'gcc/gfortran',
|
||||||
|
'fc' : 'gcc/gfortran' }
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cxx11_flag(self):
|
def cxx11_flag(self):
|
||||||
if self.version < ver('4.3'):
|
if self.version < ver('4.3'):
|
||||||
|
@ -37,6 +37,12 @@ class Intel(Compiler):
|
|||||||
# Subclasses use possible names of Fortran 90 compiler
|
# Subclasses use possible names of Fortran 90 compiler
|
||||||
fc_names = ['ifort']
|
fc_names = ['ifort']
|
||||||
|
|
||||||
|
# Named wrapper links within spack.build_env_path
|
||||||
|
link_paths = { 'cc' : 'intel/icc',
|
||||||
|
'cxx' : 'intel/icpc',
|
||||||
|
'f77' : 'intel/ifort',
|
||||||
|
'fc' : 'intel/ifort' }
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cxx11_flag(self):
|
def cxx11_flag(self):
|
||||||
if self.version < ver('11.1'):
|
if self.version < ver('11.1'):
|
||||||
|
@ -37,6 +37,12 @@ class Pgi(Compiler):
|
|||||||
# Subclasses use possible names of Fortran 90 compiler
|
# Subclasses use possible names of Fortran 90 compiler
|
||||||
fc_names = ['pgf95', 'pgf90']
|
fc_names = ['pgf95', 'pgf90']
|
||||||
|
|
||||||
|
# Named wrapper links within spack.build_env_path
|
||||||
|
link_paths = { 'cc' : 'pgi/pgcc',
|
||||||
|
'cxx' : 'pgi/case-insensitive/pgCC',
|
||||||
|
'f77' : 'pgi/pgf77',
|
||||||
|
'fc' : 'pgi/pgf90' }
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def default_version(cls, comp):
|
def default_version(cls, comp):
|
||||||
"""The '-V' option works for all the PGI compilers.
|
"""The '-V' option works for all the PGI compilers.
|
||||||
|
@ -38,6 +38,12 @@ class Xl(Compiler):
|
|||||||
# Subclasses use possible names of Fortran 90 compiler
|
# Subclasses use possible names of Fortran 90 compiler
|
||||||
fc_names = ['xlf90','xlf90_r','xlf95','xlf95_r','xlf2003','xlf2003_r','xlf2008','xlf2008_r']
|
fc_names = ['xlf90','xlf90_r','xlf95','xlf95_r','xlf2003','xlf2003_r','xlf2008','xlf2008_r']
|
||||||
|
|
||||||
|
# Named wrapper links within spack.build_env_path
|
||||||
|
link_paths = { 'cc' : 'xl/xlc',
|
||||||
|
'cxx' : 'xl/xlc++',
|
||||||
|
'f77' : 'xl/xlf',
|
||||||
|
'fc' : 'xl/xlf90' }
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cxx11_flag(self):
|
def cxx11_flag(self):
|
||||||
if self.version < ver('13.1'):
|
if self.version < ver('13.1'):
|
||||||
|
Loading…
Reference in New Issue
Block a user