Fix #254: libtool & distutils want certain compiler names.

This changes the compiler wrappers so that they are called by the same
name as the wrapped compiler.  Many builds make assumptions about
compiler names, and we need the spack compilers to be recognizable so
that build systems will get their flags right.

This adds per-compiler subdirectories to lib/spack/spack/env directory
that contain symlinks to cc for the C, C++, F77, and F90
compilers. The build now sets CC, CXX, F77, and F90 to point to these
links instead of to the generically named cc, c++, f77, and f90
wrappers.
This commit is contained in:
Todd Gamblin
2015-12-19 02:06:47 -08:00
parent 5f9a61616b
commit 7cc4d88726
23 changed files with 77 additions and 15 deletions

14
lib/spack/env/cc vendored
View File

@@ -86,22 +86,22 @@ done
#
command=$(basename "$0")
case "$command" in
cc|gcc|c89|c99|clang|xlc)
cc|c89|c99|gcc|clang|icc|pgcc|xlc)
command="$SPACK_CC"
language="C"
;;
c++|CC|g++|clang++|xlC)
c++|CC|g++|clang++|icpc|pgCC|xlc++)
command="$SPACK_CXX"
language="C++"
;;
f77|xlf)
command="$SPACK_F77"
language="Fortran 77"
;;
fc|f90|f95|xlf90)
f90|fc|f95|gfortran|ifort|pgf90|xlf90)
command="$SPACK_FC"
language="Fortran 90"
;;
f77|gfortran|ifort|pgf77|xlf)
command="$SPACK_F77"
language="Fortran 77"
;;
cpp)
mode=cpp
;;

1
lib/spack/env/clang/clang vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/clang/clang++ vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/gcc/g++ vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/gcc/gcc vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/gcc/gfortran vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/intel/icc vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/intel/icpc vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/intel/ifort vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/pgi/case-insensitive/pgCC vendored Symbolic link
View File

@@ -0,0 +1 @@
../../cc

1
lib/spack/env/pgi/pgcc vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/pgi/pgf77 vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/pgi/pgf90 vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/xl/xlc vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/xl/xlc++ vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/xl/xlf vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc

1
lib/spack/env/xl/xlf90 vendored Symbolic link
View File

@@ -0,0 +1 @@
../cc