示例#1
0
文件: arch.py 项目: LLNL/spack
def arch(parser, args):
    arch = architecture.Arch(
        architecture.platform(), 'default_os', 'default_target')

    if args.platform:
        print(arch.platform)
    elif args.operating_system:
        print(arch.platform_os)
    elif args.target:
        print(arch.target)
    else:
        print(arch)
示例#2
0
文件: package.py 项目: LLNL/spack
 def get_arch(self):
     arch = architecture.Arch()
     arch.platform = architecture.platform()
     return str(arch.platform.target('default_target'))
示例#3
0
def report(args):
    print('* **Spack:**', get_version())
    print('* **Python:**', platform.python_version())
    print('* **Platform:**',
          architecture.Arch(architecture.platform(), 'frontend', 'frontend'))
示例#4
0
 def get_arch(self):
     arch = architecture.Arch()
     arch.platform = architecture.platform()
     return str(arch.platform.target('default_target'))
示例#5
0
def clean_environment():
    # Stuff in here sanitizes the build environment to eliminate
    # anything the user has set that may interfere. We apply it immediately
    # unlike the other functions so it doesn't overwrite what the modules load.
    env = EnvironmentModifications()

    # Remove these vars from the environment during build because they
    # can affect how some packages find libraries.  We want to make
    # sure that builds never pull in unintended external dependencies.
    env.unset('LD_LIBRARY_PATH')
    env.unset('LIBRARY_PATH')
    env.unset('CPATH')
    env.unset('LD_RUN_PATH')
    env.unset('DYLD_LIBRARY_PATH')
    env.unset('DYLD_FALLBACK_LIBRARY_PATH')

    # On Cray "cluster" systems, unset CRAY_LD_LIBRARY_PATH to avoid
    # interference with Spack dependencies.
    # CNL requires these variables to be set (or at least some of them,
    # depending on the CNL version).
    hostarch = arch.Arch(arch.platform(), 'default_os', 'default_target')
    on_cray = str(hostarch.platform) == 'cray'
    using_cnl = re.match(r'cnl\d+', str(hostarch.os))
    if on_cray and not using_cnl:
        env.unset('CRAY_LD_LIBRARY_PATH')
        for varname in os.environ.keys():
            if 'PKGCONF' in varname:
                env.unset(varname)

    # Unset the following variables because they can affect installation of
    # Autotools and CMake packages.
    build_system_vars = [
        'CC',
        'CFLAGS',
        'CPP',
        'CPPFLAGS',  # C variables
        'CXX',
        'CCC',
        'CXXFLAGS',
        'CXXCPP',  # C++ variables
        'F77',
        'FFLAGS',
        'FLIBS',  # Fortran77 variables
        'FC',
        'FCFLAGS',
        'FCLIBS',  # Fortran variables
        'LDFLAGS',
        'LIBS'  # linker variables
    ]
    for v in build_system_vars:
        env.unset(v)

    # Unset mpi environment vars. These flags should only be set by
    # mpi providers for packages with mpi dependencies
    mpi_vars = ['MPICC', 'MPICXX', 'MPIFC', 'MPIF77', 'MPIF90']
    for v in mpi_vars:
        env.unset(v)

    build_lang = spack.config.get('config:build_language')
    if build_lang:
        # Override language-related variables. This can be used to force
        # English compiler messages etc., which allows parse_log_events to
        # show useful matches.
        env.set('LC_ALL', build_lang)

    # Remove any macports installs from the PATH.  The macports ld can
    # cause conflicts with the built-in linker on el capitan.  Solves
    # assembler issues, e.g.:
    #    suffix or operands invalid for `movq'"
    path = get_path('PATH')
    for p in path:
        if '/macports/' in p:
            env.remove_path('PATH', p)

    env.apply_modifications()
示例#6
0
def arch(parser, args):
    if args.platform:
        print(architecture.platform())
    else:
        print(architecture.sys_type())
示例#7
0
def arch(parser, args):
    if args.platform:
        print architecture.platform()
    else:
        print architecture.sys_type()
示例#8
0
文件: debug.py 项目: sidpbury/spack
def report(args):
    print('* **Spack:**', get_version())
    print('* **Python:**', platform.python_version())
    print('* **Platform:**', architecture.Arch(
        architecture.platform(), 'frontend', 'frontend'))
    print('* **Concretizer:**', spack.config.get('config:concretizer'))