partial commit of cflags for debugging

This commit is contained in:
Gregory Becker 2015-10-02 16:12:51 -07:00
parent 42b5b7d2dd
commit 2d77173dfa
4 changed files with 43 additions and 12 deletions

39
lib/spack/env/cc vendored
View File

@ -89,31 +89,44 @@ done
command=$(basename "$0")
case "$command" in
cc|gcc|c89|c99|clang|xlc)
command="$SPACK_CC"
# command="$SPACK_CC $SPACK_CFLAGS"
command=("$SPACK_CC")
if [ "$SPACK_CFLAGS" ]; then
command+=("$SPACK_CFLAGS")
fi
language="C"
;;
c++|CC|g++|clang++|xlC)
command="$SPACK_CXX"
# command="$SPACK_CXX SPACK_CXXFLAGS"
command=("$SPACK_CXX")
if [ "$SPACK_CXXFLAGS" ]; then
command+=("$SPACK_CXXFLAGS")
fi
language="C++"
;;
f77|xlf)
command="$SPACK_F77"
# command="$SPACK_F77 $SPACK_FFLAGS"
command=("$SPACK_F77")
if [ "$SPACK_FFLAGS" ]; then
command+=("$SPACK_FFLAGS")
fi
language="Fortran 77"
;;
fc|f90|f95|xlf90)
command="$SPACK_FC"
# command="$SPACK_FC $SPACK_FFLAGS"
if [ "$SPACK_FFLAGS" ]; then
command+=("$SPACK_FFLAGS")
fi
language="Fortran 90"
;;
cpp)
mode=cpp
if [ "$SPACK_CPPFLAGS" ]; then
command+=("$SPACK_CPPFLAGS")
fi
;;
ld)
mode=ld
# command+=" $LDFLAGS"
if [ "$SPACK_LDFLAGS" ]; then
command+=("$SPACK_LDFLAGS")
fi
;;
*)
die "Unkown compiler: $command"
@ -123,7 +136,9 @@ esac
# Finish setting up the mode.
if [ -z "$mode" ]; then
mode=ccld
# command+=" $SPACK_LDFLAGS"
if [ "$SPACK_LDFLAGS" ]; then
command+=("$SPACK_LDFLAGS")
fi
for arg in "$@"; do
if [ "$arg" = -v -o "$arg" = -V -o "$arg" = --version -o "$arg" = -dumpversion ]; then
mode=vcheck
@ -324,7 +339,8 @@ for dir in "${env_path[@]}"; do
done
export PATH
full_command=("$command")
full_command=("${command[@]}")
#full_command+=("$SPACK_CFLAGS")
full_command+=("${args[@]}")
#
@ -337,4 +353,7 @@ if [ "$SPACK_DEBUG" = "TRUE" ]; then
echo "$mode ${full_command[@]}" >> $output_log
fi
echo "---------------------------" > /g/g0/becker33/cflag_test
echo "${full_command[@]}" >> /g/g0/becker33/cflag_test
echo "---------------------------" >> /g/g0/becker33/cflag_test
exec "${full_command[@]}"

View File

@ -104,7 +104,7 @@ def set_compiler_environment_variables(pkg):
if compiler.fc:
os.environ['SPACK_FC'] = compiler.fc
# Encorporate the compiler default flags into the set of flags
# Incorporate the compiler default flags into the set of flags
for flag in flags:
if flag in compiler.flags:
compiler.flags[flag] += ' '+flags[flag]

View File

@ -189,7 +189,9 @@ def concretize_compiler_flags(self, spec):
spec.compiler_flags = nearest.compiler_flags.copy()
except StopIteration:
return False
if spec.compiler_flags == spec.root.compiler_flags:
return False
spec.compiler_flags = spec.root.compiler_flags
return True # things changed.

View File

@ -1142,6 +1142,12 @@ def _merge_dependency(self, dep, visited, spec_deps, provider_index):
def _normalize_helper(self, visited, spec_deps, provider_index):
"""Recursive helper function for _normalize."""
print self,"self help"
# print
# from spack.graph import graph_ascii
# graph_ascii(self)
# print
print spec_deps
if self.name in visited:
return False
visited.add(self.name)
@ -1206,6 +1212,10 @@ def normalize(self, force=False):
visited = set()
any_change = self._normalize_helper(visited, spec_deps, index)
print self, "self norm"
print spec_deps
print visited
# If there are deps specified but not visited, they're not
# actually deps of this package. Raise an error.
extra = set(spec_deps.keys()).difference(visited)