summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/build_environment.py18
-rw-r--r--lib/spack/spack/cmd/find.py4
-rw-r--r--lib/spack/spack/compilers/__init__.py1
-rw-r--r--lib/spack/spack/concretize.py19
-rw-r--r--lib/spack/spack/database.py1
5 files changed, 13 insertions, 30 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index e456f11292..2c9feca8ae 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -32,11 +32,11 @@ import sys
import shutil
import multiprocessing
import platform
-from llnl.util.filesystem import *
-import spack
import llnl.util.tty as tty
from llnl.util.filesystem import *
+
+import spack
from spack.environment import EnvironmentModifications, validate
import spack.compilers as compilers
import spack.compiler as Compiler
@@ -99,16 +99,16 @@ def set_compiler_environment_variables(pkg, env):
flags = pkg.spec.compiler_flags
# Set compiler variables used by CMake and autotools
- assert all(key in pkg.compiler.link_paths for key in ('cc', 'cxx', 'f77', 'fc'))
+ assert all(key in compiler.link_paths for key in ('cc', 'cxx', 'f77', 'fc'))
# Populate an object with the list of environment modifications
# and return it
# TODO : add additional kwargs for better diagnostics, like requestor, ttyout, ttyerr, etc.
link_dir = spack.build_env_path
- env.set('CC', join_path(link_dir, pkg.compiler.link_paths['cc']))
- env.set('CXX', join_path(link_dir, pkg.compiler.link_paths['cxx']))
- env.set('F77', join_path(link_dir, pkg.compiler.link_paths['f77']))
- env.set('FC', join_path(link_dir, pkg.compiler.link_paths['fc']))
+ env.set('CC', join_path(link_dir, compiler.link_paths['cc']))
+ env.set('CXX', join_path(link_dir, compiler.link_paths['cxx']))
+ env.set('F77', join_path(link_dir, compiler.link_paths['f77']))
+ env.set('FC', join_path(link_dir, compiler.link_paths['fc']))
# Set SPACK compiler variables so that our wrapper knows what to call
if compiler.cc:
@@ -119,11 +119,11 @@ def set_compiler_environment_variables(pkg, env):
env.set('SPACK_F77', compiler.f77)
if compiler.fc:
env.set('SPACK_FC', compiler.fc)
- # Add every valid compiler flag to the environment, prefaced by "SPACK_"
+ # Add every valid compiler flag to the environment, prefixed with "SPACK_"
for flag in spack.spec.FlagMap.valid_compiler_flags():
# Concreteness guarantees key safety here
if flags[flag] != []:
- env.set('SPACK_'+flag.upper(), ' '.join(f for f in flags[flag]))
+ env.set('SPACK_' + flag.upper(), ' '.join(f for f in flags[flag]))
env.set('SPACK_COMPILER_SPEC', str(pkg.spec.compiler))
return env
diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py
index ef582a1680..b0e719c2db 100644
--- a/lib/spack/spack/cmd/find.py
+++ b/lib/spack/spack/cmd/find.py
@@ -93,10 +93,10 @@ def display_specs(specs, **kwargs):
hlen = None
nfmt = '.' if namespace else '_'
- format_string = '$%s$@$+' %nfmt
+ format_string = '$%s$@$+' % nfmt
flags = kwargs.get('show_flags', False)
if flags:
- format_string = '$.$@$%+$+' if nfmt == '.' else '$_$@$%+$+'
+ format_string = '$%s$@$%%+$+' % nfmt
# Make a dict with specs keyed by architecture and compiler.
index = index_by(specs, ('architecture', 'compiler'))
diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py
index d625949ceb..ca296d433f 100644
--- a/lib/spack/spack/compilers/__init__.py
+++ b/lib/spack/spack/compilers/__init__.py
@@ -39,7 +39,6 @@ import spack.config
import spack.architecture
from spack.util.multiproc import parmap
-import spack.compiler as Comp
from spack.compiler import Compiler
from spack.util.executable import which
from spack.util.naming import mod_to_class
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 6c0fda2d59..507052fe34 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -43,7 +43,6 @@ from functools import partial
from spec import DependencyMap
from itertools import chain
from spack.config import *
-import spack.compiler as Compiler
class DefaultConcretizer(object):
@@ -279,8 +278,6 @@ class DefaultConcretizer(object):
"""
ret = False
for flag in spack.spec.FlagMap.valid_compiler_flags():
-# if flag in spec.compiler_flags:
-# continue
try:
nearest = next(p for p in spec.traverse(direction='parents')
if ((p.compiler == spec.compiler and p is not spec)
@@ -317,7 +314,8 @@ class DefaultConcretizer(object):
if compiler.flags[flag] != []:
ret = True
else:
- if (sorted(spec.compiler_flags[flag]) != sorted(compiler.flags[flag])) and (not set(spec.compiler_flags[flag]) >= set(compiler.flags[flag])):
+ if ((sorted(spec.compiler_flags[flag]) != sorted(compiler.flags[flag])) and
+ (not set(spec.compiler_flags[flag]) >= set(compiler.flags[flag]))):
ret = True
spec.compiler_flags[flag] = list(set(spec.compiler_flags[flag]) |
set(compiler.flags[flag]))
@@ -325,19 +323,6 @@ class DefaultConcretizer(object):
return ret
-# def choose_provider(self, spec, providers):
-# """This is invoked for virtual specs. Given a spec with a virtual name,
-# say "mpi", and a list of specs of possible providers of that spec,
-# select a provider and return it.
-# """
-# assert(spec.virtual)
-# assert(providers)
-# index = spack.spec.index_specs(providers)
-# first_key = sorted(index.keys())[0]
-# latest_version = sorted(index[first_key])[-1]
-# return latest_version
-
-
def find_spec(spec, condition):
"""Searches the dag from spec in an intelligent order and looks
for a spec that matches a condition"""
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py
index ad4df980cd..dd3893514c 100644
--- a/lib/spack/spack/database.py
+++ b/lib/spack/spack/database.py
@@ -353,7 +353,6 @@ class Database(object):
temp_file = self._index_path + (
'.%s.%s.temp' % (socket.getfqdn(), os.getpid()))
-
# Write a temporary database file them move it into place
try:
with open(temp_file, 'w') as f: