Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
5907cc0de5
4 changed files with 60 additions and 8 deletions
|
@ -23,15 +23,31 @@
|
|||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
import os
|
||||
import hashlib
|
||||
import argparse
|
||||
import hashlib
|
||||
|
||||
from contextlib import contextmanager
|
||||
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.filesystem import *
|
||||
|
||||
import spack.util.crypto
|
||||
from spack.stage import Stage, FailedDownloadError
|
||||
|
||||
description = "Calculate md5 checksums for files."
|
||||
description = "Calculate md5 checksums for files/urls."
|
||||
|
||||
@contextmanager
|
||||
def stager(url):
|
||||
_cwd = os.getcwd()
|
||||
_stager = Stage(url)
|
||||
try:
|
||||
_stager.fetch()
|
||||
yield _stager
|
||||
except FailedDownloadError:
|
||||
tty.msg("Failed to fetch %s" % url)
|
||||
finally:
|
||||
_stager.destroy()
|
||||
os.chdir(_cwd) # the Stage class changes the current working dir so it has to be restored
|
||||
|
||||
def setup_parser(subparser):
|
||||
setup_parser.parser = subparser
|
||||
|
@ -45,9 +61,12 @@ def md5(parser, args):
|
|||
|
||||
for f in args.files:
|
||||
if not os.path.isfile(f):
|
||||
tty.die("Not a file: %s" % f)
|
||||
if not can_access(f):
|
||||
tty.die("Cannot read file: %s" % f)
|
||||
with stager(f) as stage:
|
||||
checksum = spack.util.crypto.checksum(hashlib.md5, stage.archive_file)
|
||||
print "%s %s" % (checksum, f)
|
||||
else:
|
||||
if not can_access(f):
|
||||
tty.die("Cannot read file: %s" % f)
|
||||
|
||||
checksum = spack.util.crypto.checksum(hashlib.md5, f)
|
||||
print "%s %s" % (checksum, f)
|
||||
checksum = spack.util.crypto.checksum(hashlib.md5, f)
|
||||
print "%s %s" % (checksum, f)
|
||||
|
|
|
@ -10,7 +10,7 @@ class Caliper(Package):
|
|||
homepage = "https://github.com/LLNL/Caliper"
|
||||
url = ""
|
||||
|
||||
version('master', git='ssh://git@cz-stash.llnl.gov:7999/piper/caliper.git')
|
||||
version('master', git='ssh://git@github.com:LLNL/Caliper.git')
|
||||
|
||||
variant('mpi', default=False, description='Enable MPI function wrappers.')
|
||||
|
||||
|
|
13
var/spack/repos/builtin/packages/m4/package.py
Normal file
13
var/spack/repos/builtin/packages/m4/package.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from spack import *
|
||||
|
||||
class M4(Package):
|
||||
"""GNU M4 is an implementation of the traditional Unix macro processor."""
|
||||
homepage = "https://www.gnu.org/software/m4/m4.html"
|
||||
url = "ftp://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz"
|
||||
|
||||
version('1.4.17', 'a5e9954b1dae036762f7b13673a2cf76')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
configure("--prefix=%s" % prefix)
|
||||
make()
|
||||
make("install")
|
20
var/spack/repos/builtin/packages/parallel-netcdf/package.py
Normal file
20
var/spack/repos/builtin/packages/parallel-netcdf/package.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from spack import *
|
||||
|
||||
class ParallelNetcdf(Package):
|
||||
"""Parallel netCDF (PnetCDF) is a library providing high-performance
|
||||
parallel I/O while still maintaining file-format compatibility with
|
||||
Unidata's NetCDF."""
|
||||
|
||||
homepage = "https://trac.mcs.anl.gov/projects/parallel-netcdf"
|
||||
url = "http://cucis.ece.northwestern.edu/projects/PnetCDF/Release/parallel-netcdf-1.6.1.tar.gz"
|
||||
|
||||
version('1.6.1', '62a094eb952f9d1e15f07d56e535052604f1ac34')
|
||||
|
||||
depends_on("m4")
|
||||
depends_on("mpi")
|
||||
|
||||
def install(self, spec, prefix):
|
||||
configure("--prefix=%s" % prefix,
|
||||
"--with-mpi=%s" % spec['mpi'].prefix)
|
||||
make()
|
||||
make("install")
|
Loading…
Reference in a new issue