diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2018-04-08 21:10:05 -0500 |
---|---|---|
committer | scheibelp <scheibel1@llnl.gov> | 2018-05-17 14:10:30 -0700 |
commit | a4d276fbe4ec45c7ac4d9315d0f803a223096d18 (patch) | |
tree | 67c06d3d215054bbda67ec369be8add781e6a904 /lib/spack/spack/build_environment.py | |
parent | 74aee60f7d036907712b1196c6b73af5b4e43808 (diff) | |
download | spack-a4d276fbe4ec45c7ac4d9315d0f803a223096d18.tar.gz spack-a4d276fbe4ec45c7ac4d9315d0f803a223096d18.tar.bz2 spack-a4d276fbe4ec45c7ac4d9315d0f803a223096d18.tar.xz spack-a4d276fbe4ec45c7ac4d9315d0f803a223096d18.zip |
init: factor paths out of spack/__init__.py and into spack.paths module
Diffstat (limited to 'lib/spack/spack/build_environment.py')
-rw-r--r-- | lib/spack/spack/build_environment.py | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 2bb54ab680..fc7b12f8fd 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -63,9 +63,10 @@ from six import StringIO import llnl.util.tty as tty from llnl.util.tty.color import colorize -from llnl.util.filesystem import join_path, mkdirp, install, install_tree +from llnl.util.filesystem import mkdirp, install, install_tree -import spack +import spack.main +import spack.paths import spack.store from spack.environment import EnvironmentModifications, validate from spack.util.environment import env_flag, filter_system_paths, get_path @@ -138,21 +139,21 @@ def set_compiler_environment_variables(pkg, env): # and return it # TODO : add additional kwargs for better diagnostics, like requestor, # ttyout, ttyerr, etc. - link_dir = spack.build_env_path + link_dir = spack.paths.build_env_path # Set SPACK compiler variables so that our wrapper knows what to call if compiler.cc: env.set('SPACK_CC', compiler.cc) - env.set('CC', join_path(link_dir, compiler.link_paths['cc'])) + env.set('CC', os.path.join(link_dir, compiler.link_paths['cc'])) if compiler.cxx: env.set('SPACK_CXX', compiler.cxx) - env.set('CXX', join_path(link_dir, compiler.link_paths['cxx'])) + env.set('CXX', os.path.join(link_dir, compiler.link_paths['cxx'])) if compiler.f77: env.set('SPACK_F77', compiler.f77) - env.set('F77', join_path(link_dir, compiler.link_paths['f77'])) + env.set('F77', os.path.join(link_dir, compiler.link_paths['f77'])) if compiler.fc: env.set('SPACK_FC', compiler.fc) - env.set('FC', join_path(link_dir, compiler.link_paths['fc'])) + env.set('FC', os.path.join(link_dir, compiler.link_paths['fc'])) # Set SPACK compiler rpath flags so that our wrapper knows what to use env.set('SPACK_CC_RPATH_ARG', compiler.cc_rpath_arg) @@ -302,20 +303,21 @@ def set_build_environment_variables(pkg, env, dirty): env.prepend_path('PATH', bin_dir) # Add spack build environment path with compiler wrappers first in - # the path. We add both spack.env_path, which includes default + # the path. We add the compiler wrapper path, which includes default # wrappers (cc, c++, f77, f90), AND a subdirectory containing # compiler-specific symlinks. The latter ensures that builds that - # are sensitive to the *name* of the compiler see the right name - # when we're building with the wrappers. + # are sensitive to the *name* of the compiler see the right name when + # we're building with the wrappers. # # Conflicts on case-insensitive systems (like "CC" and "cc") are # handled by putting one in the <build_env_path>/case-insensitive # directory. Add that to the path too. env_paths = [] - compiler_specific = join_path(spack.build_env_path, pkg.compiler.name) - for item in [spack.build_env_path, compiler_specific]: + compiler_specific = os.path.join( + spack.paths.build_env_path, pkg.compiler.name) + for item in [spack.paths.build_env_path, compiler_specific]: env_paths.append(item) - ci = join_path(item, 'case-insensitive') + ci = os.path.join(item, 'case-insensitive') if os.path.isdir(ci): env_paths.append(ci) @@ -328,12 +330,12 @@ def set_build_environment_variables(pkg, env, dirty): env.set(SPACK_DEBUG, 'TRUE') env.set(SPACK_SHORT_SPEC, pkg.spec.short_spec) env.set(SPACK_DEBUG_LOG_ID, pkg.spec.format('${PACKAGE}-${HASH:7}')) - env.set(SPACK_DEBUG_LOG_DIR, spack.spack_working_dir) + env.set(SPACK_DEBUG_LOG_DIR, spack.main.spack_working_dir) # Add any pkgconfig directories to PKG_CONFIG_PATH for prefix in build_link_prefixes: for directory in ('lib', 'lib64', 'share'): - pcdir = join_path(prefix, directory, 'pkgconfig') + pcdir = os.path.join(prefix, directory, 'pkgconfig') if os.path.isdir(pcdir): env.prepend_path('PKG_CONFIG_PATH', pcdir) @@ -374,11 +376,11 @@ def set_module_variables_for_package(pkg, module): m.std_cmake_args = spack.CMakePackage._std_args(pkg) # Put spack compiler paths in module scope. - link_dir = spack.build_env_path - m.spack_cc = join_path(link_dir, pkg.compiler.link_paths['cc']) - m.spack_cxx = join_path(link_dir, pkg.compiler.link_paths['cxx']) - m.spack_f77 = join_path(link_dir, pkg.compiler.link_paths['f77']) - m.spack_fc = join_path(link_dir, pkg.compiler.link_paths['fc']) + link_dir = spack.paths.build_env_path + m.spack_cc = os.path.join(link_dir, pkg.compiler.link_paths['cc']) + m.spack_cxx = os.path.join(link_dir, pkg.compiler.link_paths['cxx']) + m.spack_f77 = os.path.join(link_dir, pkg.compiler.link_paths['f77']) + m.spack_fc = os.path.join(link_dir, pkg.compiler.link_paths['fc']) # Emulate some shell commands for convenience m.pwd = os.getcwd |