Merge branch 'develop' into packages/elpa
This commit is contained in:
commit
a8132470e4
4
lib/spack/env/cc
vendored
4
lib/spack/env/cc
vendored
@ -94,11 +94,11 @@ case "$command" in
|
|||||||
command="$SPACK_CXX"
|
command="$SPACK_CXX"
|
||||||
language="C++"
|
language="C++"
|
||||||
;;
|
;;
|
||||||
f90|fc|f95|gfortran|ifort|pgf90|xlf90)
|
f90|fc|f95|gfortran|ifort|pgf90|xlf90|nagfor)
|
||||||
command="$SPACK_FC"
|
command="$SPACK_FC"
|
||||||
language="Fortran 90"
|
language="Fortran 90"
|
||||||
;;
|
;;
|
||||||
f77|gfortran|ifort|pgf77|xlf)
|
f77|gfortran|ifort|pgf77|xlf|nagfor)
|
||||||
command="$SPACK_F77"
|
command="$SPACK_F77"
|
||||||
language="Fortran 77"
|
language="Fortran 77"
|
||||||
;;
|
;;
|
||||||
|
1
lib/spack/env/nag/nagfor
vendored
Symbolic link
1
lib/spack/env/nag/nagfor
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../cc
|
@ -32,7 +32,7 @@
|
|||||||
import spack
|
import spack
|
||||||
import spack.cmd
|
import spack.cmd
|
||||||
|
|
||||||
description="Print out locations of various diectories used by Spack"
|
description="Print out locations of various directories used by Spack"
|
||||||
|
|
||||||
def setup_parser(subparser):
|
def setup_parser(subparser):
|
||||||
global directories
|
global directories
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
import itertools
|
import itertools
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ def _verify_executables(*paths):
|
|||||||
def get_compiler_version(compiler_path, version_arg, regex='(.*)'):
|
def get_compiler_version(compiler_path, version_arg, regex='(.*)'):
|
||||||
if not compiler_path in _version_cache:
|
if not compiler_path in _version_cache:
|
||||||
compiler = Executable(compiler_path)
|
compiler = Executable(compiler_path)
|
||||||
output = compiler(version_arg, return_output=True, error=os.devnull)
|
output = compiler(version_arg, return_output=True, error=subprocess.STDOUT)
|
||||||
|
|
||||||
match = re.search(regex, output)
|
match = re.search(regex, output)
|
||||||
_version_cache[compiler_path] = match.group(1) if match else 'unknown'
|
_version_cache[compiler_path] = match.group(1) if match else 'unknown'
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
if platform.system() == 'Darwin':
|
if platform.system() == 'Darwin':
|
||||||
_default_order = ['clang', 'gcc', 'intel']
|
_default_order = ['clang', 'gcc', 'intel']
|
||||||
else:
|
else:
|
||||||
_default_order = ['gcc', 'intel', 'pgi', 'clang', 'xlc']
|
_default_order = ['gcc', 'intel', 'pgi', 'clang', 'xlc', 'nag']
|
||||||
|
|
||||||
|
|
||||||
def _auto_compiler_spec(function):
|
def _auto_compiler_spec(function):
|
||||||
|
33
lib/spack/spack/compilers/nag.py
Normal file
33
lib/spack/spack/compilers/nag.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
from spack.compiler import *
|
||||||
|
|
||||||
|
class Nag(Compiler):
|
||||||
|
# Subclasses use possible names of C compiler
|
||||||
|
cc_names = []
|
||||||
|
|
||||||
|
# Subclasses use possible names of C++ compiler
|
||||||
|
cxx_names = []
|
||||||
|
|
||||||
|
# Subclasses use possible names of Fortran 77 compiler
|
||||||
|
f77_names = ['nagfor']
|
||||||
|
|
||||||
|
# Subclasses use possible names of Fortran 90 compiler
|
||||||
|
fc_names = ['nagfor']
|
||||||
|
|
||||||
|
# Named wrapper links within spack.build_env_path
|
||||||
|
link_paths = { # Use default wrappers for C and C++, in case provided in compilers.yaml
|
||||||
|
'cc' : 'cc',
|
||||||
|
'cxx' : 'cxx',
|
||||||
|
'f77' : 'nag/nagfor',
|
||||||
|
'fc' : 'nag/nagfor' }
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def default_version(self, comp):
|
||||||
|
"""The '-V' option works for nag compilers.
|
||||||
|
Output looks like this::
|
||||||
|
|
||||||
|
NAG Fortran Compiler Release 6.0(Hibiya) Build 1037
|
||||||
|
Product NPL6A60NA for x86-64 Linux
|
||||||
|
Copyright 1990-2015 The Numerical Algorithms Group Ltd., Oxford, U.K.
|
||||||
|
"""
|
||||||
|
return get_compiler_version(
|
||||||
|
comp, '-V', r'NAG Fortran Compiler Release ([0-9.]+)')
|
@ -1,5 +1,31 @@
|
|||||||
|
##############################################################################
|
||||||
|
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
|
||||||
|
# Produced at the Lawrence Livermore National Laboratory.
|
||||||
|
#
|
||||||
|
# This file is part of Spack.
|
||||||
|
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
|
||||||
|
# LLNL-CODE-647188
|
||||||
|
#
|
||||||
|
# For details, see https://github.com/llnl/spack
|
||||||
|
# Please also see the LICENSE file for our notice and the LGPL.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License (as published by
|
||||||
|
# the Free Software Foundation) version 2.1 dated February 1999.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but
|
||||||
|
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
|
||||||
|
# conditions of the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Hdf5(Package):
|
class Hdf5(Package):
|
||||||
"""HDF5 is a data model, library, and file format for storing and managing
|
"""HDF5 is a data model, library, and file format for storing and managing
|
||||||
data. It supports an unlimited variety of datatypes, and is designed for
|
data. It supports an unlimited variety of datatypes, and is designed for
|
||||||
@ -15,26 +41,53 @@ class Hdf5(Package):
|
|||||||
version('1.8.15', '03cccb5b33dbe975fdcd8ae9dc021f24')
|
version('1.8.15', '03cccb5b33dbe975fdcd8ae9dc021f24')
|
||||||
version('1.8.13', 'c03426e9e77d7766944654280b467289')
|
version('1.8.13', 'c03426e9e77d7766944654280b467289')
|
||||||
|
|
||||||
|
variant('debug', default=False, description='Builds a debug version of the library')
|
||||||
|
|
||||||
variant('cxx', default=True, description='Enable C++ support')
|
variant('cxx', default=True, description='Enable C++ support')
|
||||||
variant('fortran', default=True, description='Enable Fortran support')
|
variant('fortran', default=True, description='Enable Fortran support')
|
||||||
|
variant('unsupported', default=False, description='Enables unsupported configuration options')
|
||||||
|
|
||||||
variant('mpi', default=False, description='Enable MPI support')
|
variant('mpi', default=False, description='Enable MPI support')
|
||||||
variant('threadsafe', default=False, description='Enable multithreading')
|
variant('threadsafe', default=False, description='Enable thread-safe capabilities')
|
||||||
|
|
||||||
depends_on("mpi", when='+mpi')
|
depends_on("mpi", when='+mpi')
|
||||||
depends_on("zlib")
|
depends_on("zlib")
|
||||||
|
|
||||||
# TODO: currently hard-coded to use OpenMPI
|
def validate(self, spec):
|
||||||
|
"""
|
||||||
|
Checks if incompatible variants have been activated at the same time
|
||||||
|
|
||||||
|
:param spec: spec of the package
|
||||||
|
:raises RuntimeError: in case of inconsistencies
|
||||||
|
"""
|
||||||
|
if '+fortran' in spec and not self.compiler.fc:
|
||||||
|
msg = 'cannot build a fortran variant without a fortran compiler'
|
||||||
|
raise RuntimeError(msg)
|
||||||
|
|
||||||
|
if '+threadsafe' in spec and ('+cxx' in spec or '+fortran' in spec):
|
||||||
|
raise RuntimeError("cannot use variant +threadsafe with either +cxx or +fortran")
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
|
self.validate(spec)
|
||||||
|
# Handle compilation after spec validation
|
||||||
extra_args = []
|
extra_args = []
|
||||||
|
if '+debug' in spec:
|
||||||
|
extra_args.append('--enable-debug=all')
|
||||||
|
else:
|
||||||
|
extra_args.append('--enable-production')
|
||||||
|
|
||||||
|
if '+unsupported' in spec:
|
||||||
|
extra_args.append("--enable-unsupported")
|
||||||
|
|
||||||
if '+cxx' in spec:
|
if '+cxx' in spec:
|
||||||
extra_args.extend([
|
extra_args.append('--enable-cxx')
|
||||||
'--enable-cxx'
|
|
||||||
])
|
|
||||||
if '+fortran' in spec:
|
if '+fortran' in spec:
|
||||||
extra_args.extend([
|
extra_args.extend([
|
||||||
'--enable-fortran',
|
'--enable-fortran',
|
||||||
'--enable-fortran2003'
|
'--enable-fortran2003'
|
||||||
])
|
])
|
||||||
|
|
||||||
if '+mpi' in spec:
|
if '+mpi' in spec:
|
||||||
# The HDF5 configure script warns if cxx and mpi are enabled
|
# The HDF5 configure script warns if cxx and mpi are enabled
|
||||||
# together. There doesn't seem to be a real reason for this, except
|
# together. There doesn't seem to be a real reason for this, except
|
||||||
@ -43,27 +96,26 @@ def install(self, spec, prefix):
|
|||||||
# this is not actually a problem.
|
# this is not actually a problem.
|
||||||
extra_args.extend([
|
extra_args.extend([
|
||||||
"--enable-parallel",
|
"--enable-parallel",
|
||||||
"--enable-unsupported",
|
|
||||||
"CC=%s" % spec['mpi'].prefix.bin + "/mpicc",
|
"CC=%s" % spec['mpi'].prefix.bin + "/mpicc",
|
||||||
"CXX=%s" % spec['mpi'].prefix.bin + "/mpic++",
|
|
||||||
"FC=%s" % spec['mpi'].prefix.bin + "/mpifort",
|
|
||||||
])
|
])
|
||||||
if '+threads' in spec:
|
|
||||||
if '+cxx' in spec or '+fortran' in spec:
|
if '+cxx' in spec:
|
||||||
die("Cannot use variant +threads with either +cxx or +fortran")
|
extra_args.append("CXX=%s" % spec['mpi'].prefix.bin + "/mpic++")
|
||||||
|
|
||||||
|
if '+fortran' in spec:
|
||||||
|
extra_args.append("FC=%s" % spec['mpi'].prefix.bin + "/mpifort")
|
||||||
|
|
||||||
|
if '+threadsafe' in spec:
|
||||||
extra_args.extend([
|
extra_args.extend([
|
||||||
'--enable-threadsafe',
|
'--enable-threadsafe',
|
||||||
'--disable-hl',
|
'--disable-hl',
|
||||||
'CPPFLAGS=-DHDatexit=""',
|
|
||||||
'CFLAGS=-DHDatexit=""'
|
|
||||||
])
|
])
|
||||||
|
|
||||||
configure(
|
configure(
|
||||||
"--prefix=%s" % prefix,
|
"--prefix=%s" % prefix,
|
||||||
"--with-zlib=%s" % spec['zlib'].prefix,
|
"--with-zlib=%s" % spec['zlib'].prefix,
|
||||||
"--enable-shared",
|
"--enable-shared", # TODO : this should be enabled by default, remove it?
|
||||||
*extra_args)
|
*extra_args)
|
||||||
|
|
||||||
make()
|
make()
|
||||||
make("install")
|
make("install")
|
||||||
|
|
||||||
|
@ -29,17 +29,17 @@ class Openmpi(Package):
|
|||||||
variant('psm', default=False, description='Build support for the PSM library.')
|
variant('psm', default=False, description='Build support for the PSM library.')
|
||||||
variant('verbs', default=False, description='Build support for OpenFabrics verbs.')
|
variant('verbs', default=False, description='Build support for OpenFabrics verbs.')
|
||||||
|
|
||||||
|
# TODO : variant support for other schedulers is missing
|
||||||
|
variant('tm', default=False, description='Build TM (Torque, PBSPro, and compatible) support')
|
||||||
|
|
||||||
provides('mpi@:2.2', when='@1.6.5')
|
provides('mpi@:2.2', when='@1.6.5')
|
||||||
provides('mpi@:3.0', when='@1.7.5:')
|
provides('mpi@:3.0', when='@1.7.5:')
|
||||||
|
|
||||||
|
|
||||||
depends_on('hwloc')
|
depends_on('hwloc')
|
||||||
|
|
||||||
|
|
||||||
def url_for_version(self, version):
|
def url_for_version(self, version):
|
||||||
return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version)
|
return "http://www.open-mpi.org/software/ompi/v%s/downloads/openmpi-%s.tar.bz2" % (version.up_to(2), version)
|
||||||
|
|
||||||
|
|
||||||
def setup_dependent_environment(self, module, spec, dep_spec):
|
def setup_dependent_environment(self, module, spec, dep_spec):
|
||||||
"""For dependencies, make mpicc's use spack wrapper."""
|
"""For dependencies, make mpicc's use spack wrapper."""
|
||||||
os.environ['OMPI_CC'] = 'cc'
|
os.environ['OMPI_CC'] = 'cc'
|
||||||
@ -47,15 +47,16 @@ def setup_dependent_environment(self, module, spec, dep_spec):
|
|||||||
os.environ['OMPI_FC'] = 'f90'
|
os.environ['OMPI_FC'] = 'f90'
|
||||||
os.environ['OMPI_F77'] = 'f77'
|
os.environ['OMPI_F77'] = 'f77'
|
||||||
|
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
config_args = ["--prefix=%s" % prefix,
|
config_args = ["--prefix=%s" % prefix,
|
||||||
"--with-hwloc=%s" % spec['hwloc'].prefix,
|
"--with-hwloc=%s" % spec['hwloc'].prefix,
|
||||||
"--with-tm", # necessary for Torque support
|
|
||||||
"--enable-shared",
|
"--enable-shared",
|
||||||
"--enable-static"]
|
"--enable-static"]
|
||||||
|
|
||||||
# Variants
|
# Variants
|
||||||
|
if '+tm' in spec:
|
||||||
|
config_args.append("--with-tm") # necessary for Torque support
|
||||||
|
|
||||||
if '+psm' in spec:
|
if '+psm' in spec:
|
||||||
config_args.append("--with-psm")
|
config_args.append("--with-psm")
|
||||||
|
|
||||||
@ -85,7 +86,6 @@ def install(self, spec, prefix):
|
|||||||
|
|
||||||
self.filter_compilers()
|
self.filter_compilers()
|
||||||
|
|
||||||
|
|
||||||
def filter_compilers(self):
|
def filter_compilers(self):
|
||||||
"""Run after install to make the MPI compilers use the
|
"""Run after install to make the MPI compilers use the
|
||||||
compilers that Spack built the package with.
|
compilers that Spack built the package with.
|
||||||
@ -132,5 +132,3 @@ def filter_compilers(self):
|
|||||||
if not os.path.islink(path):
|
if not os.path.islink(path):
|
||||||
filter_file('compiler=.*', 'compiler=%s' % self.compiler.fc,
|
filter_file('compiler=.*', 'compiler=%s' % self.compiler.fc,
|
||||||
path, **kwargs)
|
path, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user