Skip to content

Commit 2ef4768

Browse files
author
Benedikt Hegner
committed
2 parents d31ba16 + d8a7016 commit 2ef4768

File tree

9 files changed

+188
-14
lines changed

9 files changed

+188
-14
lines changed

lib/spack/spack/cmd/create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def fetch_tarballs(url, name, args):
222222
archives_to_fetch = 1
223223
if not versions:
224224
# If the fetch failed for some reason, revert to what the user provided
225-
versions = { version : url }
225+
versions = { "version" : url }
226226
elif len(versions) > 1:
227227
tty.msg("Found %s versions of %s:" % (len(versions), name),
228228
*spack.cmd.elide_list(

lib/spack/spack/compilers/__init__.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,28 +74,36 @@ def _to_dict(compiler):
7474
def get_compiler_config(arch=None, scope=None):
7575
"""Return the compiler configuration for the specified architecture.
7676
"""
77-
# If any configuration file has compilers, just stick with the
78-
# ones already configured.
79-
config = spack.config.get_config('compilers', scope=scope)
80-
77+
# Check whether we're on a front-end (native) architecture.
8178
my_arch = spack.architecture.sys_type()
8279
if arch is None:
8380
arch = my_arch
8481

85-
if arch in config:
86-
return config[arch]
87-
88-
# Only for the current arch in *highest* scope: automatically try to
89-
# find compilers if none are configured yet.
90-
if arch == my_arch and scope == 'user':
82+
def init_compiler_config():
83+
"""Compiler search used when Spack has no compilers."""
9184
config[arch] = {}
9285
compilers = find_compilers(*get_path('PATH'))
9386
for compiler in compilers:
9487
config[arch].update(_to_dict(compiler))
9588
spack.config.update_config('compilers', config, scope=scope)
96-
return config[arch]
9789

98-
return {}
90+
config = spack.config.get_config('compilers', scope=scope)
91+
92+
# Update the configuration if there are currently no compilers
93+
# configured. Avoid updating automatically if there ARE site
94+
# compilers configured but no user ones.
95+
if arch == my_arch and arch not in config:
96+
if scope is None:
97+
# We know no compilers were configured in any scope.
98+
init_compiler_config()
99+
elif scope == 'user':
100+
# Check the site config and update the user config if
101+
# nothing is configured at the site level.
102+
site_config = spack.config.get_config('compilers', scope='site')
103+
if not site_config:
104+
init_compiler_config()
105+
106+
return config[arch] if arch in config else {}
99107

100108

101109
def add_compilers_to_config(compilers, arch=None, scope=None):
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import glob
2+
from spack import *
3+
4+
class Cryptopp(Package):
5+
"""Crypto++ is an open-source C++ library of cryptographic schemes. The
6+
library supports a number of different cryptography algorithms, including
7+
authenticated encryption schemes (GCM, CCM), hash functions (SHA-1, SHA2),
8+
public-key encryption (RSA, DSA), and a few obsolete/historical encryption
9+
algorithms (MD5, Panama)."""
10+
11+
homepage = "http://www.cryptopp.com/"
12+
url = "http://www.cryptopp.com/cryptopp563.zip"
13+
14+
version('5.6.3', '3c5b70e2ec98b7a24988734446242d07')
15+
version('5.6.2', '7ed022585698df48e65ce9218f6c6a67')
16+
17+
def install(self, spec, prefix):
18+
make()
19+
20+
mkdirp(prefix.include)
21+
for hfile in glob.glob('*.h*'):
22+
install(hfile, prefix.include)
23+
24+
mkdirp(prefix.lib)
25+
install('libcryptopp.a', prefix.lib)
26+
27+
def url_for_version(self, version):
28+
version_tuple = tuple(v for v in iter(version))
29+
version_string = reduce(lambda vs, nv: vs + str(nv), version_tuple, "")
30+
31+
return "%scryptopp%s.zip" % (Cryptopp.homepage, version_string)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/cmake-exodus b/cmake-exodus
2+
index 787fd9d..ed073a2 100755
3+
--- a/cmake-exodus
4+
+++ b/cmake-exodus
5+
@@ -1,4 +1,6 @@
6+
-EXTRA_ARGS=$@
7+
+#!/bin/bash
8+
+
9+
+EXTRA_ARGS=-DSEACASProj_ENABLE_CXX11=OFF
10+
11+
### Change this to point to the compilers you want to use
12+
CC=gcc
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
from spack import *
2+
3+
# TODO: Add support for a C++11 enabled installation that filters out the
4+
# TODO: "C++11-Disabled" flag (but only if the spec compiler supports C++11).
5+
6+
# TODO: Add support for parallel installation that uses MPI.
7+
8+
# TODO: Create installation options for NetCDF that support larger page size
9+
# TODO: suggested by Exodus (see the repository "README" file).
10+
11+
class Exodusii(Package):
12+
"""Exodus II is a C++/Fortran library developed to store and retrieve data for
13+
finite element analyses. It's used for preprocessing (problem definition),
14+
postprocessing (results visualization), and data transfer between codes.
15+
An Exodus II data file is a random access, machine independent, binary
16+
file that is written and read via C, C++, or Fortran API routines."""
17+
18+
homepage = "https://github.com/gsjaardema/seacas"
19+
url = "https://github.com/gsjaardema/seacas/archive/master.zip"
20+
21+
version('2016-02-08', git='https://github.com/gsjaardema/seacas.git', commit='dcf3529')
22+
23+
# TODO: Make this a build dependency once build dependencies are supported
24+
# (see: https://github.com/LLNL/spack/pull/378).
25+
depends_on('[email protected]:')
26+
depends_on('hdf5~shared~mpi')
27+
depends_on('netcdf~mpi')
28+
29+
patch('exodus-cmake.patch')
30+
31+
def patch(self):
32+
ff = FileFilter('cmake-exodus')
33+
34+
ff.filter('CMAKE_INSTALL_PREFIX:PATH=${ACCESS}',
35+
'CMAKE_INSTALL_PREFIX:PATH=%s' % self.spec.prefix, string=True)
36+
ff.filter('NetCDF_DIR:PATH=${TPL}',
37+
'NetCDF_DIR:PATH=%s' % self.spec['netcdf'].prefix, string=True)
38+
ff.filter('HDF5_ROOT:PATH=${TPL}',
39+
'HDF5_ROOT:PATH=%s' % self.spec['hdf5'].prefix, string=True)
40+
41+
def install(self, spec, prefix):
42+
mkdirp('build')
43+
cd('build')
44+
45+
cmake_exodus = Executable('../cmake-exodus')
46+
cmake_exodus()
47+
48+
make()
49+
make('install')

var/spack/repos/builtin/packages/hdf5/package.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Hdf5(Package):
4242
version('1.8.13', 'c03426e9e77d7766944654280b467289')
4343

4444
variant('debug', default=False, description='Builds a debug version of the library')
45+
variant('shared', default=True, description='Builds a shared version of the library')
4546

4647
variant('cxx', default=True, description='Enable C++ support')
4748
variant('fortran', default=True, description='Enable Fortran support')
@@ -78,6 +79,11 @@ def install(self, spec, prefix):
7879
else:
7980
extra_args.append('--enable-production')
8081

82+
if '+shared' in spec:
83+
extra_args.append('--enable-shared')
84+
else:
85+
extra_args.append('--enable-static-exec')
86+
8187
if '+unsupported' in spec:
8288
extra_args.append("--enable-unsupported")
8389

@@ -119,7 +125,6 @@ def install(self, spec, prefix):
119125
configure(
120126
"--prefix=%s" % prefix,
121127
"--with-zlib=%s" % spec['zlib'].prefix,
122-
"--enable-shared", # TODO : this should be enabled by default, remove it?
123128
*extra_args)
124129
make()
125130
make("install")
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from spack import *
2+
3+
class Ndiff(Package):
4+
"""The ndiff tool is a binary utility that compares putatively similar files
5+
while ignoring small numeric differernces. This utility is most often used
6+
to compare files containing a lot of floating-point numeric data that
7+
may be slightly different due to numeric error."""
8+
9+
homepage = "http://ftp.math.utah.edu/pub/ndiff/"
10+
url = "http://ftp.math.utah.edu/pub/ndiff/ndiff-2.00.tar.gz"
11+
12+
version('2.00', '885548b4dc26e72c5455bebb5ba6c16d')
13+
version('1.00', 'f41ffe5d12f36cd36b6311acf46eccdc')
14+
15+
def install(self, spec, prefix):
16+
configure('--prefix=%s' % prefix)
17+
18+
mkdirp(prefix.bin)
19+
mkdirp('%s/lib' % prefix.share)
20+
21+
make('install-exe', 'install-shrlib')
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from spack import *
2+
3+
class Tetgen(Package):
4+
"""TetGen is a program and library that can be used to generate tetrahedral
5+
meshes for given 3D polyhedral domains. TetGen generates exact constrained
6+
Delaunay tetrahedralizations, boundary conforming Delaunay meshes, and
7+
Voronoi paritions."""
8+
9+
homepage = "http://www.tetgen.org"
10+
url = "http://www.tetgen.org/files/tetgen1.4.3.tar.gz"
11+
12+
version('1.4.3', 'd6a4bcdde2ac804f7ec66c29dcb63c18')
13+
14+
# TODO: Make this a build dependency once build dependencies are supported
15+
# (see: https://github.com/LLNL/spack/pull/378).
16+
depends_on('[email protected]:', when='@1.5.0:')
17+
18+
def install(self, spec, prefix):
19+
make('tetgen', 'tetlib')
20+
21+
mkdirp(prefix.bin)
22+
install('tetgen', prefix.bin)
23+
24+
mkdirp(prefix.include)
25+
install('tetgen.h', prefix.include)
26+
27+
mkdirp(prefix.lib)
28+
install('libtet.a', prefix.lib)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from spack import *
2+
3+
class Triangle(Package):
4+
"""Triangle is a two-dimensional mesh generator and Delaunay
5+
triangulator. Triangle generates exact Delaunay triangulations,
6+
constrained Delaunay triangulations, conforming Delaunay
7+
triangulations, Voronoi diagrams, and high-quality triangular
8+
meshes."""
9+
10+
homepage = "http://www.cs.cmu.edu/~quake/triangle.html"
11+
url = "http://www.netlib.org/voronoi/triangle.zip"
12+
13+
version('1.6', '10aff8d7950f5e0e2fb6dd2e340be2c9')
14+
15+
def install(self, spec, prefix):
16+
make()
17+
mkdirp(prefix.bin)
18+
19+
install('triangle', prefix.bin)
20+
install('showme', prefix.bin)

0 commit comments

Comments
 (0)