diff options
author | Mario Melara <maamelara@gmail.com> | 2016-05-18 17:05:11 -0700 |
---|---|---|
committer | Mario Melara <maamelara@gmail.com> | 2016-05-18 17:05:11 -0700 |
commit | 9f8ff32bcce99c8a188f285e235e9c32ee245f97 (patch) | |
tree | 9f3fcdfe88d13aed2da165b31727d26e93fa65f8 /lib | |
parent | faa0f2a13c01a9f279d59912cff5d00c499cb990 (diff) | |
download | spack-9f8ff32bcce99c8a188f285e235e9c32ee245f97.tar.gz spack-9f8ff32bcce99c8a188f285e235e9c32ee245f97.tar.bz2 spack-9f8ff32bcce99c8a188f285e235e9c32ee245f97.tar.xz spack-9f8ff32bcce99c8a188f285e235e9c32ee245f97.zip |
Got rid of ifdefs, changed parameters for Compiler: added kwargs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/compiler.py | 65 |
1 files changed, 15 insertions, 50 deletions
diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index dfae72010a..ce4555bc56 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -101,7 +101,6 @@ class Compiler(object): def cxx_rpath_arg(self): return '-Wl,-rpath,' -#ifdef NEW @property def f77_rpath_arg(self): return '-Wl,-rpath,' @@ -109,32 +108,32 @@ class Compiler(object): @property def fc_rpath_arg(self): return '-Wl,-rpath,' -#else /* not NEW */ # Cray PrgEnv name that can be used to load this compiler PrgEnv = None - # Name of module used to switch versions of this compiler PrgEnv_compiler = None -#endif /* not NEW */ - -#ifdef NEW - - def __init__(self, cspec, cc, cxx, f77, fc, **kwargs): -#else /* not NEW */ - def __init__(self, cspec, operating_system, paths, modules=[], alias=None): -#endif /* not NEW */ + def __init__(self, cspec, operating_system, + paths, modules=[], alias=None, **kwargs): def check(exe): if exe is None: return None _verify_executables(exe) return exe -#ifdef NEW - self.cc = check(cc) - self.cxx = check(cxx) - self.f77 = check(f77) - self.fc = check(fc) + self.cc = check(paths[0]) + self.cxx = check(paths[1]) + if len(paths) > 2: + self.f77 = check(paths[2]) + if len(paths) == 3: + self.fc = self.f77 + else: + self.fc = check(paths[3]) + + #self.cc = check(cc) + #self.cxx = check(cxx) + #self.f77 = check(f77) + #self.fc = check(fc) # Unfortunately have to make sure these params are accepted # in the same order they are returned by sorted(flags) @@ -145,19 +144,7 @@ class Compiler(object): if value is not None: self.flags[flag] = value.split() -#else /* not NEW */ self.operating_system = operating_system - - self.cc = check(paths[0]) - self.cxx = check(paths[1]) - if len(paths) > 2: - self.f77 = check(paths[2]) - if len(paths) == 3: - self.fc = self.f77 - else: - self.fc = check(paths[3]) - -#endif /* not NEW */ self.spec = cspec self.modules = modules self.alias = alias @@ -287,28 +274,6 @@ class Compiler(object): successful.reverse() return dict(((v, p, s), path) for v, p, s, path in successful) - @classmethod - def default_version(cls, cc): - """Override just this to override all compiler version functions.""" - return dumpversion(cc) - - @classmethod - def cc_version(cls, cc): - return cls.default_version(cc) - - @classmethod - def cxx_version(cls, cxx): - return cls.default_version(cxx) - - @classmethod - def f77_version(cls, f77): - return cls.default_version(f77) - - @classmethod - def fc_version(cls, fc): - return cls.default_version(fc) - - def __repr__(self): """Return a string representation of the compiler toolchain.""" return self.__str__() |