partial commit to merge database

This commit is contained in:
Gregory Becker 2015-09-23 12:58:22 -07:00
parent 4ed22ad932
commit f9c8c4d216
3 changed files with 42 additions and 9 deletions

16
lib/spack/env/cc vendored
View file

@ -89,19 +89,23 @@ done
command=$(basename "$0") command=$(basename "$0")
case "$command" in case "$command" in
cc|gcc|c89|c99|clang|xlc) cc|gcc|c89|c99|clang|xlc)
command="$SPACK_CC $SPACK_CFLAGS" command="$SPACK_CC"
# command="$SPACK_CC $SPACK_CFLAGS"
language="C" language="C"
;; ;;
c++|CC|g++|clang++|xlC) c++|CC|g++|clang++|xlC)
command="$SPACK_CXX SPACK_CXXFLAGS" command="$SPACK_CXX"
# command="$SPACK_CXX SPACK_CXXFLAGS"
language="C++" language="C++"
;; ;;
f77|xlf) f77|xlf)
command="$SPACK_F77 $SPACK_FFLAGS" command="$SPACK_F77"
# command="$SPACK_F77 $SPACK_FFLAGS"
language="Fortran 77" language="Fortran 77"
;; ;;
fc|f90|f95|xlf90) fc|f90|f95|xlf90)
command="$SPACK_FC $SPACK_FFLAGS" command="$SPACK_FC"
# command="$SPACK_FC $SPACK_FFLAGS"
language="Fortran 90" language="Fortran 90"
;; ;;
cpp) cpp)
@ -109,7 +113,7 @@ case "$command" in
;; ;;
ld) ld)
mode=ld mode=ld
command+=" $LDFLAGS" # command+=" $LDFLAGS"
;; ;;
*) *)
die "Unkown compiler: $command" die "Unkown compiler: $command"
@ -119,7 +123,7 @@ esac
# Finish setting up the mode. # Finish setting up the mode.
if [ -z "$mode" ]; then if [ -z "$mode" ]; then
mode=ccld mode=ccld
command+=" $SPACK_LDFLAGS" # command+=" $SPACK_LDFLAGS"
for arg in "$@"; do for arg in "$@"; do
if [ "$arg" = -v -o "$arg" = -V -o "$arg" = --version -o "$arg" = -dumpversion ]; then if [ "$arg" = -v -o "$arg" = -V -o "$arg" = --version -o "$arg" = -dumpversion ]; then
mode=vcheck mode=vcheck

View file

@ -108,7 +108,7 @@ def set_compiler_environment_variables(pkg):
os.environ['SPACK_CFLAGS'] = compiler.cflags os.environ['SPACK_CFLAGS'] = compiler.cflags
if compiler.cxxflags: if compiler.cxxflags:
os.environ['SPACK_CXXFLAGS'] = compiler.cxxflags os.environ['SPACK_CXXFLAGS'] = compiler.cxxflags
if compiler.cflags: if compiler.fflags:
os.environ['SPACK_FFLAGS'] = compiler.fflags os.environ['SPACK_FFLAGS'] = compiler.fflags
if compiler.ldflags: if compiler.ldflags:
os.environ['SPACK_LDFLAGS'] = compiler.ldflags os.environ['SPACK_LDFLAGS'] = compiler.ldflags

View file

@ -1680,10 +1680,11 @@ def do_parse(self):
elif self.accept(DEP): elif self.accept(DEP):
if not specs: if not specs:
self.last_token_error("Dependency has no package") specs.append(self.empty_spec())
self.expect(ID) self.expect(ID)
specs[-1]._add_dependency(self.spec()) specs[-1]._add_dependency(self.spec())
for spec in specs:
print spec
else: else:
self.unexpected_token() self.unexpected_token()
except spack.parse.ParseError, e: except spack.parse.ParseError, e:
@ -1697,6 +1698,34 @@ def parse_compiler(self, text):
return self.compiler() return self.compiler()
def empty_spec(self):
"""Create a Null spec from which dependency constraints can be hung"""
spec = Spec.__new__(Spec)
spec.name = "any-pkg-name"
# spec.name = None
spec.versions = VersionList()
spec.variants = VariantMap(spec)
spec.architecture = None
spec.compiler = None
spec.dependents = DependencyMap()
spec.dependencies = DependencyMap()
#Should we be able to add cflags eventually?
while self.next:
if self.accept(ON):
spec._add_variant(self.variant(), True)
elif self.accept(OFF):
spec._add_variant(self.variant(), False)
elif self.accept(PCT):
spec._set_compiler(self.compiler())
else:
break
return spec
def spec(self): def spec(self):
"""Parse a spec out of the input. If a spec is supplied, then initialize """Parse a spec out of the input. If a spec is supplied, then initialize
and return it instead of creating a new one.""" and return it instead of creating a new one."""