targets: first pass at target detection for linux

Add llnl.util.cpu_name, with initial support for detecting different
microarchitectures on Linux.  This also adds preliminary changes for
compiler support and variants to control the optimizatoin levels by
target.

This does not yet include translations of targets to particular
compilers; that is left to another PR.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:
Gregory Becker
2017-02-09 14:48:55 -08:00
committed by Todd Gamblin
parent a940ff34d7
commit dfabf5d6b1
12 changed files with 349 additions and 16 deletions

4
lib/spack/env/cc vendored
View File

@@ -32,6 +32,7 @@ parameters=(
SPACK_CXX_RPATH_ARG
SPACK_F77_RPATH_ARG
SPACK_FC_RPATH_ARG
SPACK_TARGET_ARGS
SPACK_SHORT_SPEC
SPACK_SYSTEM_DIRS
)
@@ -78,7 +79,7 @@ function system_dir {
}
for param in "${parameters[@]}"; do
if [[ -z ${!param} ]]; then
if [[ -z ${!param+x} ]]; then
die "Spack compiler must be run from Spack! Input '$param' is missing."
fi
done
@@ -373,6 +374,7 @@ case "$mode" in
CXX)
flags=("${flags[@]}" "${SPACK_CXXFLAGS[@]}") ;;
esac
args=(${SPACK_TARGET_ARGS[@]} "${args[@]}")
;;
esac