From 837eff1704d26fb654a964ecea91e268d728fff6 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 31 Mar 2016 18:07:44 +0200 Subject: openssl : special treatment for @external (fixes #647) --- .../repos/builtin/packages/openssl/package.py | 45 ++++++++++++++-------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 70afaf4038..db66d1f56e 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -30,26 +30,14 @@ class Openssl(Package): # Same idea, but just to avoid issuing the same message multiple times warnings_given_to_user = getattr(Openssl, '_warnings_given', {}) if openssl_url is None: - latest = 'http://www.openssl.org/source/openssl-{version}.tar.gz' - older = 'http://www.openssl.org/source/old/{version_number}/openssl-{version_full}.tar.gz' - # Try to use the url where the latest tarballs are stored. If the url does not exist (404), then - # return the url for older format - version_number = '.'.join([str(x) for x in version[:-1]]) - older_url = older.format(version_number=version_number, version_full=version) - latest_url = latest.format(version=version) - response = urllib.urlopen(latest.format(version=version)) - if response.getcode() == 404: - openssl_url = older_url - # Checks if we already warned the user for this particular version of OpenSSL. - # If not we display a warning message and mark this version + if self.spec.satisfies('@external'): + # The version @external is reserved to system openssl. In that case return a fake url and exit + openssl_url = '@external (reserved version for system openssl)' if not warnings_given_to_user.get(version, False): - tty.warn('This installation depends on an old version of OpenSSL, which may have known security issues. ') - tty.warn('Consider updating to the latest version of this package.') - tty.warn('More details at {homepage}'.format(homepage=Openssl.homepage)) + tty.msg('Using openssl@external : the version @external is reserved for system openssl') warnings_given_to_user[version] = True else: - openssl_url = latest_url - # Store the computed URL + openssl_url = self.check_for_outdated_release(version, warnings_given_to_user) # Store the computed URL openssl_urls[version] = openssl_url # Store the updated dictionary of URLS Openssl._openssl_url = openssl_urls @@ -58,6 +46,29 @@ class Openssl(Package): return openssl_url + def check_for_outdated_release(self, version, warnings_given_to_user): + latest = 'http://www.openssl.org/source/openssl-{version}.tar.gz' + older = 'http://www.openssl.org/source/old/{version_number}/openssl-{version_full}.tar.gz' + # Try to use the url where the latest tarballs are stored. If the url does not exist (404), then + # return the url for older format + version_number = '.'.join([str(x) for x in version[:-1]]) + older_url = older.format(version_number=version_number, version_full=version) + latest_url = latest.format(version=version) + response = urllib.urlopen(latest.format(version=version)) + if response.getcode() == 404: + openssl_url = older_url + # Checks if we already warned the user for this particular version of OpenSSL. + # If not we display a warning message and mark this version + if not warnings_given_to_user.get(version, False): + tty.warn( + 'This installation depends on an old version of OpenSSL, which may have known security issues. ') + tty.warn('Consider updating to the latest version of this package.') + tty.warn('More details at {homepage}'.format(homepage=Openssl.homepage)) + warnings_given_to_user[version] = True + else: + openssl_url = latest_url + return openssl_url + def install(self, spec, prefix): # OpenSSL uses a variable APPS in its Makefile. If it happens to be set # in the environment, then this will override what is set in the -- cgit v1.2.3-70-g09d2 From d375ddadc4d6f253b21e9c982040757bd5a187d3 Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 4 Apr 2016 12:25:13 +0200 Subject: openssl : reads newer version from ftp (recommended on openssl web-site) --- var/spack/repos/builtin/packages/openssl/package.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index db66d1f56e..9e3109bfed 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -3,6 +3,7 @@ import llnl.util.tty as tty from spack import * + class Openssl(Package): """The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source @@ -47,16 +48,16 @@ class Openssl(Package): return openssl_url def check_for_outdated_release(self, version, warnings_given_to_user): - latest = 'http://www.openssl.org/source/openssl-{version}.tar.gz' + latest = 'ftp://ftp.openssl.org/source/openssl-{version}.tar.gz' older = 'http://www.openssl.org/source/old/{version_number}/openssl-{version_full}.tar.gz' # Try to use the url where the latest tarballs are stored. If the url does not exist (404), then # return the url for older format version_number = '.'.join([str(x) for x in version[:-1]]) - older_url = older.format(version_number=version_number, version_full=version) - latest_url = latest.format(version=version) - response = urllib.urlopen(latest.format(version=version)) - if response.getcode() == 404: - openssl_url = older_url + try: + openssl_url = latest.format(version=version) + urllib.urlopen(openssl_url) + except IOError: + openssl_url = older.format(version_number=version_number, version_full=version) # Checks if we already warned the user for this particular version of OpenSSL. # If not we display a warning message and mark this version if not warnings_given_to_user.get(version, False): @@ -65,8 +66,7 @@ class Openssl(Package): tty.warn('Consider updating to the latest version of this package.') tty.warn('More details at {homepage}'.format(homepage=Openssl.homepage)) warnings_given_to_user[version] = True - else: - openssl_url = latest_url + return openssl_url def install(self, spec, prefix): -- cgit v1.2.3-70-g09d2 From 1acb2a1a09a25a042e30426a70bf96bdb8c489fa Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 19 Apr 2016 16:45:05 -0400 Subject: Add some qthreads patches --- var/spack/repos/builtin/packages/qthreads/ldflags.patch | 11 +++++++++++ var/spack/repos/builtin/packages/qthreads/package.py | 7 ++++++- var/spack/repos/builtin/packages/qthreads/restrict.patch | 12 ++++++++++++ var/spack/repos/builtin/packages/qthreads/trap.patch | 11 +++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/qthreads/ldflags.patch create mode 100644 var/spack/repos/builtin/packages/qthreads/restrict.patch create mode 100644 var/spack/repos/builtin/packages/qthreads/trap.patch diff --git a/var/spack/repos/builtin/packages/qthreads/ldflags.patch b/var/spack/repos/builtin/packages/qthreads/ldflags.patch new file mode 100644 index 0000000000..0c15eab386 --- /dev/null +++ b/var/spack/repos/builtin/packages/qthreads/ldflags.patch @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -40456,7 +40456,7 @@ + hwloc_saved_LDFLAGS="$LDFLAGS" + if test "x$with_hwloc" != x; then + CPPFLAGS="-I$with_hwloc/include $CPPFLAGS" +- LDFLAGS="-L$with_hwloc/lib $CPPFLAGS" ++ LDFLAGS="-L$with_hwloc/lib $LDFLAGS" + fi + + diff --git a/var/spack/repos/builtin/packages/qthreads/package.py b/var/spack/repos/builtin/packages/qthreads/package.py index dacdb71524..5da9340927 100644 --- a/var/spack/repos/builtin/packages/qthreads/package.py +++ b/var/spack/repos/builtin/packages/qthreads/package.py @@ -16,7 +16,12 @@ class Qthreads(Package): version('1.10', '5af8c8bbe88c2a6d45361643780d1671') + patch("ldflags.patch") + patch("restrict.patch") + patch("trap.patch") + def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure("--prefix=%s" % prefix, + "--enable-guard-pages") make() make("install") diff --git a/var/spack/repos/builtin/packages/qthreads/restrict.patch b/var/spack/repos/builtin/packages/qthreads/restrict.patch new file mode 100644 index 0000000000..4c95714f6b --- /dev/null +++ b/var/spack/repos/builtin/packages/qthreads/restrict.patch @@ -0,0 +1,12 @@ +--- a/include/qthread/common.h.in ++++ b/include/qthread/common.h.in +@@ -84,7 +84,9 @@ + /* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ ++#ifndef restrict + #undef restrict ++#endif + /* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the diff --git a/var/spack/repos/builtin/packages/qthreads/trap.patch b/var/spack/repos/builtin/packages/qthreads/trap.patch new file mode 100644 index 0000000000..7aa94d82d5 --- /dev/null +++ b/var/spack/repos/builtin/packages/qthreads/trap.patch @@ -0,0 +1,11 @@ +--- a/include/qthread/qthread.hpp ++++ b/include/qthread/qthread.hpp +@@ -236,7 +236,7 @@ + return qthread_incr64((uint64_t *)operand, incr); + + default: +- *(int *)(0) = 0; ++ __builtin_trap(); + } + return T(0); // never hit - keep compiler happy + } -- cgit v1.2.3-70-g09d2 From e92da6a6ba02bdc3c879f9df8be6ee4aac2583d3 Mon Sep 17 00:00:00 2001 From: Adam Lyon Date: Mon, 8 Feb 2016 02:34:24 -0600 Subject: Handle c++11 and c++14 correctly --- lib/spack/spack/compiler.py | 3 +++ lib/spack/spack/compilers/gcc.py | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index d38c0b00b1..20896f9eec 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -97,6 +97,9 @@ class Compiler(object): # argument used to get C++11 options cxx11_flag = "-std=c++11" + # argument used to get C++14 options + cxx14_flag = "-std=c++1y" + def __init__(self, cspec, cc, cxx, f77, fc): def check(exe): diff --git a/lib/spack/spack/compilers/gcc.py b/lib/spack/spack/compilers/gcc.py index 64214db32d..2e57e44856 100644 --- a/lib/spack/spack/compilers/gcc.py +++ b/lib/spack/spack/compilers/gcc.py @@ -54,9 +54,16 @@ class Gcc(Compiler): if self.version < ver('4.3'): tty.die("Only gcc 4.3 and above support c++11.") elif self.version < ver('4.7'): - return "-std=gnu++0x" + return "-std=c++0x" else: - return "-std=gnu++11" + return "-std=c++11" + + @property + def cxx14_flag(self): + if self.version < ver('4.8'): + tty.die("Only gcc 4.8 and above support c++14.") + else: + return "-std=c++14" @classmethod def fc_version(cls, fc): -- cgit v1.2.3-70-g09d2 From d5d1e89cbdc64a072096db89c2d78e3e1ddc7700 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Thu, 21 Apr 2016 21:15:54 -0500 Subject: remove use of unknown environment variable in lib/spack/env/cc (#821) --- lib/spack/env/cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spack/env/cc b/lib/spack/env/cc index 18fd8f7bdb..cb07a2ffea 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -162,7 +162,7 @@ fi # It doesn't work with -rpath. # This variable controls whether they are added. add_rpaths=true -if [[ mode == ld && $OSTYPE == darwin* ]]; then +if [[ $mode == ld && "$SPACK_SHORT_SPEC" =~ "darwin" ]]; then for arg in "$@"; do if [[ $arg == -r ]]; then add_rpaths=false -- cgit v1.2.3-70-g09d2 From ef9347bcfb52e7f80aacb4ecb63d1536b8aaa3c0 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 22 Apr 2016 04:25:17 +0200 Subject: dealii: set DEAL_II_DIR when loading a module (#816) --- var/spack/repos/builtin/packages/dealii/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index b251d50ca1..6810e86868 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -251,3 +251,6 @@ class Dealii(Package): cmake('.') make('release') make('run',parallel=False) + + def setup_environment(self, spack_env, env): + env.set('DEAL_II_DIR', self.prefix) -- cgit v1.2.3-70-g09d2 From a0989ad672bd22afe89ee2c2f50b32003ebb2764 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 22 Apr 2016 04:26:19 +0200 Subject: minor cleanup of environment-modules documentation (#814) * minor cleanup of environment-modules documentation * environment modules: update usage instructions --- lib/spack/docs/basic_usage.rst | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst index 68f3d07b29..0e603813e1 100644 --- a/lib/spack/docs/basic_usage.rst +++ b/lib/spack/docs/basic_usage.rst @@ -807,17 +807,22 @@ Environment Modules, you can get it with Spack: 1. Install with:: +.. code-block:: sh + spack install environment-modules 2. Activate with:: - MODULES_HOME=`spack location -i environment-modules` - MODULES_VERSION=`ls -1 $MODULES_HOME/Modules | head -1` - ${MODULES_HOME}/Modules/${MODULES_VERSION}/bin/add.modules +Add the following two lines to your ``.bashrc`` profile (or similar): + +.. code-block:: sh + + MODULES_HOME=`spack location -i environment-modules` + source ${MODULES_HOME}/Modules/init/bash + +In case you use a Unix shell other than bash, substitute ``bash`` by +the appropriate file in ``${MODULES_HOME}/Modules/init/``. -This adds to your ``.bashrc`` (or similar) files, enabling Environment -Modules when you log in. It will ask your permission before changing -any files. Spack and Environment Modules ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3-70-g09d2 From 5c4bb69af9cceca0b3c4380357ab6e74e7554067 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 21 Apr 2016 22:29:20 -0400 Subject: xerces-c: update to 3.1.3 (#811) The 3.1.2 tarball seems to have gone missing. Also switch to using bz2 rather than gz to reduce the download size. --- var/spack/repos/builtin/packages/xerces-c/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/xerces-c/package.py b/var/spack/repos/builtin/packages/xerces-c/package.py index b59ab178ae..e36fb936e0 100644 --- a/var/spack/repos/builtin/packages/xerces-c/package.py +++ b/var/spack/repos/builtin/packages/xerces-c/package.py @@ -24,8 +24,8 @@ class XercesC(Package): """ homepage = "https://xerces.apache.org/xerces-c" - url = "https://www.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.2.tar.gz" - version('3.1.2', '9eb1048939e88d6a7232c67569b23985') + url = "https://www.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.3.tar.bz2" + version('3.1.3', '5e333b55cb43e6b025ddf0e5d0f0fb0d') def install(self, spec, prefix): configure("--prefix=%s" % prefix, -- cgit v1.2.3-70-g09d2 From fa02f94ca4bada75cca4248665bbc007412294c5 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 21 Apr 2016 23:10:10 -0700 Subject: Regression test for not adding RPATHs with `ld -r` (#809, #821) - ld -r is only broken with rpaths on OSX; this tests that specific case. - test should still work cross-platform. --- lib/spack/spack/test/cc.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/spack/spack/test/cc.py b/lib/spack/spack/test/cc.py index 0b1aeb2a8f..594cd6efe9 100644 --- a/lib/spack/spack/test/cc.py +++ b/lib/spack/spack/test/cc.py @@ -219,3 +219,27 @@ class CompilerTest(unittest.TestCase): ' '.join(test_command)) + def test_ld_deps_reentrant(self): + """Make sure ld -r is handled correctly on OS's where it doesn't + support rpaths.""" + os.environ['SPACK_DEPENDENCIES'] = ':'.join([self.dep1]) + + os.environ['SPACK_SHORT_SPEC'] = "foo@1.2=linux-x86_64" + reentrant_test_command = ['-r'] + test_command + self.check_ld('dump-args', reentrant_test_command, + 'ld ' + + '-rpath ' + self.prefix + '/lib ' + + '-rpath ' + self.prefix + '/lib64 ' + + + '-L' + self.dep1 + '/lib ' + + '-rpath ' + self.dep1 + '/lib ' + + + '-r ' + + ' '.join(test_command)) + + os.environ['SPACK_SHORT_SPEC'] = "foo@1.2=darwin-x86_64" + self.check_ld('dump-args', reentrant_test_command, + 'ld ' + + '-L' + self.dep1 + '/lib ' + + '-r ' + + ' '.join(test_command)) -- cgit v1.2.3-70-g09d2 From e7d2fa7084a63d73fe19607a442e47036a3f864b Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 22 Apr 2016 12:30:24 -0500 Subject: Add IOR benchmark package --- var/spack/repos/builtin/packages/ior/package.py | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 var/spack/repos/builtin/packages/ior/package.py diff --git a/var/spack/repos/builtin/packages/ior/package.py b/var/spack/repos/builtin/packages/ior/package.py new file mode 100644 index 0000000000..3ede3d7e37 --- /dev/null +++ b/var/spack/repos/builtin/packages/ior/package.py @@ -0,0 +1,38 @@ +from spack import * +import os + +class Ior(Package): + """The IOR software is used for benchmarking parallel file systems + using POSIX, MPI-IO, or HDF5 interfaces.""" + + homepage = "http://www.nersc.gov/users/computational-systems/cori/nersc-8-procurement/trinity-nersc-8-rfp/nersc-8-trinity-benchmarks/ior/" + url = "https://github.com/LLNL/ior/archive/3.0.1.tar.gz" + + version('3.0.1', '71150025e0bb6ea1761150f48b553065') + + variant('hdf5', default=False, description='support IO with HDF5 backend') + variant('ncmpi', default=False, description='support IO with NCMPI backend') + + depends_on('mpi') + depends_on('hdf5+mpi', when='+hdf5') + depends_on('netcdf+mpi', when='+ncmpi') + + + def install(self, spec, prefix): + os.system('./bootstrap') + + config_args = [ + 'MPICC=%s' % spec['mpi'].prefix.bin + '/mpicc', + '--prefix=%s' % prefix, + ] + + if '+hdf5' in spec: + config_args.append('--with-hdf5') + + if '+ncmpi' in spec: + config_args.append('--with-ncmpi') + + configure(*config_args) + + make() + make('install') -- cgit v1.2.3-70-g09d2 From d701d2ccf344ff22fee463504dd85e1d0a5bfdc6 Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Sat, 23 Apr 2016 12:15:14 -0700 Subject: Updated the Swig package file to include versions for all of the popular Swig releases. (#790) --- var/spack/repos/builtin/packages/swig/package.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/swig/package.py b/var/spack/repos/builtin/packages/swig/package.py index 8d46c4fe46..78a6c6bbae 100644 --- a/var/spack/repos/builtin/packages/swig/package.py +++ b/var/spack/repos/builtin/packages/swig/package.py @@ -22,6 +22,7 @@ # 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 * class Swig(Package): @@ -33,14 +34,19 @@ class Swig(Package): code. In addition, SWIG provides a variety of customization features that let you tailor the wrapping process to suit your application.""" + homepage = "http://www.swig.org" - url = "http://prdownloads.sourceforge.net/swig/swig-3.0.2.tar.gz" + url = "http://prdownloads.sourceforge.net/swig/swig-3.0.8.tar.gz" + version('3.0.8', 'c96a1d5ecb13d38604d7e92148c73c97') version('3.0.2', '62f9b0d010cef36a13a010dc530d0d41') + version('2.0.12', 'c3fb0b2d710cc82ed0154b91e43085a4') + version('2.0.2', 'eaf619a4169886923e5f828349504a29') + version('1.3.40', '2df766c9e03e02811b1ab4bba1c7b9cc') depends_on('pcre') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure('--prefix=%s' % prefix) make() - make("install") + make('install') -- cgit v1.2.3-70-g09d2 From 4e062d86b4213595e74510f9b8d91382ed4e1041 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 23 Apr 2016 15:15:32 -0400 Subject: Refine wget's OpenSSL configuration options (#786) --- var/spack/repos/builtin/packages/wget/package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/wget/package.py b/var/spack/repos/builtin/packages/wget/package.py index 55728b0515..4b92659478 100644 --- a/var/spack/repos/builtin/packages/wget/package.py +++ b/var/spack/repos/builtin/packages/wget/package.py @@ -17,6 +17,8 @@ class Wget(Package): def install(self, spec, prefix): configure("--prefix=%s" % prefix, - "--with-ssl=openssl") + "--with-ssl=openssl", + "OPENSSL_CFLAGS=-I%s" % spec['openssl'].prefix.include, + "OPENSSL_LIBS=-L%s -lssl -lcrypto -lz" % spec['openssl'].prefix.lib) make() make("install") -- cgit v1.2.3-70-g09d2 From 248248c6b270e2c1707ea29e90de74813ea2debf Mon Sep 17 00:00:00 2001 From: Elizabeth Fischer Date: Sat, 23 Apr 2016 15:15:53 -0400 Subject: Added package: NCView (#791) * ncview: Added package * Removed FIXMEs --- var/spack/repos/builtin/packages/ncview/package.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 var/spack/repos/builtin/packages/ncview/package.py diff --git a/var/spack/repos/builtin/packages/ncview/package.py b/var/spack/repos/builtin/packages/ncview/package.py new file mode 100644 index 0000000000..1aa13e3f03 --- /dev/null +++ b/var/spack/repos/builtin/packages/ncview/package.py @@ -0,0 +1,20 @@ +from spack import * + +class Ncview(Package): + """Simple viewer for NetCDF files.""" + homepage = "http://meteora.ucsd.edu/~pierce/ncview_home_page.html" + url = "ftp://cirrus.ucsd.edu/pub/ncview/ncview-2.1.7.tar.gz" + + version('2.1.7', 'debd6ca61410aac3514e53122ab2ba07') + + depends_on("netcdf") + depends_on("udunits2") + + # OS Dependencies + # Ubuntu: apt-get install libxaw7-dev + # CentOS 7: yum install libXaw-devel + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From e32416430c16a51af673a78fb79d47c68464fa98 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 23 Apr 2016 15:18:58 -0400 Subject: Update git (#819) * git: update to 2.8.0 final and add 2.8.1 * git: hard-depend on curl and expat HTTP-based cloning is very prevalent now. --- var/spack/repos/builtin/packages/git/package.py | 32 ++++++------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/var/spack/repos/builtin/packages/git/package.py b/var/spack/repos/builtin/packages/git/package.py index 388f84aefd..77521fd658 100644 --- a/var/spack/repos/builtin/packages/git/package.py +++ b/var/spack/repos/builtin/packages/git/package.py @@ -7,7 +7,8 @@ class Git(Package): homepage = "http://git-scm.com" url = "https://github.com/git/git/tarball/v2.7.1" - version('2.8.0-rc2', 'c2cf9f2cc70e35f2fafbaf9258f82e4c') + version('2.8.1', '1308448d95afa41a4135903f22262fc8') + version('2.8.0', 'eca687e46e9750121638f258cff8317b') version('2.7.3', 'fa1c008b56618c355a32ba4a678305f6') version('2.7.1', 'bf0706b433a8dedd27a63a72f9a66060') @@ -23,18 +24,10 @@ class Git(Package): #version('2.2.1', 'ff41fdb094eed1ec430aed8ee9b9849c') - # Git compiles with curl support by default on but if your system - # does not have it you will not be able to clone https repos - variant("curl", default=False, description="Add the internal support of curl for https clone") - - # Git compiles with expat support by default on but if your system - # does not have it you will not be able to push https repos - variant("expat", default=False, description="Add the internal support of expat for https push") - depends_on("openssl") depends_on("autoconf") - depends_on("curl", when="+curl") - depends_on("expat", when="+expat") + depends_on("curl") + depends_on("expat") # Also depends_on gettext: apt-get install gettext (Ubuntu) @@ -49,23 +42,12 @@ class Git(Package): "--prefix=%s" % prefix, "--without-pcre", "--with-openssl=%s" % spec['openssl'].prefix, - "--with-zlib=%s" % spec['zlib'].prefix + "--with-zlib=%s" % spec['zlib'].prefix, + "--with-curl=%s" % spec['curl'].prefix, + "--with-expat=%s" % spec['expat'].prefix, ] - if '+curl' in spec: - configure_args.append("--with-curl=%s" % spec['curl'].prefix) - - if '+expat' in spec: - configure_args.append("--with-expat=%s" % spec['expat'].prefix) - which('autoreconf')('-i') configure(*configure_args) make() make("install") - - - - - - - -- cgit v1.2.3-70-g09d2 From 22e4ee560465a633f7dd8e84a2e7088d8dcf547f Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 23 Apr 2016 15:29:47 -0500 Subject: Add OSU Micro-Benchmarks package (#822) * Add OSU Micro-Benchmarks package * Add workaround for GCC bug --- .../packages/osu-micro-benchmarks/package.py | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py diff --git a/var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py b/var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py new file mode 100644 index 0000000000..01054471a3 --- /dev/null +++ b/var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py @@ -0,0 +1,38 @@ +from spack import * + +class OsuMicroBenchmarks(Package): + """The Ohio MicroBenchmark suite is a collection of independent MPI + message passing performance microbenchmarks developed and written at + The Ohio State University. It includes traditional benchmarks and + performance measures such as latency, bandwidth and host overhead + and can be used for both traditional and GPU-enhanced nodes.""" + + homepage = "http://mvapich.cse.ohio-state.edu/benchmarks/" + url = "http://mvapich.cse.ohio-state.edu/download/mvapich/osu-micro-benchmarks-5.3.tar.gz" + + version('5.3', '42e22b931d451e8bec31a7424e4adfc2') + + variant('cuda', default=False, description="Enable CUDA support") + + depends_on('mpi') + depends_on('cuda', when='+cuda') + + + def install(self, spec, prefix): + config_args = [ + 'CC=%s' % spec['mpi'].prefix.bin + '/mpicc', + 'CXX=%s' % spec['mpi'].prefix.bin + '/mpicxx', + 'LDFLAGS=-lrt', + '--prefix=%s' % prefix + ] + + if '+cuda' in spec: + config_args.extend([ + '--enable-cuda', + '--with-cuda=%s' % spec['cuda'].prefix, + ]) + + configure(*config_args) + + make() + make('install') -- cgit v1.2.3-70-g09d2 From ed16bd133afd4c4da48f9d92e0d8578fd3719c72 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 23 Apr 2016 16:34:51 -0400 Subject: compiler: add "find" subcommand (#818) And make "add" an alias to it. Fixes #713. --- lib/spack/spack/cmd/compiler.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/spack/spack/cmd/compiler.py b/lib/spack/spack/cmd/compiler.py index 3e58e82184..a8e9e2a7a5 100644 --- a/lib/spack/spack/cmd/compiler.py +++ b/lib/spack/spack/cmd/compiler.py @@ -44,10 +44,10 @@ def setup_parser(subparser): scopes = spack.config.config_scopes - # Add - add_parser = sp.add_parser('add', help='Add compilers to the Spack configuration.') - add_parser.add_argument('add_paths', nargs=argparse.REMAINDER) - add_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_modify_scope, + # Find + find_parser = sp.add_parser('find', aliases=['add'], help='Search the system for compilers to add to the Spack configuration.') + find_parser.add_argument('add_paths', nargs=argparse.REMAINDER) + find_parser.add_argument('--scope', choices=scopes, default=spack.cmd.default_modify_scope, help="Configuration scope to modify.") # Remove @@ -70,7 +70,7 @@ def setup_parser(subparser): help="Configuration scope to read from.") -def compiler_add(args): +def compiler_find(args): """Search either $PATH or a list of paths for compilers and add them to Spack's configuration.""" paths = args.add_paths @@ -136,7 +136,8 @@ def compiler_list(args): def compiler(parser, args): - action = { 'add' : compiler_add, + action = { 'add' : compiler_find, + 'find' : compiler_find, 'remove' : compiler_remove, 'rm' : compiler_remove, 'info' : compiler_info, -- cgit v1.2.3-70-g09d2 From a7ffffc336beff3ba2ef98a82ec16c35d65c7982 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sun, 24 Apr 2016 17:14:33 -0500 Subject: Change homepage, explicitly disable --- var/spack/repos/builtin/packages/ior/package.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/ior/package.py b/var/spack/repos/builtin/packages/ior/package.py index 3ede3d7e37..c46650a674 100644 --- a/var/spack/repos/builtin/packages/ior/package.py +++ b/var/spack/repos/builtin/packages/ior/package.py @@ -5,7 +5,7 @@ class Ior(Package): """The IOR software is used for benchmarking parallel file systems using POSIX, MPI-IO, or HDF5 interfaces.""" - homepage = "http://www.nersc.gov/users/computational-systems/cori/nersc-8-procurement/trinity-nersc-8-rfp/nersc-8-trinity-benchmarks/ior/" + homepage = "https://github.com/LLNL/ior" url = "https://github.com/LLNL/ior/archive/3.0.1.tar.gz" version('3.0.1', '71150025e0bb6ea1761150f48b553065') @@ -28,9 +28,13 @@ class Ior(Package): if '+hdf5' in spec: config_args.append('--with-hdf5') + else: + config_args.append('--without-hdf5') if '+ncmpi' in spec: config_args.append('--with-ncmpi') + else: + config_args.append('--without-ncmpi') configure(*config_args) -- cgit v1.2.3-70-g09d2 From 797af2e80f0effddeca2b964283705940fa45df8 Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Sun, 24 Apr 2016 17:39:49 -0500 Subject: Add py-csvkit package This adds the py-csvkit package and needed dependencies for working with csv files. --- .../builtin/packages/py-SQLAlchemy/package.py | 15 ++++++++++++++ .../repos/builtin/packages/py-csvkit/package.py | 23 ++++++++++++++++++++++ var/spack/repos/builtin/packages/py-dbf/package.py | 17 ++++++++++++++++ .../repos/builtin/packages/py-jdcal/package.py | 15 ++++++++++++++ .../repos/builtin/packages/py-openpyxl/package.py | 18 +++++++++++++++++ .../repos/builtin/packages/py-xlrd/package.py | 16 +++++++++++++++ 6 files changed, 104 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-SQLAlchemy/package.py create mode 100644 var/spack/repos/builtin/packages/py-csvkit/package.py create mode 100644 var/spack/repos/builtin/packages/py-dbf/package.py create mode 100644 var/spack/repos/builtin/packages/py-jdcal/package.py create mode 100644 var/spack/repos/builtin/packages/py-openpyxl/package.py create mode 100644 var/spack/repos/builtin/packages/py-xlrd/package.py diff --git a/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py b/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py new file mode 100644 index 0000000000..ccb882f749 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py @@ -0,0 +1,15 @@ +from spack import * + +class PySqlalchemy(Package): + """ + The Python SQL Toolkit and Object Relational Mapper + """ + homepage = 'http://www.sqlalchemy.org/' + url = "https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-1.0.12.tar.gz" + + version('1.0.12', '6d19ef29883bbebdcac6613cf391cac4') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-csvkit/package.py b/var/spack/repos/builtin/packages/py-csvkit/package.py new file mode 100644 index 0000000000..1ab848161d --- /dev/null +++ b/var/spack/repos/builtin/packages/py-csvkit/package.py @@ -0,0 +1,23 @@ +from spack import * + +class PyCsvkit(Package): + """ + A library of utilities for working with CSV, the king of tabular file + formats + """ + homepage = 'http://csvkit.rtfd.org/' + url = "https://pypi.python.org/packages/source/c/csvkit/csvkit-0.9.1.tar.gz" + + version('0.9.1', '48d78920019d18846933ee969502fff6') + + extends('python') + + depends_on('py-dateutil') + depends_on('py-dbf') + depends_on('py-xlrd') + depends_on('py-SQLAlchemy') + depends_on('py-six') + depends_on('py-openpyxl') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-dbf/package.py b/var/spack/repos/builtin/packages/py-dbf/package.py new file mode 100644 index 0000000000..75c32b2d61 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-dbf/package.py @@ -0,0 +1,17 @@ +from spack import * + +class PyDbf(Package): + """ + Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro + .dbf files (including memos). + """ + + homepage = 'https://pypi.python.org/pypi/dbf' + url = "https://pypi.python.org/packages/source/d/dbf/dbf-0.96.005.tar.gz" + + version('0.96.005', 'bce1a1ed8b454a30606e7e18dd2f8277') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-jdcal/package.py b/var/spack/repos/builtin/packages/py-jdcal/package.py new file mode 100644 index 0000000000..a2fcbe119c --- /dev/null +++ b/var/spack/repos/builtin/packages/py-jdcal/package.py @@ -0,0 +1,15 @@ +from spack import * + +class PyJdcal(Package): + """ + Julian dates from proleptic Gregorian and Julian calendars + """ + homepage = 'http://github.com/phn/jdcal' + url = "https://pypi.python.org/packages/source/j/jdcal/jdcal-1.2.tar.gz" + + version('1.2', 'ab8d5ba300fd1eb01514f363d19b1eb9') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-openpyxl/package.py b/var/spack/repos/builtin/packages/py-openpyxl/package.py new file mode 100644 index 0000000000..5954c4758a --- /dev/null +++ b/var/spack/repos/builtin/packages/py-openpyxl/package.py @@ -0,0 +1,18 @@ +from spack import * + +class PyOpenpyxl(Package): + """ + A Python library to read/write Excel 2007 xlsx/xlsm files + """ + homepage = 'http://openpyxl.readthedocs.org/' + url = "https://pypi.python.org/packages/source/o/openpyxl/openpyxl-2.4.0-a1.tar.gz" + + version('2.4.0-a1', 'e5ca6d23ceccb15115d45cdf26e736fc') + + extends('python') + + depends_on('py-jdcal') + depends_on('py-setuptools') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/py-xlrd/package.py b/var/spack/repos/builtin/packages/py-xlrd/package.py new file mode 100644 index 0000000000..10ca8ce2a7 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-xlrd/package.py @@ -0,0 +1,16 @@ +from spack import * + +class PyXlrd(Package): + """ + Library for developers to extract data from Microsoft Excel (tm) + spreadsheet files + """ + homepage = 'http://www.python-excel.org/' + url = "https://pypi.python.org/packages/source/x/xlrd/xlrd-0.9.4.tar.gz" + + version('0.9.4', '911839f534d29fe04525ef8cd88fe865') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 4e671c54ee69d2a335e2b057aada75c2257c3850 Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Sun, 24 Apr 2016 18:06:51 -0500 Subject: Reformat the description. --- var/spack/repos/builtin/packages/py-SQLAlchemy/package.py | 5 ++--- var/spack/repos/builtin/packages/py-csvkit/package.py | 7 +++---- var/spack/repos/builtin/packages/py-dbf/package.py | 6 ++---- var/spack/repos/builtin/packages/py-jdcal/package.py | 5 ++--- var/spack/repos/builtin/packages/py-openpyxl/package.py | 5 ++--- var/spack/repos/builtin/packages/py-xlrd/package.py | 7 +++---- 6 files changed, 14 insertions(+), 21 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py b/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py index ccb882f749..9aecc95c63 100644 --- a/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py +++ b/var/spack/repos/builtin/packages/py-SQLAlchemy/package.py @@ -1,9 +1,8 @@ from spack import * class PySqlalchemy(Package): - """ - The Python SQL Toolkit and Object Relational Mapper - """ + """The Python SQL Toolkit and Object Relational Mapper""" + homepage = 'http://www.sqlalchemy.org/' url = "https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-1.0.12.tar.gz" diff --git a/var/spack/repos/builtin/packages/py-csvkit/package.py b/var/spack/repos/builtin/packages/py-csvkit/package.py index 1ab848161d..def30457be 100644 --- a/var/spack/repos/builtin/packages/py-csvkit/package.py +++ b/var/spack/repos/builtin/packages/py-csvkit/package.py @@ -1,10 +1,9 @@ from spack import * class PyCsvkit(Package): - """ - A library of utilities for working with CSV, the king of tabular file - formats - """ + """A library of utilities for working with CSV, the king of tabular file + formats""" + homepage = 'http://csvkit.rtfd.org/' url = "https://pypi.python.org/packages/source/c/csvkit/csvkit-0.9.1.tar.gz" diff --git a/var/spack/repos/builtin/packages/py-dbf/package.py b/var/spack/repos/builtin/packages/py-dbf/package.py index 75c32b2d61..698b221903 100644 --- a/var/spack/repos/builtin/packages/py-dbf/package.py +++ b/var/spack/repos/builtin/packages/py-dbf/package.py @@ -1,10 +1,8 @@ from spack import * class PyDbf(Package): - """ - Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro - .dbf files (including memos). - """ + """Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro + .dbf files (including memos)""" homepage = 'https://pypi.python.org/pypi/dbf' url = "https://pypi.python.org/packages/source/d/dbf/dbf-0.96.005.tar.gz" diff --git a/var/spack/repos/builtin/packages/py-jdcal/package.py b/var/spack/repos/builtin/packages/py-jdcal/package.py index a2fcbe119c..54169b2c21 100644 --- a/var/spack/repos/builtin/packages/py-jdcal/package.py +++ b/var/spack/repos/builtin/packages/py-jdcal/package.py @@ -1,9 +1,8 @@ from spack import * class PyJdcal(Package): - """ - Julian dates from proleptic Gregorian and Julian calendars - """ + """Julian dates from proleptic Gregorian and Julian calendars""" + homepage = 'http://github.com/phn/jdcal' url = "https://pypi.python.org/packages/source/j/jdcal/jdcal-1.2.tar.gz" diff --git a/var/spack/repos/builtin/packages/py-openpyxl/package.py b/var/spack/repos/builtin/packages/py-openpyxl/package.py index 5954c4758a..87ff9f3521 100644 --- a/var/spack/repos/builtin/packages/py-openpyxl/package.py +++ b/var/spack/repos/builtin/packages/py-openpyxl/package.py @@ -1,9 +1,8 @@ from spack import * class PyOpenpyxl(Package): - """ - A Python library to read/write Excel 2007 xlsx/xlsm files - """ + """A Python library to read/write Excel 2007 xlsx/xlsm files""" + homepage = 'http://openpyxl.readthedocs.org/' url = "https://pypi.python.org/packages/source/o/openpyxl/openpyxl-2.4.0-a1.tar.gz" diff --git a/var/spack/repos/builtin/packages/py-xlrd/package.py b/var/spack/repos/builtin/packages/py-xlrd/package.py index 10ca8ce2a7..8f25c06aad 100644 --- a/var/spack/repos/builtin/packages/py-xlrd/package.py +++ b/var/spack/repos/builtin/packages/py-xlrd/package.py @@ -1,10 +1,9 @@ from spack import * class PyXlrd(Package): - """ - Library for developers to extract data from Microsoft Excel (tm) - spreadsheet files - """ + """Library for developers to extract data from Microsoft Excel (tm) + spreadsheet files""" + homepage = 'http://www.python-excel.org/' url = "https://pypi.python.org/packages/source/x/xlrd/xlrd-0.9.4.tar.gz" -- cgit v1.2.3-70-g09d2 From b81cb554f505c4075b9df79ab3db08be3d3b9e36 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 25 Apr 2016 09:57:48 +0200 Subject: openblas: a small unit test to make sure Lapack symbols are compiled --- .../repos/builtin/packages/openblas/package.py | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 4522130ccc..252f699652 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -1,6 +1,7 @@ from spack import * import sys import os +import shutil class Openblas(Package): """OpenBLAS: An optimized BLAS library""" @@ -64,6 +65,10 @@ class Openblas(Package): if '+shared' in spec: symlink('libopenblas.%s' % dso_suffix, 'liblapack.%s' % dso_suffix) + # Openblas may pass its own test but still fail to compile Lapack + # symbols. To make sure we get working Blas and Lapack, do a small test. + self.check_install(spec) + def setup_dependent_package(self, module, dspec): # This is WIP for a prototype interface for virtual packages. @@ -76,3 +81,53 @@ class Openblas(Package): if '+shared' in self.spec: self.spec.blas_shared_lib = join_path(libdir, 'libopenblas.%s' % dso_suffix) self.spec.lapack_shared_lib = self.spec.blas_shared_lib + + def check_install(self, spec): + "Build and run a small program to test that we have Lapack symbols" + print "Checking Openblas installation..." + checkdir = "spack-check" + with working_dir(checkdir, create=True): + source = r""" +#include +#include +int main(void) { +int i=0; +double A[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0}; +double B[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0}; +double C[9] = {.5, .5, .5, .5, .5, .5, .5, .5, .5}; +cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans, + 3, 3, 2, 1, A, 3, B, 3, 2, C, 3); +for (i = 0; i < 8; i++) + printf("%lf ", C[i]); +printf("%lf", C[8]); +return 0; +} +""" + expected = """\ +11.000000 -9.000000 5.000000 -9.000000 21.000000 -1.000000 5.000000 -1.000000 3.000000\ +""" + with open("check.c", 'w') as f: + f.write(source) + cc = which('cc') + # TODO: Automate these path and library settings + cc('-c', "-I%s" % join_path(spec.prefix, "include"), "check.c") + cc('-o', "check", "check.o", + "-L%s" % join_path(spec.prefix, "lib"), "-llapack", "-lblas") + try: + check = Executable('./check') + output = check(return_output=True) + except: + output = "" + success = output == expected + if not success: + print "Produced output does not match expected output." + print "Expected output:" + print '-'*80 + print expected + print '-'*80 + print "Produced output:" + print '-'*80 + print output + print '-'*80 + raise RuntimeError("Openblas install check failed") + shutil.rmtree(checkdir) -- cgit v1.2.3-70-g09d2 From 42be50d10b649a130e64f2a742fa4133ed5534b7 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 25 Apr 2016 13:53:41 +0200 Subject: add a test/output pair --- .../repos/builtin/packages/openblas/test_cblas_dgemm.c | 14 ++++++++++++++ .../builtin/packages/openblas/test_cblas_dgemm.output | 1 + 2 files changed, 15 insertions(+) create mode 100644 var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c create mode 100644 var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output diff --git a/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c new file mode 100644 index 0000000000..37785bf47f --- /dev/null +++ b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c @@ -0,0 +1,14 @@ +#include +#include +int main(void) { +int i=0; +double A[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0}; +double B[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0}; +double C[9] = {.5, .5, .5, .5, .5, .5, .5, .5, .5}; +cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans, + 3, 3, 2, 1, A, 3, B, 3, 2, C, 3); +for (i = 0; i < 8; i++) + printf("%lf ", C[i]); +printf("%lf", C[8]); +return 0; +} diff --git a/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output new file mode 100644 index 0000000000..490905aca0 --- /dev/null +++ b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output @@ -0,0 +1 @@ +11.000000 -9.000000 5.000000 -9.000000 21.000000 -1.000000 5.000000 -1.000000 3.000000 \ No newline at end of file -- cgit v1.2.3-70-g09d2 From dd37959899d03fc33d59f725dbad4fe33b579725 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 25 Apr 2016 16:21:19 +0200 Subject: output with new lines --- var/spack/repos/builtin/packages/openblas/package.py | 15 +++++++++++---- .../repos/builtin/packages/openblas/test_cblas_dgemm.c | 5 ++--- .../builtin/packages/openblas/test_cblas_dgemm.output | 10 +++++++++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 252f699652..61250fb310 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -97,14 +97,21 @@ double B[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0}; double C[9] = {.5, .5, .5, .5, .5, .5, .5, .5, .5}; cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans, 3, 3, 2, 1, A, 3, B, 3, 2, C, 3); -for (i = 0; i < 8; i++) - printf("%lf ", C[i]); -printf("%lf", C[8]); +for (i = 0; i < 9; i++) + printf("%f\n", C[i]); return 0; } """ expected = """\ -11.000000 -9.000000 5.000000 -9.000000 21.000000 -1.000000 5.000000 -1.000000 3.000000\ +11.000000 +-9.000000 +5.000000 +-9.000000 +21.000000 +-1.000000 +5.000000 +-1.000000 +3.000000 """ with open("check.c", 'w') as f: f.write(source) diff --git a/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c index 37785bf47f..634e99d20b 100644 --- a/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c +++ b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.c @@ -7,8 +7,7 @@ double B[6] = {1.0, 2.0, 1.0, -3.0, 4.0, -1.0}; double C[9] = {.5, .5, .5, .5, .5, .5, .5, .5, .5}; cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans, 3, 3, 2, 1, A, 3, B, 3, 2, C, 3); -for (i = 0; i < 8; i++) - printf("%lf ", C[i]); -printf("%lf", C[8]); +for (i = 0; i < 9; i++) + printf("%f\n", C[i]); return 0; } diff --git a/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output index 490905aca0..b8316d7477 100644 --- a/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output +++ b/var/spack/repos/builtin/packages/openblas/test_cblas_dgemm.output @@ -1 +1,9 @@ -11.000000 -9.000000 5.000000 -9.000000 21.000000 -1.000000 5.000000 -1.000000 3.000000 \ No newline at end of file +11.000000 +-9.000000 +5.000000 +-9.000000 +21.000000 +-1.000000 +5.000000 +-1.000000 +3.000000 -- cgit v1.2.3-70-g09d2 From 17b73050868818f62af4f98a65b371f68a4e5e59 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Tue, 19 Apr 2016 21:09:54 +0200 Subject: Added package for Paradiseo. --- .../packages/paradiseo/enable_eoserial.patch | 14 +++++ .../packages/paradiseo/fix_osx_detection.patch | 13 +++++ .../builtin/packages/paradiseo/fix_tests.patch | 13 +++++ .../builtin/packages/paradiseo/fix_tutorials.patch | 13 +++++ .../repos/builtin/packages/paradiseo/package.py | 59 ++++++++++++++++++++++ 5 files changed, 112 insertions(+) create mode 100644 var/spack/repos/builtin/packages/paradiseo/enable_eoserial.patch create mode 100644 var/spack/repos/builtin/packages/paradiseo/fix_osx_detection.patch create mode 100644 var/spack/repos/builtin/packages/paradiseo/fix_tests.patch create mode 100644 var/spack/repos/builtin/packages/paradiseo/fix_tutorials.patch create mode 100644 var/spack/repos/builtin/packages/paradiseo/package.py diff --git a/var/spack/repos/builtin/packages/paradiseo/enable_eoserial.patch b/var/spack/repos/builtin/packages/paradiseo/enable_eoserial.patch new file mode 100644 index 0000000000..8b3ccfeb84 --- /dev/null +++ b/var/spack/repos/builtin/packages/paradiseo/enable_eoserial.patch @@ -0,0 +1,14 @@ +diff --git a/eo/src/CMakeLists.txt b/eo/src/CMakeLists.txt +index b2b445a..d45ddc7 100644 +--- a/eo/src/CMakeLists.txt ++++ b/eo/src/CMakeLists.txt +@@ -47,7 +47,7 @@ install(DIRECTORY do es ga gp other utils + add_subdirectory(es) + add_subdirectory(ga) + add_subdirectory(utils) +-#add_subdirectory(serial) ++add_subdirectory(serial) # Required when including , which is need by + + if(ENABLE_PYEO) + add_subdirectory(pyeo) + \ No newline at end of file diff --git a/var/spack/repos/builtin/packages/paradiseo/fix_osx_detection.patch b/var/spack/repos/builtin/packages/paradiseo/fix_osx_detection.patch new file mode 100644 index 0000000000..27b240f673 --- /dev/null +++ b/var/spack/repos/builtin/packages/paradiseo/fix_osx_detection.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/Config.cmake b/cmake/Config.cmake +index 02593ba..d198ca9 100644 +--- a/cmake/Config.cmake ++++ b/cmake/Config.cmake +@@ -6,7 +6,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + + # detect OS X version. (use '/usr/bin/sw_vers -productVersion' to extract V from '10.V.x'.) + execute_process (COMMAND /usr/bin/sw_vers -productVersion OUTPUT_VARIABLE MACOSX_VERSION_RAW) +- string(REGEX REPLACE "10\\.([0-9]).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}") ++ string(REGEX REPLACE "10\\.([0-9]+).*" "\\1" MACOSX_VERSION "${MACOSX_VERSION_RAW}") + if(${MACOSX_VERSION} LESS 5) + message(FATAL_ERROR "Unsupported version of OS X : ${MACOSX_VERSION_RAW}") + return() diff --git a/var/spack/repos/builtin/packages/paradiseo/fix_tests.patch b/var/spack/repos/builtin/packages/paradiseo/fix_tests.patch new file mode 100644 index 0000000000..607c5d5262 --- /dev/null +++ b/var/spack/repos/builtin/packages/paradiseo/fix_tests.patch @@ -0,0 +1,13 @@ +diff --git a/moeo/test/t-moeo2DMinHypervolumeArchive.cpp b/moeo/test/t-moeo2DMinHypervolumeArchive.cpp +index 994a9a4..c4ba77b 100644 +--- a/moeo/test/t-moeo2DMinHypervolumeArchive.cpp ++++ b/moeo/test/t-moeo2DMinHypervolumeArchive.cpp +@@ -41,7 +41,7 @@ + #include + #include + +-#include ++#include + + //----------------------------------------------------------------------------- + diff --git a/var/spack/repos/builtin/packages/paradiseo/fix_tutorials.patch b/var/spack/repos/builtin/packages/paradiseo/fix_tutorials.patch new file mode 100644 index 0000000000..14cb5fed74 --- /dev/null +++ b/var/spack/repos/builtin/packages/paradiseo/fix_tutorials.patch @@ -0,0 +1,13 @@ +diff --git a/eo/tutorial/Lesson3/exercise3.1.cpp b/eo/tutorial/Lesson3/exercise3.1.cpp +index dc37479..d178941 100644 +--- a/eo/tutorial/Lesson3/exercise3.1.cpp ++++ b/eo/tutorial/Lesson3/exercise3.1.cpp +@@ -289,7 +289,7 @@ void main_function(int argc, char **argv) + checkpoint.add(fdcStat); + + // The Stdout monitor will print parameters to the screen ... +- eoStdoutMonitor monitor(false); ++ eoStdoutMonitor monitor; + + // when called by the checkpoint (i.e. at every generation) + checkpoint.add(monitor); diff --git a/var/spack/repos/builtin/packages/paradiseo/package.py b/var/spack/repos/builtin/packages/paradiseo/package.py new file mode 100644 index 0000000000..c254234b32 --- /dev/null +++ b/var/spack/repos/builtin/packages/paradiseo/package.py @@ -0,0 +1,59 @@ +from spack import * +import sys + +class Paradiseo(Package): + """A C++ white-box object-oriented framework dedicated to the reusable design of metaheuristics.""" + homepage = "http://paradiseo.gforge.inria.fr/" + + # Installing from the development version is a better option at this + # point than using the very old supplied packages + version('head', git='https://gforge.inria.fr/git/paradiseo/paradiseo.git') + # This is a version that the package formula author has tested successfully. + # However, the clone is very large (~1Gb git history). The history in the + # head version has been trimmed significantly. + version('dev-safe', git='https://gforge.inria.fr/git/paradiseo/paradiseo.git', + commit='dbb8fbe9a786efd4d1c26408ac1883442e7643a6') + + variant('mpi', default=True, description='Compile with parallel and distributed metaheuristics module') + variant('smp', default=True, description='Compile with symmetric multi-processing module ') + variant('edo', default=True, description='Compile with (Experimental) EDO module') + #variant('tests', default=False, description='Compile with build tests') + #variant('doc', default=False, description='Compile with documentation') + variant('debug', default=False, description='Builds a debug version of the libraries') + + # Required dependencies + depends_on ("cmake") + depends_on ("eigen") + + # Optional dependencies + depends_on ("mpi", when="+mpi") + depends_on ("doxygen", when='+doc') + + # Patches + patch('enable_eoserial.patch') + patch('fix_osx_detection.patch') + patch('fix_tests.patch') + patch('fix_tutorials.patch') + + def install(self, spec, prefix): + options = [] + options.extend(std_cmake_args) + + options.extend([ + '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), + '-DINSTALL_TYPE:STRING=MIN', + '-DMPI:BOOL=%s' % ('TRUE' if '+mpi' in spec else 'FALSE'), + '-DSMP:BOOL=%s' % ('TRUE' if '+smp' in spec else 'FALSE'), # Note: This requires a C++11 compatible compiler + '-DEDO:BOOL=%s' % ('TRUE' if '+edo' in spec else 'FALSE'), + '-DENABLE_CMAKE_TESTING:BOOL=%s' % ('TRUE' if '+tests' in spec else 'FALSE') + ]) + + with working_dir('spack-build', create=True): + # Configure + cmake('..', *options) + + # Build, test and install + make("VERBOSE=1") + if '+tests' in spec: + make("test") + make("install") -- cgit v1.2.3-70-g09d2 From 168f9c46ea7f249fba3769cf1429348ca218eeae Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 26 Apr 2016 09:18:39 +0200 Subject: astyle: fix installation of the binary --- var/spack/repos/builtin/packages/astyle/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/astyle/package.py b/var/spack/repos/builtin/packages/astyle/package.py index 7260fd74a1..5274fc018f 100644 --- a/var/spack/repos/builtin/packages/astyle/package.py +++ b/var/spack/repos/builtin/packages/astyle/package.py @@ -14,4 +14,5 @@ class Astyle(Package): make('-f', join_path(self.stage.source_path,'build','clang','Makefile'), parallel=False) + mkdirp(self.prefix.bin) install(join_path(self.stage.source_path, 'src','bin','astyle'), self.prefix.bin) -- cgit v1.2.3-70-g09d2 From 8a45aa41854fbc1824401662f93e08d078109f6e Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 26 Apr 2016 12:52:49 +0200 Subject: p4est: add missing dependencies --- var/spack/repos/builtin/packages/p4est/package.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/p4est/package.py b/var/spack/repos/builtin/packages/p4est/package.py index 1e2969fe64..017c4e3fbf 100644 --- a/var/spack/repos/builtin/packages/p4est/package.py +++ b/var/spack/repos/builtin/packages/p4est/package.py @@ -7,10 +7,15 @@ class P4est(Package): version('1.1', '37ba7f4410958cfb38a2140339dbf64f') - # disable by default to make it work on frontend of clusters - variant('tests', default=False, description='Run small tests') + # build dependencies + depends_on('automake') + depends_on('autoconf') + depends_on('libtool@2.4.2:') + # other dependencies + depends_on('lua') # Needed for the submodule sc depends_on('mpi') + depends_on('zlib') def install(self, spec, prefix): options = ['--enable-mpi', @@ -28,7 +33,5 @@ class P4est(Package): configure('--prefix=%s' % prefix, *options) make() - if '+tests' in self.spec: - make("check") - + make("check") make("install") -- cgit v1.2.3-70-g09d2 From 0ff41206923dc9235b7f7341b514b4e2944d262d Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 26 Apr 2016 13:13:47 +0200 Subject: dealii: add missing dependencies --- var/spack/repos/builtin/packages/dealii/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 6810e86868..674fe3150a 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -50,8 +50,8 @@ class Dealii(Package): depends_on ("trilinos", when='+trilinos+mpi') # developer dependnecies - #depends_on ("numdiff") #FIXME - #depends_on ("astyle") #FIXME + depends_on ("numdiff", when='@dev') + depends_on ("astyle@2.04", when='@dev') def install(self, spec, prefix): options = [] -- cgit v1.2.3-70-g09d2 From 99b52e6e719efcee14cbba0a338c6593aad53422 Mon Sep 17 00:00:00 2001 From: alalazo Date: Tue, 26 Apr 2016 16:41:33 +0200 Subject: test-install : wip to add other information --- lib/spack/spack/cmd/test-install.py | 114 ++++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 51 deletions(-) diff --git a/lib/spack/spack/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py index 656873a2f0..733b58f252 100644 --- a/lib/spack/spack/cmd/test-install.py +++ b/lib/spack/spack/cmd/test-install.py @@ -23,36 +23,39 @@ # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## import argparse -import xml.etree.ElementTree as ET +import codecs import itertools -import re import os -import codecs +import re +import time +import xml.etree.ElementTree as ET import llnl.util.tty as tty -from llnl.util.filesystem import * - import spack +import spack.cmd +from llnl.util.filesystem import * from spack.build_environment import InstallError from spack.fetch_strategy import FetchError -import spack.cmd description = "Run package installation as a unit test, output formatted results." + def setup_parser(subparser): - subparser.add_argument( - '-j', '--jobs', action='store', type=int, - help="Explicitly set number of make jobs. Default is #cpus.") + subparser.add_argument('-j', + '--jobs', + action='store', + type=int, + help="Explicitly set number of make jobs. Default is #cpus.") - subparser.add_argument( - '-n', '--no-checksum', action='store_true', dest='no_checksum', - help="Do not check packages against checksum") + subparser.add_argument('-n', + '--no-checksum', + action='store_true', + dest='no_checksum', + help="Do not check packages against checksum") - subparser.add_argument( - '-o', '--output', action='store', help="test output goes in this file") + subparser.add_argument('-o', '--output', action='store', help="test output goes in this file") - subparser.add_argument( - 'package', nargs=argparse.REMAINDER, help="spec of package to install") + subparser.add_argument('package', nargs=argparse.REMAINDER, help="spec of package to install") class JunitResultFormat(object): @@ -102,8 +105,7 @@ class BuildId(object): if not isinstance(other, BuildId): return False - return ((self.name, self.version, self.hashId) == - (other.name, other.version, other.hashId)) + return ((self.name, self.version, self.hashId) == (other.name, other.version, other.hashId)) def fetch_log(path): @@ -114,14 +116,13 @@ def fetch_log(path): def failed_dependencies(spec): - return set(childSpec for childSpec in spec.dependencies.itervalues() if not - spack.repo.get(childSpec).installed) + return set(childSpec for childSpec in spec.dependencies.itervalues() if not spack.repo.get(childSpec).installed) -def create_test_output(topSpec, newInstalls, output, getLogFunc=fetch_log): +def create_test_output(top_spec, newInstalls, output, getLogFunc=fetch_log): # Post-order traversal is not strictly required but it makes sense to output # tests for dependencies first. - for spec in topSpec.traverse(order='post'): + for spec in top_spec.traverse(order='post'): if spec not in newInstalls: continue @@ -131,20 +132,17 @@ def create_test_output(topSpec, newInstalls, output, getLogFunc=fetch_log): result = TestResult.SKIPPED dep = iter(failedDeps).next() depBID = BuildId(dep) - errOutput = "Skipped due to failed dependency: {0}".format( - depBID.stringId()) + errOutput = "Skipped due to failed dependency: {0}".format(depBID.stringId()) elif (not package.installed) and (not package.stage.source_path): result = TestResult.FAILED errOutput = "Failure to fetch package resources." elif not package.installed: result = TestResult.FAILED lines = getLogFunc(package.build_log_path) - errMessages = list(line for line in lines if - re.search('error:', line, re.IGNORECASE)) + errMessages = list(line for line in lines if re.search('error:', line, re.IGNORECASE)) errOutput = errMessages if errMessages else lines[-10:] - errOutput = '\n'.join(itertools.chain( - [spec.to_yaml(), "Errors:"], errOutput, - ["Build Log:", package.build_log_path])) + errOutput = '\n'.join(itertools.chain([spec.to_yaml(), "Errors:"], errOutput, ["Build Log:", + package.build_log_path])) else: result = TestResult.PASSED errOutput = None @@ -153,7 +151,16 @@ def create_test_output(topSpec, newInstalls, output, getLogFunc=fetch_log): output.add_test(bId, result, errOutput) +def get_top_spec_or_die(args): + specs = spack.cmd.parse_specs(args.package, concretize=True) + if len(specs) > 1: + tty.die("Only 1 top-level package can be specified") + top_spec = iter(specs).next() + return top_spec + + def test_install(parser, args): + # Check the input if not args.package: tty.die("install requires a package argument") @@ -162,21 +169,13 @@ def test_install(parser, args): tty.die("The -j option must be a positive integer!") if args.no_checksum: - spack.do_checksum = False # TODO: remove this global. + spack.do_checksum = False # TODO: remove this global. - specs = spack.cmd.parse_specs(args.package, concretize=True) - if len(specs) > 1: - tty.die("Only 1 top-level package can be specified") - topSpec = iter(specs).next() - - newInstalls = set() - for spec in topSpec.traverse(): - package = spack.repo.get(spec) - if not package.installed: - newInstalls.add(spec) + # Get the one and only top spec + top_spec = get_top_spec_or_die(args) if not args.output: - bId = BuildId(topSpec) + bId = BuildId(top_spec) outputDir = join_path(os.getcwd(), "test-output") if not os.path.exists(outputDir): os.mkdir(outputDir) @@ -184,20 +183,27 @@ def test_install(parser, args): else: outputFpath = args.output - for spec in topSpec.traverse(order='post'): + new_installs = set() + for spec in top_spec.traverse(order='post'): # Calling do_install for the top-level package would be sufficient but # this attempts to keep going if any package fails (other packages which # are not dependents may succeed) package = spack.repo.get(spec) + + if not package.installed: + new_installs.add(spec) + + duration = 0.0 if (not failed_dependencies(spec)) and (not package.installed): try: - package.do_install( - keep_prefix=False, - keep_stage=True, - ignore_deps=False, - make_jobs=args.jobs, - verbose=True, - fake=False) + start_time = time.time() + package.do_install(keep_prefix=False, + keep_stage=True, + ignore_deps=False, + make_jobs=args.jobs, + verbose=True, + fake=False) + duration = time.time() - start_time except InstallError: pass except FetchError: @@ -205,7 +211,13 @@ def test_install(parser, args): jrf = JunitResultFormat() handled = {} - create_test_output(topSpec, newInstalls, jrf) + create_test_output(top_spec, new_installs, jrf) with open(outputFpath, 'wb') as F: - jrf.write_to(F) + jrf.write_to(F) + + # with JunitTestSuite(filename) as test_suite: + # for spec in top_spec.traverse(order='post'): + # test_case = install_test(spec) + # test_suite.append( test_case ) + # -- cgit v1.2.3-70-g09d2 From f70046e6b713f783288afac3359ccba6bfd8e233 Mon Sep 17 00:00:00 2001 From: Geoffrey Oxberry Date: Tue, 26 Apr 2016 10:00:24 -0700 Subject: MFEM version 3.1 (#749) MFEM is a free, lightweight, scalable C++ library for finite element methods. Includes lapack, hypre, metis, suite-sparse, mpi variants & tests for serial and parallel versions. --- var/spack/repos/builtin/packages/mfem/package.py | 125 +++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 var/spack/repos/builtin/packages/mfem/package.py diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py new file mode 100644 index 0000000000..510e09c4e1 --- /dev/null +++ b/var/spack/repos/builtin/packages/mfem/package.py @@ -0,0 +1,125 @@ +from spack import * +import glob, string + +class Mfem(Package): + """Free, lightweight, scalable C++ library for finite element methods.""" + + homepage = 'http://www.mfem.org' + url = 'https://github.com/mfem/mfem' + +# version('3.1', git='https://github.com/mfem/mfem.git', +# commit='dbae60fe32e071989b52efaaf59d7d0eb2a3b574') + + version('3.1', '841ea5cf58de6fae4de0f553b0e01ebaab9cd9c67fa821e8a715666ecf18fc57', + url='http://goo.gl/xrScXn', expand=False) + + variant('metis', default=False, description='Activate support for metis') + variant('hypre', default=False, description='Activate support for hypre') + variant('suite-sparse', default=False, + description='Activate support for SuiteSparse') + variant('mpi', default=False, description='Activate support for MPI') + variant('lapack', default=False, description='Activate support for LAPACK') + variant('debug', default=False, description='Build debug version') + + depends_on('blas', when='+lapack') + depends_on('lapack', when='+lapack') + + depends_on('mpi', when='+mpi') + depends_on('metis', when='+mpi') + depends_on('hypre', when='+mpi') + + depends_on('hypre', when='+hypre') + + depends_on('metis@4:', when='+metis') + + depends_on('suite-sparse', when='+suite-sparse') + depends_on('blas', when='+suite-sparse') + depends_on('lapack', when='+suite-sparse') + depends_on('metis@5:', when='+suite-sparse ^suite-sparse@4.5:') + depends_on('cmake', when='^metis@5:') + + def check_variants(self, spec): + if '+mpi' in spec and ('+hypre' not in spec or '+metis' not in spec): + raise InstallError('mfem+mpi must be built with +hypre ' + + 'and +metis!') + if '+suite-sparse' in spec and ('+metis' not in spec or + '+lapack' not in spec): + raise InstallError('mfem+suite-sparse must be built with ' + + '+metis and +lapack!') + if 'metis@5:' in spec and '%clang' in spec and ('^cmake %gcc' not in spec): + raise InstallError('To work around CMake bug with clang, must ' + + 'build mfem with mfem[+variants] %clang ' + + '^cmake %gcc to force CMake to build with gcc') + return + + def install(self, spec, prefix): + self.check_variants(spec) + + options = ['PREFIX=%s' % prefix] + + if '+lapack' in spec: + lapack_lib = '-L{0} -llapack -L{1} -lblas'.format( + spec['lapack'].prefix.lib, spec['blas'].prefix.lib) + options.extend(['MFEM_USE_LAPACK=YES', + 'LAPACK_OPT=-I%s' % spec['lapack'].prefix.include, + 'LAPACK_LIB=%s' % lapack_lib]) + + if '+hypre' in spec: + options.extend(['HYPRE_DIR=%s' % spec['hypre'].prefix, + 'HYPRE_OPT=-I%s' % spec['hypre'].prefix.include, + 'HYPRE_LIB=-L%s' % spec['hypre'].prefix.lib + + ' -lHYPRE']) + + if '+metis' in spec: + metis_lib = '-L%s -lmetis' % spec['metis'].prefix.lib + if spec['metis'].satisfies('@5:'): + metis_str = 'MFEM_USE_METIS_5=YES' + else: + metis_str = 'MFEM_USE_METIS_5=NO' + options.extend([metis_str, + 'METIS_DIR=%s' % spec['metis'].prefix, + 'METIS_OPT=-I%s' % spec['metis'].prefix.include, + 'METIS_LIB=%s' % metis_lib]) + + if '+mpi' in spec: options.extend(['MFEM_USE_MPI=YES']) + + if '+suite-sparse' in spec: + ssp = spec['suite-sparse'].prefix + ss_lib = '-L%s' % ssp.lib + ss_lib += (' -lumfpack -lcholmod -lcolamd -lamd -lcamd' + + ' -lccolamd -lsuitesparseconfig') + + no_librt_archs = ['darwin-i686', 'darwin-x86_64'] + no_rt = any(map(lambda a: spec.satisfies('='+a), no_librt_archs)) + if not no_rt: ss_lib += ' -lrt' + ss_lib += (' ' + metis_lib + ' ' + lapack_lib) + + options.extend(['MFEM_USE_SUITESPARSE=YES', + 'SUITESPARSE_DIR=%s' % ssp, + 'SUITESPARSE_OPT=-I%s' % ssp.include, + 'SUITESPARSE_LIB=%s' % ss_lib]) + + if '+debug' in spec: options.extend(['MFEM_DEBUG=YES']) + + # Dirty hack to cope with URL redirect + tgz_file = string.split(self.url,'/')[-1] + tar = which('tar') + tar('xzvf', tgz_file) + cd(glob.glob('mfem*')[0]) + # End dirty hack to cope with URL redirect + + make('config', *options) + make('all') + + # Run a small test before installation + args = ['-m', join_path('data','star.mesh'), '--no-visualization'] + if '+mpi' in spec: + Executable(join_path(spec['mpi'].prefix.bin, + 'mpirun'))('-np', + '4', + join_path('examples','ex1p'), + *args) + else: + Executable(join_path('examples', 'ex1'))(*args) + + make('install') -- cgit v1.2.3-70-g09d2 From 603467785b5ea00a1dac43e64e1565a6bdc732ef Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 26 Apr 2016 13:00:54 -0400 Subject: Compiler find docs (#831) * docs: mention `spack compiler find` * docs: fix some weird wording. --- lib/spack/docs/basic_usage.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst index 0e603813e1..29791d98c4 100644 --- a/lib/spack/docs/basic_usage.rst +++ b/lib/spack/docs/basic_usage.rst @@ -372,25 +372,32 @@ how this is done is in :ref:`sec-specs`. ``spack compiler add`` ~~~~~~~~~~~~~~~~~~~~~~~ +An alias for ``spack compiler find``. + +.. _spack-compiler-find: + +``spack compiler find`` +~~~~~~~~~~~~~~~~~~~~~~~ + If you do not see a compiler in this list, but you want to use it with -Spack, you can simply run ``spack compiler add`` with the path to +Spack, you can simply run ``spack compiler find`` with the path to where the compiler is installed. For example:: - $ spack compiler add /usr/local/tools/ic-13.0.079 + $ spack compiler find /usr/local/tools/ic-13.0.079 ==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml intel@13.0.079 -Or you can run ``spack compiler add`` with no arguments to force +Or you can run ``spack compiler find`` with no arguments to force auto-detection. This is useful if you do not know where compilers are installed, but you know that new compilers have been added to your ``PATH``. For example, using dotkit, you might do this:: $ module load gcc-4.9.0 - $ spack compiler add + $ spack compiler find ==> Added 1 new compiler to /Users/gamblin2/.spack/compilers.yaml gcc@4.9.0 -This loads the environment module for gcc-4.9.0 to get it into the +This loads the environment module for gcc-4.9.0 to add it to ``PATH``, and then it adds the compiler to Spack. .. _spack-compiler-info: -- cgit v1.2.3-70-g09d2 From 8e227f603d0c158e9f71a0bc0a815d977415908c Mon Sep 17 00:00:00 2001 From: jppelteret Date: Tue, 26 Apr 2016 19:01:09 +0200 Subject: Fix: Add missing dependencies for gmp and eigen (#830) See https://groups.google.com/forum/#!topic/spack/9JMDwafjBUs --- var/spack/repos/builtin/packages/eigen/package.py | 1 + var/spack/repos/builtin/packages/gmp/package.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py index 1501989812..6b38ab0261 100644 --- a/var/spack/repos/builtin/packages/eigen/package.py +++ b/var/spack/repos/builtin/packages/eigen/package.py @@ -45,6 +45,7 @@ class Eigen(Package): # TODO : dependency on googlehash, superlu, adolc missing + depends_on('cmake') depends_on('metis@5:', when='+metis') depends_on('scotch', when='+scotch') depends_on('fftw', when='+fftw') diff --git a/var/spack/repos/builtin/packages/gmp/package.py b/var/spack/repos/builtin/packages/gmp/package.py index fe13de3b95..85e9c237d6 100644 --- a/var/spack/repos/builtin/packages/gmp/package.py +++ b/var/spack/repos/builtin/packages/gmp/package.py @@ -35,6 +35,8 @@ class Gmp(Package): version('6.0.0a', 'b7ff2d88cae7f8085bd5006096eed470') version('6.0.0' , '6ef5869ae735db9995619135bd856b84') + depends_on("m4") + def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() -- cgit v1.2.3-70-g09d2 From 8ec5e8118643223c00b3106fb4e4f1204821e380 Mon Sep 17 00:00:00 2001 From: Joseph Ciurej Date: Tue, 26 Apr 2016 10:24:36 -0700 Subject: Update Package : Zoltan (#833) * Added preliminary implementations for the debug and shared variants. * Fixed a few problems with the '+shared' variant of the Zoltan package. Added support for a few more important Zoltan package versions. * Fixed a minor compiler incompatibility issue with the '+shared+mpi' variants. --- var/spack/repos/builtin/packages/zoltan/package.py | 35 +++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/zoltan/package.py b/var/spack/repos/builtin/packages/zoltan/package.py index e20ae81adb..738dfb508b 100644 --- a/var/spack/repos/builtin/packages/zoltan/package.py +++ b/var/spack/repos/builtin/packages/zoltan/package.py @@ -1,3 +1,4 @@ +import re, os, glob from spack import * class Zoltan(Package): @@ -12,8 +13,13 @@ class Zoltan(Package): base_url = "http://www.cs.sandia.gov/~kddevin/Zoltan_Distributions" version('3.83', '1ff1bc93f91e12f2c533ddb01f2c095f') + version('3.8', '9d8fba8a990896881b85351d4327c4a9') + version('3.6', '9cce794f7241ecd8dbea36c3d7a880f9') version('3.3', '5eb8f00bda634b25ceefa0122bd18d65') + variant('debug', default=False, description='Builds a debug version of the library') + variant('shared', default=True, description='Builds a shared version of the library') + variant('fortran', default=True, description='Enable Fortran support') variant('mpi', default=False, description='Enable MPI support') @@ -24,28 +30,49 @@ class Zoltan(Package): '--enable-f90interface' if '+fortan' in spec else '--disable-f90interface', '--enable-mpi' if '+mpi' in spec else '--disable-mpi', ] + config_cflags = [ + '-O0' if '+debug' in spec else '-O3', + '-g' if '+debug' in spec else '-g0', + ] + + if '+shared' in spec: + config_args.append('--with-ar=$(CXX) -shared $(LDFLAGS) -o') + config_args.append('RANLIB=echo') + config_cflags.append('-fPIC') if '+mpi' in spec: - config_args.append('--with-mpi=%s' % spec['mpi'].prefix) - config_args.append('--with-mpi-compilers=%s' % spec['mpi'].prefix.bin) config_args.append('CC=%s/mpicc' % spec['mpi'].prefix.bin) config_args.append('CXX=%s/mpicxx' % spec['mpi'].prefix.bin) + config_args.append('--with-mpi=%s' % spec['mpi'].prefix) + config_args.append('--with-mpi-compilers=%s' % spec['mpi'].prefix.bin) # NOTE: Early versions of Zoltan come packaged with a few embedded # library packages (e.g. ParMETIS, Scotch), which messes with Spack's # ability to descend directly into the package's source directory. - if spec.satisfies('@:3.3'): + if spec.satisfies('@:3.6'): cd('Zoltan_v%s' % self.version) mkdirp('build') cd('build') config_zoltan = Executable('../configure') - config_zoltan('--prefix=%s' % pwd(), *config_args) + config_zoltan( + '--prefix=%s' % pwd(), + '--with-cflags=%s' % ' '.join(config_cflags), + '--with-cxxflags=%s' % ' '.join(config_cflags), + *config_args) make() make('install') + # NOTE: Unfortunately, Zoltan doesn't provide any configuration options for + # the extension of the output library files, so this script must change these + # extensions as a post-processing step. + if '+shared' in spec: + for libpath in glob.glob('lib/*.a'): + libdir, libname = (os.path.dirname(libpath), os.path.basename(libpath)) + move(libpath, os.path.join(libdir, re.sub(r'\.a$', '.so', libname))) + mkdirp(prefix) move('include', prefix) move('lib', prefix) -- cgit v1.2.3-70-g09d2 From b56bfcea968fb6fb2a81a08804258300178c4b05 Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Tue, 26 Apr 2016 12:31:48 -0500 Subject: Add the turbomole package. (#826) * Add the turbomole package. This package has three modes of operation that need to be selected independently. This is handled with spack vaiants. Turbomole has a builtin MPI implementation so it does not need to depend on an mpi provider when using the +mpi variant. * Whitespace cleanup. --- .../repos/builtin/packages/turbomole/package.py | 124 +++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 var/spack/repos/builtin/packages/turbomole/package.py diff --git a/var/spack/repos/builtin/packages/turbomole/package.py b/var/spack/repos/builtin/packages/turbomole/package.py new file mode 100644 index 0000000000..acc95e3b10 --- /dev/null +++ b/var/spack/repos/builtin/packages/turbomole/package.py @@ -0,0 +1,124 @@ +from spack import * +import os +import subprocess + +class Turbomole(Package): + """TURBOMOLE: Program Package for ab initio Electronic Structure + Calculations. NB: Requires a license to download.""" + + # NOTE: Turbomole requires purchase of a license to download. Go to the + # NOTE: Turbomole home page, http://www.turbomole-gmbh.com, for details. + # NOTE: Spack will search the current directory for this file. It is + # NOTE: probably best to add this file to a Spack mirror so that it can be + # NOTE: found from anywhere. For information on setting up a Spack mirror + # NOTE: see http://software.llnl.gov/spack/mirrors.html + + homepage = "http://www.turbomole-gmbh.com/" + + version('7.0.2', '92b97e1e52e8dcf02a4d9ac0147c09d6', + url="file://%s/turbolinux702.tar.gz" % os.getcwd()) + + variant('mpi', default=False, description='Set up MPI environment') + variant('smp', default=False, description='Set up SMP environment') + + # Turbomole's install is odd. There are three variants + # - serial + # - parallel, MPI + # - parallel, SMP + # + # Only one of these can be active at a time. MPI and SMP are set as + # variants so there could be up to 3 installs per version. Switching + # between them would be accomplished with `module swap` commands. + + def do_fetch(self, mirror_only=True): + if '+mpi' in self.spec and '+smp' in self.spec: + raise InstallError('Can not have both SMP and MPI enabled in the same build.') + super(Turbomole, self).do_fetch(mirror_only) + + def get_tm_arch(self): + # For python-2.7 we could use `tm_arch = subprocess.check_output()` + # Use the following for compatibility with python 2.6 + if 'TURBOMOLE' in os.getcwd(): + tm_arch = subprocess.Popen(['sh', 'scripts/sysname'], + stdout=subprocess.PIPE).communicate()[0] + return tm_arch.rstrip('\n') + else: + return + + def install(self, spec, prefix): + if spec.satisfies('@:7.0.2'): + calculate_version = 'calculate_2.4_linux64' + molecontrol_version = 'MoleControl_2.5' + + tm_arch=self.get_tm_arch() + + tar = which('tar') + dst = join_path(prefix, 'TURBOMOLE') + + tar('-x', '-z', '-f', 'thermocalc.tar.gz') + with working_dir('thermocalc'): + cmd = 'sh install << Date: Tue, 26 Apr 2016 12:32:14 -0500 Subject: Put f2py of py-numpy in python ignore list. (#827) There are many python packages that depend on py-numpy. Each one of those will have a copy of f2py that will need to be put in the ignore list for activation. Thise PR adds f2py to the ignore list in the python package.py file so that it does not have to be done for each package that depends on py-numpy. This follows the model of what is done for py-setuptools. This PR also removes the f2py ignore expression for python packages that were using it as it is no longer needed in the individual packages. --- var/spack/repos/builtin/packages/py-bottleneck/package.py | 2 +- var/spack/repos/builtin/packages/py-matplotlib/package.py | 2 +- var/spack/repos/builtin/packages/py-numexpr/package.py | 2 +- var/spack/repos/builtin/packages/py-pandas/package.py | 2 +- var/spack/repos/builtin/packages/py-scikit-image/package.py | 2 +- var/spack/repos/builtin/packages/python/package.py | 2 ++ 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-bottleneck/package.py b/var/spack/repos/builtin/packages/py-bottleneck/package.py index 0aa4208b4d..d43308543b 100644 --- a/var/spack/repos/builtin/packages/py-bottleneck/package.py +++ b/var/spack/repos/builtin/packages/py-bottleneck/package.py @@ -7,7 +7,7 @@ class PyBottleneck(Package): version('1.0.0', '380fa6f275bd24f27e7cf0e0d752f5d2') - extends('python', ignore=r'bin/f2py$') + extends('python') depends_on('py-numpy') def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/py-matplotlib/package.py b/var/spack/repos/builtin/packages/py-matplotlib/package.py index 19194c942e..1a190cc5f3 100644 --- a/var/spack/repos/builtin/packages/py-matplotlib/package.py +++ b/var/spack/repos/builtin/packages/py-matplotlib/package.py @@ -12,7 +12,7 @@ class PyMatplotlib(Package): variant('gui', default=False, description='Enable GUI') variant('ipython', default=False, description='Enable ipython support') - extends('python', ignore=r'bin/nosetests.*$|bin/pbr$|bin/f2py$') + extends('python', ignore=r'bin/nosetests.*$|bin/pbr$') depends_on('py-pyside', when='+gui') depends_on('py-ipython', when='+ipython') diff --git a/var/spack/repos/builtin/packages/py-numexpr/package.py b/var/spack/repos/builtin/packages/py-numexpr/package.py index 081a79dec6..0076aa456b 100644 --- a/var/spack/repos/builtin/packages/py-numexpr/package.py +++ b/var/spack/repos/builtin/packages/py-numexpr/package.py @@ -9,7 +9,7 @@ class PyNumexpr(Package): version('2.4.6', '17ac6fafc9ea1ce3eb970b9abccb4fbd') version('2.5', '84f66cced45ba3e30dcf77a937763aaa') - extends('python', ignore=r'bin/f2py$') + extends('python') depends_on('py-numpy') def install(self, spec, prefix): diff --git a/var/spack/repos/builtin/packages/py-pandas/package.py b/var/spack/repos/builtin/packages/py-pandas/package.py index 2320b1f92f..59d515eb5e 100644 --- a/var/spack/repos/builtin/packages/py-pandas/package.py +++ b/var/spack/repos/builtin/packages/py-pandas/package.py @@ -10,7 +10,7 @@ class PyPandas(Package): version('0.16.1', 'fac4f25748f9610a3e00e765474bdea8') version('0.18.0', 'f143762cd7a59815e348adf4308d2cf6') - extends('python', ignore=r'bin/f2py$') + extends('python') depends_on('py-dateutil') depends_on('py-numpy') depends_on('py-setuptools') diff --git a/var/spack/repos/builtin/packages/py-scikit-image/package.py b/var/spack/repos/builtin/packages/py-scikit-image/package.py index 22ce1f8374..d13339060e 100644 --- a/var/spack/repos/builtin/packages/py-scikit-image/package.py +++ b/var/spack/repos/builtin/packages/py-scikit-image/package.py @@ -7,7 +7,7 @@ class PyScikitImage(Package): version('0.12.3', '04ea833383e0b6ad5f65da21292c25e1') - extends('python', ignore=r'bin/.*\.py$|bin/f2py$') + extends('python', ignore=r'bin/.*\.py$') depends_on('py-dask') depends_on('py-pillow') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index f5237c3b57..f7e1d94567 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -151,6 +151,8 @@ class Python(Package): patterns.append(r'setuptools\.pth') patterns.append(r'bin/easy_install[^/]*$') patterns.append(r'setuptools.*egg$') + if ext_pkg.name != 'py-numpy': + patterns.append(r'bin/f2py$') return match_predicate(ignore_arg, patterns) -- cgit v1.2.3-70-g09d2 From 12dbd65f4cbf3218155b86b5f9b1281198a2453d Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 27 Apr 2016 13:56:32 +0200 Subject: test-install : first draft that works --- lib/spack/spack/cmd/test-install.py | 249 ++++++++++++++++++------------------ 1 file changed, 125 insertions(+), 124 deletions(-) diff --git a/lib/spack/spack/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py index 733b58f252..c214cd3f66 100644 --- a/lib/spack/spack/cmd/test-install.py +++ b/lib/spack/spack/cmd/test-install.py @@ -24,10 +24,9 @@ ############################################################################## import argparse import codecs -import itertools import os -import re import time +import xml.dom.minidom import xml.etree.ElementTree as ET import llnl.util.tty as tty @@ -58,54 +57,72 @@ def setup_parser(subparser): subparser.add_argument('package', nargs=argparse.REMAINDER, help="spec of package to install") -class JunitResultFormat(object): - def __init__(self): - self.root = ET.Element('testsuite') - self.tests = [] - - def add_test(self, buildId, testResult, buildInfo=None): - self.tests.append((buildId, testResult, buildInfo)) - - def write_to(self, stream): - self.root.set('tests', '{0}'.format(len(self.tests))) - for buildId, testResult, buildInfo in self.tests: - testcase = ET.SubElement(self.root, 'testcase') - testcase.set('classname', buildId.name) - testcase.set('name', buildId.stringId()) - if testResult == TestResult.FAILED: - failure = ET.SubElement(testcase, 'failure') - failure.set('type', "Build Error") - failure.text = buildInfo - elif testResult == TestResult.SKIPPED: - skipped = ET.SubElement(testcase, 'skipped') - skipped.set('type', "Skipped Build") - skipped.text = buildInfo - ET.ElementTree(self.root).write(stream) - - class TestResult(object): PASSED = 0 FAILED = 1 SKIPPED = 2 + ERRORED = 3 -class BuildId(object): - def __init__(self, spec): - self.name = spec.name - self.version = spec.version - self.hashId = spec.dag_hash() - - def stringId(self): - return "-".join(str(x) for x in (self.name, self.version, self.hashId)) - - def __hash__(self): - return hash((self.name, self.version, self.hashId)) - - def __eq__(self, other): - if not isinstance(other, BuildId): - return False +class TestSuite(object): + def __init__(self, filename): + self.filename = filename + self.root = ET.Element('testsuite') + self.tests = [] - return ((self.name, self.version, self.hashId) == (other.name, other.version, other.hashId)) + def __enter__(self): + return self + + def append(self, item): + if not isinstance(item, TestCase): + raise TypeError('only TestCase instances may be appended to a TestSuite instance') + self.tests.append(item) # Append the item to the list of tests + + def __exit__(self, exc_type, exc_val, exc_tb): + # Prepare the header for the entire test suite + number_of_errors = sum(x.result_type == TestResult.ERRORED for x in self.tests) + self.root.set('errors', str(number_of_errors)) + number_of_failures = sum(x.result_type == TestResult.FAILED for x in self.tests) + self.root.set('failures', str(number_of_failures)) + self.root.set('tests', str(len(self.tests))) + + for item in self.tests: + self.root.append(item.element) + + with open(self.filename, 'wb') as file: + xml_string = ET.tostring(self.root) + xml_string = xml.dom.minidom.parseString(xml_string).toprettyxml() + file.write(xml_string) + + +class TestCase(object): + + results = { + TestResult.PASSED: None, + TestResult.SKIPPED: 'skipped', + TestResult.FAILED: 'failure', + TestResult.ERRORED: 'error', + } + + def __init__(self, classname, name, time=None): + self.element = ET.Element('testcase') + self.element.set('classname', str(classname)) + self.element.set('name', str(name)) + if time is not None: + self.element.set('time', str(time)) + self.result_type = None + + def set_result(self, result_type, message=None, error_type=None, text=None): + self.result_type = result_type + result = TestCase.results[self.result_type] + if result is not None: + subelement = ET.SubElement(self.element, result) + if error_type is not None: + subelement.set('type', error_type) + if message is not None: + subelement.set('message', str(message)) + if text is not None: + subelement.text = text def fetch_log(path): @@ -116,39 +133,7 @@ def fetch_log(path): def failed_dependencies(spec): - return set(childSpec for childSpec in spec.dependencies.itervalues() if not spack.repo.get(childSpec).installed) - - -def create_test_output(top_spec, newInstalls, output, getLogFunc=fetch_log): - # Post-order traversal is not strictly required but it makes sense to output - # tests for dependencies first. - for spec in top_spec.traverse(order='post'): - if spec not in newInstalls: - continue - - failedDeps = failed_dependencies(spec) - package = spack.repo.get(spec) - if failedDeps: - result = TestResult.SKIPPED - dep = iter(failedDeps).next() - depBID = BuildId(dep) - errOutput = "Skipped due to failed dependency: {0}".format(depBID.stringId()) - elif (not package.installed) and (not package.stage.source_path): - result = TestResult.FAILED - errOutput = "Failure to fetch package resources." - elif not package.installed: - result = TestResult.FAILED - lines = getLogFunc(package.build_log_path) - errMessages = list(line for line in lines if re.search('error:', line, re.IGNORECASE)) - errOutput = errMessages if errMessages else lines[-10:] - errOutput = '\n'.join(itertools.chain([spec.to_yaml(), "Errors:"], errOutput, ["Build Log:", - package.build_log_path])) - else: - result = TestResult.PASSED - errOutput = None - - bId = BuildId(spec) - output.add_test(bId, result, errOutput) + return set(item for item in spec.dependencies.itervalues() if not spack.repo.get(item).installed) def get_top_spec_or_die(args): @@ -159,6 +144,62 @@ def get_top_spec_or_die(args): return top_spec +def install_single_spec(spec, number_of_jobs): + package = spack.repo.get(spec) + + # If it is already installed, skip the test + if spack.repo.get(spec).installed: + testcase = TestCase(package.name, package.spec.short_spec, time=0.0) + testcase.set_result(TestResult.SKIPPED, message='Skipped [already installed]', error_type='already_installed') + return testcase + + # If it relies on dependencies that did not install, skip + if failed_dependencies(spec): + testcase = TestCase(package.name, package.spec.short_spec, time=0.0) + testcase.set_result(TestResult.SKIPPED, message='Skipped [failed dependencies]', error_type='dep_failed') + return testcase + + # Otherwise try to install the spec + try: + start_time = time.time() + package.do_install(keep_prefix=False, + keep_stage=True, + ignore_deps=False, + make_jobs=number_of_jobs, + verbose=True, + fake=False) + duration = time.time() - start_time + testcase = TestCase(package.name, package.spec.short_spec, duration) + except InstallError: + # An InstallError is considered a failure (the recipe didn't work correctly) + duration = time.time() - start_time + # Try to get the log + lines = fetch_log(package.build_log_path) + text = '\n'.join(lines) + testcase = TestCase(package.name, package.spec.short_spec, duration) + testcase.set_result(TestResult.FAILED, message='Installation failure', text=text) + + except FetchError: + # A FetchError is considered an error (we didn't even start building) + duration = time.time() - start_time + testcase = TestCase(package.name, package.spec.short_spec, duration) + testcase.set_result(TestResult.ERRORED, message='Unable to fetch package') + + return testcase + + +def get_filename(args, top_spec): + if not args.output: + fname = 'test-{x.name}-{x.version}-{hash}.xml'.format(x=top_spec, hash=top_spec.dag_hash()) + output_directory = join_path(os.getcwd(), 'test-output') + if not os.path.exists(output_directory): + os.mkdir(output_directory) + output_filename = join_path(output_directory, fname) + else: + output_filename = args.output + return output_filename + + def test_install(parser, args): # Check the input if not args.package: @@ -173,51 +214,11 @@ def test_install(parser, args): # Get the one and only top spec top_spec = get_top_spec_or_die(args) - - if not args.output: - bId = BuildId(top_spec) - outputDir = join_path(os.getcwd(), "test-output") - if not os.path.exists(outputDir): - os.mkdir(outputDir) - outputFpath = join_path(outputDir, "test-{0}.xml".format(bId.stringId())) - else: - outputFpath = args.output - - new_installs = set() - for spec in top_spec.traverse(order='post'): - # Calling do_install for the top-level package would be sufficient but - # this attempts to keep going if any package fails (other packages which - # are not dependents may succeed) - package = spack.repo.get(spec) - - if not package.installed: - new_installs.add(spec) - - duration = 0.0 - if (not failed_dependencies(spec)) and (not package.installed): - try: - start_time = time.time() - package.do_install(keep_prefix=False, - keep_stage=True, - ignore_deps=False, - make_jobs=args.jobs, - verbose=True, - fake=False) - duration = time.time() - start_time - except InstallError: - pass - except FetchError: - pass - - jrf = JunitResultFormat() - handled = {} - create_test_output(top_spec, new_installs, jrf) - - with open(outputFpath, 'wb') as F: - jrf.write_to(F) - - # with JunitTestSuite(filename) as test_suite: - # for spec in top_spec.traverse(order='post'): - # test_case = install_test(spec) - # test_suite.append( test_case ) - # + # Get the filename of the test + output_filename = get_filename(args, top_spec) + # TEST SUITE + with TestSuite(output_filename) as test_suite: + # Traverse in post order : each spec is a test case + for spec in top_spec.traverse(order='post'): + test_case = install_single_spec(spec, args.jobs) + test_suite.append(test_case) -- cgit v1.2.3-70-g09d2 From 42fab1591d9fc0b140d33d68ef27d3fe401178e4 Mon Sep 17 00:00:00 2001 From: alalazo Date: Wed, 27 Apr 2016 17:19:03 +0200 Subject: test-install : fixed unit tests --- lib/spack/spack/cmd/test-install.py | 3 +- lib/spack/spack/test/__init__.py | 3 +- lib/spack/spack/test/cmd/test_install.py | 191 +++++++++++++++++++++++++++++++ lib/spack/spack/test/unit_install.py | 126 -------------------- 4 files changed, 195 insertions(+), 128 deletions(-) create mode 100644 lib/spack/spack/test/cmd/test_install.py delete mode 100644 lib/spack/spack/test/unit_install.py diff --git a/lib/spack/spack/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py index c214cd3f66..e323969634 100644 --- a/lib/spack/spack/cmd/test-install.py +++ b/lib/spack/spack/cmd/test-install.py @@ -115,7 +115,7 @@ class TestCase(object): def set_result(self, result_type, message=None, error_type=None, text=None): self.result_type = result_type result = TestCase.results[self.result_type] - if result is not None: + if result is not None or result is not TestResult.PASSED: subelement = ET.SubElement(self.element, result) if error_type is not None: subelement.set('type', error_type) @@ -170,6 +170,7 @@ def install_single_spec(spec, number_of_jobs): fake=False) duration = time.time() - start_time testcase = TestCase(package.name, package.spec.short_spec, duration) + testcase.set_result(TestResult.PASSED) except InstallError: # An InstallError is considered a failure (the recipe didn't work correctly) duration = time.time() - start_time diff --git a/lib/spack/spack/test/__init__.py b/lib/spack/spack/test/__init__.py index 175a49428c..bea41a4adf 100644 --- a/lib/spack/spack/test/__init__.py +++ b/lib/spack/spack/test/__init__.py @@ -68,7 +68,8 @@ test_names = ['versions', 'yaml', 'sbang', 'environment', - 'cmd.uninstall'] + 'cmd.uninstall', + 'cmd.test_install'] def list_tests(): diff --git a/lib/spack/spack/test/cmd/test_install.py b/lib/spack/spack/test/cmd/test_install.py new file mode 100644 index 0000000000..1860622ad6 --- /dev/null +++ b/lib/spack/spack/test/cmd/test_install.py @@ -0,0 +1,191 @@ +############################################################################## +# 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 +############################################################################## +import collections +from contextlib import contextmanager + +import StringIO + +FILE_REGISTRY = collections.defaultdict(StringIO.StringIO) + +# Monkey-patch open to write module files to a StringIO instance +@contextmanager +def mock_open(filename, mode): + if not mode == 'wb': + raise RuntimeError('test.test_install : unexpected opening mode for monkey-patched open') + + FILE_REGISTRY[filename] = StringIO.StringIO() + + try: + yield FILE_REGISTRY[filename] + finally: + handle = FILE_REGISTRY[filename] + FILE_REGISTRY[filename] = handle.getvalue() + handle.close() + +import os +import itertools +import unittest + +import spack +import spack.cmd + + +# The use of __import__ is necessary to maintain a name with hyphen (which cannot be an identifier in python) +test_install = __import__("spack.cmd.test-install", fromlist=['test_install']) + + +class MockSpec(object): + def __init__(self, name, version, hashStr=None): + self.dependencies = {} + self.name = name + self.version = version + self.hash = hashStr if hashStr else hash((name, version)) + + def traverse(self, order=None): + for _, spec in self.dependencies.items(): + yield spec + yield self + #allDeps = itertools.chain.from_iterable(i.traverse() for i in self.dependencies.itervalues()) + #return set(itertools.chain([self], allDeps)) + + def dag_hash(self): + return self.hash + + @property + def short_spec(self): + return '-'.join([self.name, str(self.version), str(self.hash)]) + + +class MockPackage(object): + def __init__(self, spec, buildLogPath): + self.name = spec.name + self.spec = spec + self.installed = False + self.build_log_path = buildLogPath + + def do_install(self, *args, **kwargs): + self.installed = True + + +class MockPackageDb(object): + def __init__(self, init=None): + self.specToPkg = {} + if init: + self.specToPkg.update(init) + + def get(self, spec): + return self.specToPkg[spec] + + +def mock_fetch_log(path): + return [] + +specX = MockSpec('X', "1.2.0") +specY = MockSpec('Y', "2.3.8") +specX.dependencies['Y'] = specY +pkgX = MockPackage(specX, 'logX') +pkgY = MockPackage(specY, 'logY') + + +class MockArgs(object): + def __init__(self, package): + self.package = package + self.jobs = None + self.no_checksum = False + self.output = None + + +class TestInstallTest(unittest.TestCase): + """ + Tests test-install where X->Y + """ + + def setUp(self): + super(TestInstallTest, self).setUp() + + # Monkey patch parse specs + def monkey_parse_specs(x, concretize): + if x == 'X': + return [specX] + elif x == 'Y': + return [specY] + return [] + + self.parse_specs = spack.cmd.parse_specs + spack.cmd.parse_specs = monkey_parse_specs + + # Monkey patch os.mkdirp + self.os_mkdir = os.mkdir + os.mkdir = lambda x: True + + # Monkey patch open + test_install.open = mock_open + + # Clean FILE_REGISTRY + FILE_REGISTRY = collections.defaultdict(StringIO.StringIO) + + pkgX.installed = False + pkgY.installed = False + + # Monkey patch pkgDb + self.saved_db = spack.repo + pkgDb = MockPackageDb({specX: pkgX, specY: pkgY}) + spack.repo = pkgDb + + def tearDown(self): + # Remove the monkey patched test_install.open + test_install.open = open + + # Remove the monkey patched os.mkdir + os.mkdir = self.os_mkdir + del self.os_mkdir + + # Remove the monkey patched parse_specs + spack.cmd.parse_specs = self.parse_specs + del self.parse_specs + super(TestInstallTest, self).tearDown() + + spack.repo = self.saved_db + + def test_installing_both(self): + test_install.test_install(None, MockArgs('X') ) + self.assertEqual(len(FILE_REGISTRY), 1) + for _, content in FILE_REGISTRY.items(): + self.assertTrue('tests="2"' in content) + self.assertTrue('failures="0"' in content) + self.assertTrue('errors="0"' in content) + + def test_dependency_already_installed(self): + pkgX.installed = True + pkgY.installed = True + test_install.test_install(None, MockArgs('X')) + self.assertEqual(len(FILE_REGISTRY), 1) + for _, content in FILE_REGISTRY.items(): + self.assertTrue('tests="2"' in content) + self.assertTrue('failures="0"' in content) + self.assertTrue('errors="0"' in content) + self.assertEqual(sum('skipped' in line for line in content.split('\n')), 2) + + #TODO: add test(s) where Y fails to install \ No newline at end of file diff --git a/lib/spack/spack/test/unit_install.py b/lib/spack/spack/test/unit_install.py deleted file mode 100644 index 18615b7efe..0000000000 --- a/lib/spack/spack/test/unit_install.py +++ /dev/null @@ -1,126 +0,0 @@ -############################################################################## -# 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 -############################################################################## -import itertools -import unittest - -import spack - -test_install = __import__("spack.cmd.test-install", - fromlist=["BuildId", "create_test_output", "TestResult"]) - -class MockOutput(object): - def __init__(self): - self.results = {} - - def add_test(self, buildId, passed=True, buildInfo=None): - self.results[buildId] = passed - - def write_to(self, stream): - pass - -class MockSpec(object): - def __init__(self, name, version, hashStr=None): - self.dependencies = {} - self.name = name - self.version = version - self.hash = hashStr if hashStr else hash((name, version)) - - def traverse(self, order=None): - allDeps = itertools.chain.from_iterable(i.traverse() for i in - self.dependencies.itervalues()) - return set(itertools.chain([self], allDeps)) - - def dag_hash(self): - return self.hash - - def to_yaml(self): - return "<<>>".format(test_install.BuildId(self).stringId()) - -class MockPackage(object): - def __init__(self, buildLogPath): - self.installed = False - self.build_log_path = buildLogPath - -specX = MockSpec("X", "1.2.0") -specY = MockSpec("Y", "2.3.8") -specX.dependencies['Y'] = specY -pkgX = MockPackage('logX') -pkgY = MockPackage('logY') -bIdX = test_install.BuildId(specX) -bIdY = test_install.BuildId(specY) - -class UnitInstallTest(unittest.TestCase): - """Tests test-install where X->Y""" - - def setUp(self): - super(UnitInstallTest, self).setUp() - - pkgX.installed = False - pkgY.installed = False - - self.saved_db = spack.repo - pkgDb = MockPackageDb({specX:pkgX, specY:pkgY}) - spack.repo = pkgDb - - - def tearDown(self): - super(UnitInstallTest, self).tearDown() - - spack.repo = self.saved_db - - def test_installing_both(self): - mo = MockOutput() - - pkgX.installed = True - pkgY.installed = True - test_install.create_test_output(specX, [specX, specY], mo, getLogFunc=mock_fetch_log) - - self.assertEqual(mo.results, - {bIdX:test_install.TestResult.PASSED, - bIdY:test_install.TestResult.PASSED}) - - - def test_dependency_already_installed(self): - mo = MockOutput() - - pkgX.installed = True - pkgY.installed = True - test_install.create_test_output(specX, [specX], mo, getLogFunc=mock_fetch_log) - self.assertEqual(mo.results, {bIdX:test_install.TestResult.PASSED}) - - #TODO: add test(s) where Y fails to install - - -class MockPackageDb(object): - def __init__(self, init=None): - self.specToPkg = {} - if init: - self.specToPkg.update(init) - - def get(self, spec): - return self.specToPkg[spec] - -def mock_fetch_log(path): - return [] -- cgit v1.2.3-70-g09d2 From ec5bb88820e42b2cf4c839cf134e18a167a52255 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 27 Apr 2016 18:06:41 +0200 Subject: test-install : unit tests (hopefully) fixed for real --- lib/spack/spack/test/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/spack/spack/test/__init__.py b/lib/spack/spack/test/__init__.py index bea41a4adf..3c5edde66b 100644 --- a/lib/spack/spack/test/__init__.py +++ b/lib/spack/spack/test/__init__.py @@ -61,7 +61,6 @@ test_names = ['versions', 'optional_deps', 'make_executable', 'configure_guess', - 'unit_install', 'lock', 'database', 'namespace_trie', -- cgit v1.2.3-70-g09d2 From 4846ab70d8c805c6533d90b9345295c4160b4e35 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 27 Apr 2016 18:21:36 +0200 Subject: test-install : python 2.6 compatibility --- lib/spack/spack/test/cmd/test_install.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/spack/spack/test/cmd/test_install.py b/lib/spack/spack/test/cmd/test_install.py index 1860622ad6..2206c7bea1 100644 --- a/lib/spack/spack/test/cmd/test_install.py +++ b/lib/spack/spack/test/cmd/test_install.py @@ -117,6 +117,7 @@ class MockArgs(object): self.output = None +# TODO: add test(s) where Y fails to install class TestInstallTest(unittest.TestCase): """ Tests test-install where X->Y @@ -187,5 +188,3 @@ class TestInstallTest(unittest.TestCase): self.assertTrue('failures="0"' in content) self.assertTrue('errors="0"' in content) self.assertEqual(sum('skipped' in line for line in content.split('\n')), 2) - - #TODO: add test(s) where Y fails to install \ No newline at end of file -- cgit v1.2.3-70-g09d2 From b1ba869b37803ba9cda28ab64b7f0052e8eda11d Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 27 Apr 2016 19:28:13 +0200 Subject: test-install : fixed error in logic exposed by tests --- lib/spack/spack/cmd/test-install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spack/spack/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py index e323969634..3277e15548 100644 --- a/lib/spack/spack/cmd/test-install.py +++ b/lib/spack/spack/cmd/test-install.py @@ -115,7 +115,7 @@ class TestCase(object): def set_result(self, result_type, message=None, error_type=None, text=None): self.result_type = result_type result = TestCase.results[self.result_type] - if result is not None or result is not TestResult.PASSED: + if result is not None and result is not TestResult.PASSED: subelement = ET.SubElement(self.element, result) if error_type is not None: subelement.set('type', error_type) -- cgit v1.2.3-70-g09d2 From e53571d2f00d2640005a10d69edbad838cb38fef Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 27 Apr 2016 14:46:57 -0400 Subject: fetch_strategy: download to temporary files This supports graceful recovery if spack is killed via a signal (e.g., SIGINT) while downloading a file. Fixes #287. --- lib/spack/spack/fetch_strategy.py | 24 ++++++++++++++++++++++-- lib/spack/spack/stage.py | 12 ++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index 4ea87bea7e..ce2c4e30c7 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -157,12 +157,26 @@ class URLFetchStrategy(FetchStrategy): tty.msg("Already downloaded %s" % self.archive_file) return + possible_files = self.stage.expected_archive_files + save_file = None + partial_file = None + if possible_files: + save_file = self.stage.expected_archive_files[0] + partial_file = self.stage.expected_archive_files[0] + '.part' + tty.msg("Trying to fetch from %s" % self.url) - curl_args = ['-O', # save file to disk + if partial_file: + save_args = ['-C', '-', # continue partial downloads + '-o', partial_file] # use a .part file + else: + save_args = ['-O'] + + curl_args = save_args + [ '-f', # fail on >400 errors '-D', '-', # print out HTML headers - '-L', self.url, ] + '-L', # resolve 3xx redirects + self.url, ] if sys.stdout.isatty(): curl_args.append('-#') # status bar when using a tty @@ -178,6 +192,9 @@ class URLFetchStrategy(FetchStrategy): if self.archive_file: os.remove(self.archive_file) + if partial_file and os.path.exists(partial_file): + os.remove(partial_file) + if spack.curl.returncode == 22: # This is a 404. Curl will print the error. raise FailedDownloadError( @@ -209,6 +226,9 @@ class URLFetchStrategy(FetchStrategy): "'spack clean ' to remove the bad archive, then fix", "your internet gateway issue and install again.") + if save_file: + os.rename(partial_file, save_file) + if not self.archive_file: raise FailedDownloadError(self.url) diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index d711752c20..84c47ee660 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -210,6 +210,18 @@ class Stage(object): return False + @property + def expected_archive_files(self): + """Possible archive file paths.""" + paths = [] + if isinstance(self.fetcher, fs.URLFetchStrategy): + paths.append(os.path.join(self.path, os.path.basename(self.fetcher.url))) + + if self.mirror_path: + paths.append(os.path.join(self.path, os.path.basename(self.mirror_path))) + + return paths + @property def archive_file(self): """Path to the source archive within this stage directory.""" -- cgit v1.2.3-70-g09d2 From ee6a75c9b5bb072ef852b2fae80e2dc1f3944d53 Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Wed, 27 Apr 2016 18:43:16 -0400 Subject: Added missing -lpthread to OpenBLAS check. See: https://github.com/xianyi/OpenBLAS/wiki/faq#static_link --- var/spack/repos/builtin/packages/openblas/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 61250fb310..52edd1a77a 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -119,7 +119,7 @@ return 0; # TODO: Automate these path and library settings cc('-c', "-I%s" % join_path(spec.prefix, "include"), "check.c") cc('-o', "check", "check.o", - "-L%s" % join_path(spec.prefix, "lib"), "-llapack", "-lblas") + "-L%s" % join_path(spec.prefix, "lib"), "-llapack", "-lblas", "-lpthread") try: check = Executable('./check') output = check(return_output=True) -- cgit v1.2.3-70-g09d2 From 62d806d51254c4b063c2e88b616526d1abb1e61e Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Wed, 27 Apr 2016 19:01:41 -0400 Subject: hdf5: Set preferred version, so as to not break NetCDF (for now). --- var/spack/repos/builtin/packages/hdf5/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index cce609eb29..470969832f 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -38,7 +38,7 @@ class Hdf5(Package): list_depth = 3 version('1.10.0', 'bdc935337ee8282579cd6bc4270ad199') - version('1.8.16', 'b8ed9a36ae142317f88b0c7ef4b9c618') + version('1.8.16', 'b8ed9a36ae142317f88b0c7ef4b9c618', preferred=True) version('1.8.15', '03cccb5b33dbe975fdcd8ae9dc021f24') version('1.8.13', 'c03426e9e77d7766944654280b467289') -- cgit v1.2.3-70-g09d2 From 71ca837adad0e8c8149bdfd5be602ac7cc27c9a5 Mon Sep 17 00:00:00 2001 From: Elizabeth F Date: Wed, 27 Apr 2016 20:35:29 -0400 Subject: Add '+fpic' variant. --- var/spack/repos/builtin/packages/openblas/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 52edd1a77a..f5d656f659 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -14,6 +14,7 @@ class Openblas(Package): variant('shared', default=True, description="Build shared libraries as well as static libs.") variant('openmp', default=True, description="Enable OpenMP support.") + variant('fpic', default=True, description="Build position independent code") # virtual dependency provides('blas') @@ -33,6 +34,8 @@ class Openblas(Package): if '+shared' in spec: make_targets += ['shared'] else: + if '+fpic' in spec: + make_defs.extend(['CFLAGS=-fPIC', 'FFLAGS=-fPIC']) make_defs += ['NO_SHARED=1'] # fix missing _dggsvd_ and _sggsvd_ -- cgit v1.2.3-70-g09d2 From 10d8ed4d98314f298c5fd28d726834129510fbd5 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Thu, 28 Apr 2016 15:43:05 -0700 Subject: check that a target directory exists before committing to cd --- share/spack/setup-env.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index 764af68400..e3dd1cb4b9 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -1,4 +1,4 @@ -############################################################################## +##################################################################### # Copyright (c) 2013, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # @@ -84,7 +84,10 @@ function spack { if [ "$_sp_arg" = "-h" ]; then command spack cd -h else - cd $(spack location $_sp_arg "$@") + LOC="$(spack location $_sp_arg "$@")" + if [[ "x" -ne "x$LOC" ]] ; then + cd "$LOC" + fi fi return ;; -- cgit v1.2.3-70-g09d2 From 584501a1cc34165671d0d4e9e2ae27d9cae8cdf9 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Fri, 29 Apr 2016 09:33:54 -0700 Subject: switched test to use -d for location check --- share/spack/setup-env.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index e3dd1cb4b9..11a4c0a70c 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -84,10 +84,10 @@ function spack { if [ "$_sp_arg" = "-h" ]; then command spack cd -h else - LOC="$(spack location $_sp_arg "$@")" - if [[ "x" -ne "x$LOC" ]] ; then + LOC="$(spack location $_sp_arg "$@")" + if [[ -d "$LOC" ]] ; then cd "$LOC" - fi + fi fi return ;; -- cgit v1.2.3-70-g09d2 From 8fc43046ebfaa41410c28ba6d3d27fffed25ee4e Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sat, 30 Apr 2016 12:11:10 +0200 Subject: Add missing dependency for glm --- var/spack/repos/builtin/packages/glm/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/var/spack/repos/builtin/packages/glm/package.py b/var/spack/repos/builtin/packages/glm/package.py index d00c301b4c..ecae89f1e8 100644 --- a/var/spack/repos/builtin/packages/glm/package.py +++ b/var/spack/repos/builtin/packages/glm/package.py @@ -11,6 +11,8 @@ class Glm(Package): url = "https://github.com/g-truc/glm/archive/0.9.7.1.tar.gz" version('0.9.7.1', '61af6639cdf652d1cdd7117190afced8') + + depends_on ("cmake") def install(self, spec, prefix): with working_dir('spack-build', create=True): -- cgit v1.2.3-70-g09d2 From c33ffbae043dbc5b8f0dfe1b1e3d6532af20042e Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sat, 30 Apr 2016 21:58:39 +0200 Subject: Add extra dependencies for Paradiseo. --- var/spack/repos/builtin/packages/paradiseo/package.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/paradiseo/package.py b/var/spack/repos/builtin/packages/paradiseo/package.py index c254234b32..34766099da 100644 --- a/var/spack/repos/builtin/packages/paradiseo/package.py +++ b/var/spack/repos/builtin/packages/paradiseo/package.py @@ -20,15 +20,20 @@ class Paradiseo(Package): #variant('tests', default=False, description='Compile with build tests') #variant('doc', default=False, description='Compile with documentation') variant('debug', default=False, description='Builds a debug version of the libraries') + variant('openmp', default=False, description='Enable OpenMP support') + variant('gnuplot', default=False, description='Enable GnuPlot support') # Required dependencies depends_on ("cmake") - depends_on ("eigen") # Optional dependencies depends_on ("mpi", when="+mpi") depends_on ("doxygen", when='+doc') - + depends_on ("gnuplot", when='+gnuplot') + depends_on ("eigen", when='+edo') + depends_on ("boost~mpi", when='+edo~mpi') + depends_on ("boost+mpi", when='+edo+mpi') + # Patches patch('enable_eoserial.patch') patch('fix_osx_detection.patch') @@ -45,7 +50,9 @@ class Paradiseo(Package): '-DMPI:BOOL=%s' % ('TRUE' if '+mpi' in spec else 'FALSE'), '-DSMP:BOOL=%s' % ('TRUE' if '+smp' in spec else 'FALSE'), # Note: This requires a C++11 compatible compiler '-DEDO:BOOL=%s' % ('TRUE' if '+edo' in spec else 'FALSE'), - '-DENABLE_CMAKE_TESTING:BOOL=%s' % ('TRUE' if '+tests' in spec else 'FALSE') + '-DENABLE_CMAKE_TESTING:BOOL=%s' % ('TRUE' if '+tests' in spec else 'FALSE'), + '-DENABLE_OPENMP:BOOL=%s' % ('TRUE' if '+openmp' in spec else 'FALSE'), + '-DENABLE_GNUPLOT:BOOL=%s' % ('TRUE' if '+gnuplot' in spec else 'FALSE') ]) with working_dir('spack-build', create=True): -- cgit v1.2.3-70-g09d2 From 631e235ef3907916335f965fa179b94455295f31 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sun, 1 May 2016 11:05:51 +0200 Subject: Added Adol-C package --- var/spack/repos/builtin/packages/adol-c/package.py | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 var/spack/repos/builtin/packages/adol-c/package.py diff --git a/var/spack/repos/builtin/packages/adol-c/package.py b/var/spack/repos/builtin/packages/adol-c/package.py new file mode 100644 index 0000000000..a65ec7dd7c --- /dev/null +++ b/var/spack/repos/builtin/packages/adol-c/package.py @@ -0,0 +1,69 @@ +from spack import * +import sys + +class AdolC(Package): + """A package for the automatic differentiation of first and higher derivatives of vector functions in C and C++ programs by operator overloading.""" + homepage = "https://projects.coin-or.org/ADOL-C" + url = "http://www.coin-or.org/download/source/ADOL-C/ADOL-C-2.6.1.tgz" + + version('head', svn='https://projects.coin-or.org/svn/ADOL-C/trunk/') + version('2.6.1', '1032b28427d6e399af4610e78c0f087b') + + variant('doc', default=True, description='Install documentation') + variant('openmp', default=False, description='Enable OpenMP support') + variant('sparse', default=False, description='Enable sparse drivers') + variant('tests', default=True, description='Build all included examples as a test case') + + def install(self, spec, prefix): + make_args = ['--prefix=%s' % prefix] + + # --with-cflags=FLAGS use CFLAGS=FLAGS (default: -O3 -Wall -ansi) + # --with-cxxflags=FLAGS use CXXFLAGS=FLAGS (default: -O3 -Wall) + + if '+openmp' in spec: + make_args.extend([ + '--with-openmp-flag=-fopenmp' # FIXME: Is this required? -I -L + ]) + + if '+sparse' in spec: + make_args.extend([ + '--enable-sparse' + ]) + + # We can simply use the bundled examples to check + # whether Adol-C works as expected + if '+tests' in spec: + make_args.extend([ + '--enable-docexa', # Documeted examples + '--enable-addexa' # Additional examples + ]) + if '+openmp' in spec: + make_args.extend([ + '--enable-parexa' # Parallel examples + ]) + + configure(*make_args) + make() + make("install") + + # Copy the config.h file, as some packages might require it + source_directory = self.stage.source_path + config_h = join_path(source_directory,'ADOL-C/src/config.h') + install(config_h, join_path(prefix.include,'adolc')) + + # Install documentation to {prefix}/share + if '+doc' in spec: + install_tree('ADOL-C/doc',join_path(prefix.share,'doc')) + + # Install examples to {prefix}/share + if '+tests' in spec: + install_tree('ADOL-C/examples',join_path(prefix.share,'examples')) + + # Run some examples that don't require user input + # TODO: Check that bundled examples produce the correct results + with working_dir(join_path(source_directory,'ADOL-C/examples')): + Executable('tapeless_scalar') + Executable('tapeless_vector') + + with working_dir(join_path(source_directory,'ADOL-C/examples/additional_examples')): + Executable('checkpointing/checkpointing') -- cgit v1.2.3-70-g09d2 From 5ae727668235f8a226cdac9e714d9daa004af64c Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Mon, 2 May 2016 11:01:14 +0200 Subject: Fixes to installation with OpenMP (tested) and execution of test-suite --- .../builtin/packages/adol-c/openmp_exam.patch | 13 +++++++++ var/spack/repos/builtin/packages/adol-c/package.py | 33 ++++++++++++++-------- 2 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 var/spack/repos/builtin/packages/adol-c/openmp_exam.patch diff --git a/var/spack/repos/builtin/packages/adol-c/openmp_exam.patch b/var/spack/repos/builtin/packages/adol-c/openmp_exam.patch new file mode 100644 index 0000000000..8e21c72d92 --- /dev/null +++ b/var/spack/repos/builtin/packages/adol-c/openmp_exam.patch @@ -0,0 +1,13 @@ +diff --git a/ADOL-C/examples/additional_examples/openmp_exam/liborpar.cpp b/ADOL-C/examples/additional_examples/openmp_exam/liborpar.cpp +index fc6fc28..14103d2 100644 +--- a/ADOL-C/examples/additional_examples/openmp_exam/liborpar.cpp ++++ b/ADOL-C/examples/additional_examples/openmp_exam/liborpar.cpp +@@ -27,7 +27,7 @@ using namespace std; + #include + #include + +-#include "adolc.h" ++#include + + #ifdef _OPENMP + #include diff --git a/var/spack/repos/builtin/packages/adol-c/package.py b/var/spack/repos/builtin/packages/adol-c/package.py index a65ec7dd7c..70933542ca 100644 --- a/var/spack/repos/builtin/packages/adol-c/package.py +++ b/var/spack/repos/builtin/packages/adol-c/package.py @@ -13,6 +13,8 @@ class AdolC(Package): variant('openmp', default=False, description='Enable OpenMP support') variant('sparse', default=False, description='Enable sparse drivers') variant('tests', default=True, description='Build all included examples as a test case') + + patch('openmp_exam.patch') def install(self, spec, prefix): make_args = ['--prefix=%s' % prefix] @@ -21,9 +23,12 @@ class AdolC(Package): # --with-cxxflags=FLAGS use CXXFLAGS=FLAGS (default: -O3 -Wall) if '+openmp' in spec: - make_args.extend([ - '--with-openmp-flag=-fopenmp' # FIXME: Is this required? -I -L - ]) + if spec.satisfies('%gcc'): + make_args.extend([ + '--with-openmp-flag=-fopenmp' # FIXME: Is this required? -I -L + ]) + else: + raise InstallError("OpenMP flags for compilers other than GCC are not implemented.") if '+sparse' in spec: make_args.extend([ @@ -48,22 +53,28 @@ class AdolC(Package): # Copy the config.h file, as some packages might require it source_directory = self.stage.source_path - config_h = join_path(source_directory,'ADOL-C/src/config.h') + config_h = join_path(source_directory,'ADOL-C','src','config.h') install(config_h, join_path(prefix.include,'adolc')) # Install documentation to {prefix}/share if '+doc' in spec: - install_tree('ADOL-C/doc',join_path(prefix.share,'doc')) + install_tree(join_path('ADOL-C','doc'), + join_path(prefix.share,'doc')) # Install examples to {prefix}/share if '+tests' in spec: - install_tree('ADOL-C/examples',join_path(prefix.share,'examples')) + install_tree(join_path('ADOL-C','examples'), + join_path(prefix.share,'examples')) # Run some examples that don't require user input # TODO: Check that bundled examples produce the correct results - with working_dir(join_path(source_directory,'ADOL-C/examples')): - Executable('tapeless_scalar') - Executable('tapeless_vector') + with working_dir(join_path(source_directory,'ADOL-C','examples')): + Executable('./tapeless_scalar')() + Executable('./tapeless_vector')() - with working_dir(join_path(source_directory,'ADOL-C/examples/additional_examples')): - Executable('checkpointing/checkpointing') + with working_dir(join_path(source_directory,'ADOL-C','examples','additional_examples')): + Executable('./checkpointing/checkpointing')() + + if '+openmp' in spec: + with working_dir(join_path(source_directory,'ADOL-C','examples','additional_examples')): + Executable('./checkpointing/checkpointing')() -- cgit v1.2.3-70-g09d2 From e111add17f885866e997e7483a0ac32235d9c497 Mon Sep 17 00:00:00 2001 From: Vishal Boddu Date: Mon, 2 May 2016 14:31:02 +0200 Subject: missing dependencies (m4) added for netcdf and autoconf --- var/spack/repos/builtin/packages/autoconf/package.py | 2 ++ var/spack/repos/builtin/packages/netcdf/package.py | 1 + 2 files changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py index 6412e810a6..b5e29b8a27 100644 --- a/var/spack/repos/builtin/packages/autoconf/package.py +++ b/var/spack/repos/builtin/packages/autoconf/package.py @@ -8,6 +8,8 @@ class Autoconf(Package): version('2.69', '82d05e03b93e45f5a39b828dc9c6c29b') version('2.62', '6c1f3b3734999035d77da5024aab4fbd') + depends_on("m4") + def install(self, spec, prefix): configure("--prefix=%s" % prefix) diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index b60a2c4e9a..a4d9e5213c 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -21,6 +21,7 @@ class Netcdf(Package): depends_on("hdf5+mpi~cxx", when='+mpi') # required for NetCDF-4 support depends_on("hdf5~mpi", when='~mpi') # required for NetCDF-4 support depends_on("zlib") # required for NetCDF-4 support + depends_on("m4") def install(self, spec, prefix): # Environment variables -- cgit v1.2.3-70-g09d2 From b99c8b641a6c370ddbe8cbf78bc8339dbb3d8598 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 20 Apr 2016 10:46:09 -0500 Subject: Add hydra package --- var/spack/repos/builtin/packages/hydra/package.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 var/spack/repos/builtin/packages/hydra/package.py diff --git a/var/spack/repos/builtin/packages/hydra/package.py b/var/spack/repos/builtin/packages/hydra/package.py new file mode 100644 index 0000000000..c1b8868276 --- /dev/null +++ b/var/spack/repos/builtin/packages/hydra/package.py @@ -0,0 +1,21 @@ +from spack import * + +class Hydra(Package): + """Hydra is a process management system for starting parallel jobs. + Hydra is designed to natively work with existing launcher daemons + (such as ssh, rsh, fork), as well as natively integrate with resource + management systems (such as slurm, pbs, sge).""" + + homepage = "http://www.mpich.org" + url = "http://www.mpich.org/static/downloads/3.2/hydra-3.2.tar.gz" + list_url = "http://www.mpich.org/static/downloads/" + list_depth = 2 + + version('3.2', '4d670916695bf7e3a869cc336a881b39') + + + def install(self, spec, prefix): + configure('--prefix=%s' % prefix) + + make() + make("install") -- cgit v1.2.3-70-g09d2 From c110865bf258b67d745b31a526dcb9b348fd9893 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 21 Apr 2016 15:53:44 -0500 Subject: Remove OpenMPI dependency on hwloc --- var/spack/repos/builtin/packages/openmpi/package.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 9a127f1812..3cb9b0be21 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -1,7 +1,5 @@ -import os - from spack import * - +import os class Openmpi(Package): """Open MPI is a project combining technologies and resources from @@ -36,7 +34,6 @@ class Openmpi(Package): provides('mpi@:2.2', when='@1.6.5') provides('mpi@:3.0', when='@1.7.5:') - depends_on('hwloc') 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) @@ -51,7 +48,6 @@ class Openmpi(Package): def install(self, spec, prefix): config_args = ["--prefix=%s" % prefix, - "--with-hwloc=%s" % spec['hwloc'].prefix, "--enable-shared", "--enable-static"] -- cgit v1.2.3-70-g09d2 From 61e5ee5d6368a829f6dd32bca6ca3f97625177aa Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 31 Mar 2016 14:14:44 -0500 Subject: Prevent use of system GTK+ --- var/spack/repos/builtin/packages/qt/package.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 93688fb777..ac68b5792e 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -101,7 +101,7 @@ class Qt(Package): @property def common_config_args(self): - return [ + config_args = [ '-prefix', self.prefix, '-v', '-opensource', @@ -115,7 +115,16 @@ class Qt(Package): '-no-openvg', '-no-pch', # NIS is deprecated in more recent glibc - '-no-nis'] + '-no-nis' + ] + + if '+gtk' in self.spec: + config_args.append('-gtkstyle') + else: + config_args.append('-no-gtkstyle') + + return config_args + # Don't disable all the database drivers, but should # really get them into spack at some point. @@ -128,8 +137,8 @@ class Qt(Package): '-thread', '-shared', '-release', - '-fast' - ) + '-fast', + *self.common_config_args) @when('@4') def configure(self): -- cgit v1.2.3-70-g09d2 From 17fa1b5007355e0c0453b2f6d0213f81586b1756 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 31 Mar 2016 14:21:34 -0500 Subject: Un-fix version 3 --- var/spack/repos/builtin/packages/qt/package.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index ac68b5792e..1e1d6302f3 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -137,8 +137,7 @@ class Qt(Package): '-thread', '-shared', '-release', - '-fast', - *self.common_config_args) + '-fast') @when('@4') def configure(self): -- cgit v1.2.3-70-g09d2 From cde1d183994363cbb70a72bd180999a0ce151e16 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sat, 30 Apr 2016 17:53:17 +0200 Subject: dealii: add new dependency -- gsl --- var/spack/repos/builtin/packages/dealii/package.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 674fe3150a..f0e9b8f967 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -12,6 +12,7 @@ class Dealii(Package): variant('mpi', default=True, description='Compile with MPI') variant('arpack', default=True, description='Compile with Arpack and PArpack (only with MPI)') variant('doc', default=False, description='Compile with documentation') + variant('gsl' , default=True, description='Compile with GSL') variant('hdf5', default=True, description='Compile with HDF5 (only with MPI)') variant('metis', default=True, description='Compile with Metis') variant('netcdf', default=True, description='Compile with Netcdf (only with MPI)') @@ -39,6 +40,8 @@ class Dealii(Package): depends_on ("mpi", when="+mpi") depends_on ("arpack-ng+mpi", when='+arpack+mpi') depends_on ("doxygen", when='+doc') + depends_on ("gsl", when='@8.5.0:+gsl') + depends_on ("gsl", when='@dev+gsl') depends_on ("hdf5+mpi~cxx", when='+hdf5+mpi') #FIXME NetCDF declares dependency with ~cxx, why? depends_on ("metis@5:", when='+metis') depends_on ("netcdf+mpi", when="+netcdf+mpi") @@ -100,7 +103,7 @@ class Dealii(Package): ]) # Optional dependencies for which librariy names are the same as CMake variables - for library in ('hdf5', 'p4est','petsc', 'slepc','trilinos','metis'): + for library in ('gsl','hdf5','p4est','petsc','slepc','trilinos','metis'): if library in spec: options.extend([ '-D{library}_DIR={value}'.format(library=library.upper(), value=spec[library].prefix), -- cgit v1.2.3-70-g09d2 From 2eb4248f90650f83b7fca7587d59e8fc16bb5305 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 2 May 2016 18:52:44 +0200 Subject: dealii: fix a bug where P4EST_DIR was unconditionally requested --- var/spack/repos/builtin/packages/dealii/package.py | 1 - 1 file changed, 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index f0e9b8f967..df8330384d 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -83,7 +83,6 @@ class Dealii(Package): (join_path(spec['lapack'].prefix.lib,'liblapack.%s' % dsuf), # FIXME don't hardcode names join_path(spec['blas'].prefix.lib,'libblas.%s' % dsuf)), # FIXME don't hardcode names '-DMUPARSER_DIR=%s ' % spec['muparser'].prefix, - '-DP4EST_DIR=%s' % spec['p4est'].prefix, '-DUMFPACK_DIR=%s' % spec['suite-sparse'].prefix, '-DTBB_DIR=%s' % spec['tbb'].prefix, '-DZLIB_DIR=%s' % spec['zlib'].prefix -- cgit v1.2.3-70-g09d2 From 179d308fe06c30b184f37ae91c5bcf1fc77bb536 Mon Sep 17 00:00:00 2001 From: David Poliakoff Date: Mon, 2 May 2016 14:32:57 -0700 Subject: Added a package for the RAJA system --- var/spack/repos/builtin/packages/raja/package.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 var/spack/repos/builtin/packages/raja/package.py diff --git a/var/spack/repos/builtin/packages/raja/package.py b/var/spack/repos/builtin/packages/raja/package.py new file mode 100644 index 0000000000..f807ab71af --- /dev/null +++ b/var/spack/repos/builtin/packages/raja/package.py @@ -0,0 +1,12 @@ +from spack import * + +class Raja(Package): + """RAJA Parallel Framework.""" + homepage = "http://software.llnl.gov/RAJA/" + + version('git', git='https://github.com/LLNL/RAJA.git', branch="master") + + def install(self, spec, prefix): + cmake('.',*std_cmake_args) + make() + make('install') -- cgit v1.2.3-70-g09d2 From afef04bb54c6a9db37f84d6babe077ee2e862c84 Mon Sep 17 00:00:00 2001 From: David Poliakoff Date: Mon, 2 May 2016 15:49:37 -0700 Subject: Added cnmem package` --- var/spack/repos/builtin/packages/cnmem/package.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 var/spack/repos/builtin/packages/cnmem/package.py diff --git a/var/spack/repos/builtin/packages/cnmem/package.py b/var/spack/repos/builtin/packages/cnmem/package.py new file mode 100644 index 0000000000..f65838d195 --- /dev/null +++ b/var/spack/repos/builtin/packages/cnmem/package.py @@ -0,0 +1,12 @@ +from spack import * + +class Cnmem(Package): + """RAJA Parallel Framework.""" + homepage = "https://github.com/NVIDIA/cnmem" + + version('git', git='https://github.com/NVIDIA/cnmem.git', branch="master") + + def install(self, spec, prefix): + cmake('.',*std_cmake_args) + make() + make('install') -- cgit v1.2.3-70-g09d2 From e74cc0df275cb7d7b31f5744f3a72b6b65685613 Mon Sep 17 00:00:00 2001 From: David Poliakoff Date: Mon, 2 May 2016 15:53:43 -0700 Subject: Updated docstring --- var/spack/repos/builtin/packages/cnmem/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/cnmem/package.py b/var/spack/repos/builtin/packages/cnmem/package.py index f65838d195..0a83e8fc20 100644 --- a/var/spack/repos/builtin/packages/cnmem/package.py +++ b/var/spack/repos/builtin/packages/cnmem/package.py @@ -1,7 +1,7 @@ from spack import * class Cnmem(Package): - """RAJA Parallel Framework.""" + """CNMem mempool for CUDA devices""" homepage = "https://github.com/NVIDIA/cnmem" version('git', git='https://github.com/NVIDIA/cnmem.git', branch="master") -- cgit v1.2.3-70-g09d2 From 89621faaea762538bbfa26bd54baff49539b8f47 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Mon, 2 May 2016 20:21:03 -0600 Subject: + Add version 5.0 download for SuperLU_DIST. --- var/spack/repos/builtin/packages/superlu-dist/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/superlu-dist/package.py b/var/spack/repos/builtin/packages/superlu-dist/package.py index 5cf5e129b4..b4c0759d7c 100644 --- a/var/spack/repos/builtin/packages/superlu-dist/package.py +++ b/var/spack/repos/builtin/packages/superlu-dist/package.py @@ -6,6 +6,7 @@ class SuperluDist(Package): homepage = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_4.1.tar.gz" + version('5.0.0', '2b53baf1b0ddbd9fcf724992577f0670') version('4.3', 'ee66c84e37b4f7cc557771ccc3dc43ae') version('4.2', 'ae9fafae161f775fbac6eba11e530a65') version('4.1', '4edee38cc29f687bd0c8eb361096a455') -- cgit v1.2.3-70-g09d2 From 98f8192bde22ad973d126de677566a3f9852a64a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 3 May 2016 15:15:55 +0200 Subject: libtool: add a missing dependency --- var/spack/repos/builtin/packages/libtool/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index 82a54953b2..c804f5ab5d 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -8,6 +8,8 @@ class Libtool(Package): version('2.4.6' , 'addf44b646ddb4e3919805aa88fa7c5e') version('2.4.2' , 'd2f3b7d4627e69e13514a40e72a24d50') + depends_on('m4') + def install(self, spec, prefix): configure("--prefix=%s" % prefix) -- cgit v1.2.3-70-g09d2 From 0583bc98598d5c868e7ca402cbdf80bb4557c8cf Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 3 May 2016 16:20:38 +0200 Subject: p4est: put back +tests variant --- var/spack/repos/builtin/packages/p4est/package.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/p4est/package.py b/var/spack/repos/builtin/packages/p4est/package.py index 017c4e3fbf..c059632079 100644 --- a/var/spack/repos/builtin/packages/p4est/package.py +++ b/var/spack/repos/builtin/packages/p4est/package.py @@ -7,6 +7,8 @@ class P4est(Package): version('1.1', '37ba7f4410958cfb38a2140339dbf64f') + variant('tests', default=True, description='Run small tests') + # build dependencies depends_on('automake') depends_on('autoconf') @@ -33,5 +35,11 @@ class P4est(Package): configure('--prefix=%s' % prefix, *options) make() - make("check") + # Make tests optional as sometimes mpiexec can't be run with an error: + # mpiexec has detected an attempt to run as root. + # Running at root is *strongly* discouraged as any mistake (e.g., in + # defining TMPDIR) or bug can result in catastrophic damage to the OS + # file system, leaving your system in an unusable state. + if '+tests' in self.spec: + make("check") make("install") -- cgit v1.2.3-70-g09d2 From 40d578be958b7bc0269f2f6f92cc2b6e70a43353 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 3 May 2016 10:38:05 -0400 Subject: Disable OpenBLAS's overriding of our "make -jN" option --- .../repos/builtin/packages/openblas/make.patch | 35 ++++++++++++++++++++++ .../repos/builtin/packages/openblas/package.py | 4 ++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/openblas/make.patch diff --git a/var/spack/repos/builtin/packages/openblas/make.patch b/var/spack/repos/builtin/packages/openblas/make.patch new file mode 100644 index 0000000000..851214211a --- /dev/null +++ b/var/spack/repos/builtin/packages/openblas/make.patch @@ -0,0 +1,35 @@ +diff --git a/Makefile.system b/Makefile.system +index b89f60e..2dbdad0 100644 +--- a/Makefile.system ++++ b/Makefile.system +@@ -139,6 +139,10 @@ NO_PARALLEL_MAKE=0 + endif + GETARCH_FLAGS += -DNO_PARALLEL_MAKE=$(NO_PARALLEL_MAKE) + ++ifdef MAKE_NO_J ++GETARCH_FLAGS += -DMAKE_NO_J=$(MAKE_NO_J) ++endif ++ + ifdef MAKE_NB_JOBS + GETARCH_FLAGS += -DMAKE_NB_JOBS=$(MAKE_NB_JOBS) + endif +diff --git a/getarch.c b/getarch.c +index f9c49e6..dffad70 100644 +--- a/getarch.c ++++ b/getarch.c +@@ -1012,6 +1012,7 @@ int main(int argc, char *argv[]){ + #endif + #endif + ++#ifndef MAKE_NO_J + #ifdef MAKE_NB_JOBS + printf("MAKE += -j %d\n", MAKE_NB_JOBS); + #elif NO_PARALLEL_MAKE==1 +@@ -1021,6 +1022,7 @@ int main(int argc, char *argv[]){ + printf("MAKE += -j %d\n", get_num_cores()); + #endif + #endif ++#endif + + break; + diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 61250fb310..14d4c89b19 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -19,13 +19,15 @@ class Openblas(Package): provides('blas') provides('lapack') + patch('make.patch') def install(self, spec, prefix): # Openblas is picky about compilers. Configure fails with # FC=/abs/path/to/f77, whereas FC=f77 works fine. # To circumvent this, provide basename only: make_defs = ['CC=%s' % os.path.basename(spack_cc), - 'FC=%s' % os.path.basename(spack_f77)] + 'FC=%s' % os.path.basename(spack_f77), + 'MAKE_NO_J=1'] make_targets = ['libs', 'netlib'] -- cgit v1.2.3-70-g09d2 From 51c6867f72e91bb061e8bd021b64fa12706c0f33 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 3 May 2016 10:30:35 -0500 Subject: Re-add hwloc as a dependency of openmpi --- var/spack/repos/builtin/packages/openmpi/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 3cb9b0be21..74f0a7bfd1 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -34,6 +34,8 @@ class Openmpi(Package): provides('mpi@:2.2', when='@1.6.5') provides('mpi@:3.0', when='@1.7.5:') + depends_on('hwloc') + 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) @@ -48,6 +50,7 @@ class Openmpi(Package): def install(self, spec, prefix): config_args = ["--prefix=%s" % prefix, + "--with-hwloc=%s" % spec['hwloc'].prefix, "--enable-shared", "--enable-static"] -- cgit v1.2.3-70-g09d2 From f4260da1c262731f9287db4f972e7eae6399135d Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Tue, 3 May 2016 12:05:35 -0600 Subject: Mark SuperLU_DIST version 4.3 as the preferred version since petsc and trilinos are not tested with 5.0. --- var/spack/repos/builtin/packages/superlu-dist/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/superlu-dist/package.py b/var/spack/repos/builtin/packages/superlu-dist/package.py index b4c0759d7c..3420d9b90a 100644 --- a/var/spack/repos/builtin/packages/superlu-dist/package.py +++ b/var/spack/repos/builtin/packages/superlu-dist/package.py @@ -7,7 +7,8 @@ class SuperluDist(Package): url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_dist_4.1.tar.gz" version('5.0.0', '2b53baf1b0ddbd9fcf724992577f0670') - version('4.3', 'ee66c84e37b4f7cc557771ccc3dc43ae') + # default to version 4.3 since petsc and trilinos are not tested with 5.0. + version('4.3', 'ee66c84e37b4f7cc557771ccc3dc43ae', preferred=True) version('4.2', 'ae9fafae161f775fbac6eba11e530a65') version('4.1', '4edee38cc29f687bd0c8eb361096a455') version('4.0', 'c0b98b611df227ae050bc1635c6940e0') -- cgit v1.2.3-70-g09d2 From eaa45d8a9a8cd26379ea7bd3bcee99cbab08d9e7 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 3 May 2016 13:28:38 -0500 Subject: Remove hdf5 ~cxx constraint on netcdf --- var/spack/repos/builtin/packages/netcdf/package.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index a4d9e5213c..4aad0f6f3c 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -12,16 +12,19 @@ class Netcdf(Package): version('4.4.0', 'cffda0cbd97fdb3a06e9274f7aef438e') version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') - variant('mpi', default=True, description='Enables MPI parallelism') - variant('hdf4', default=False, description="Enable HDF4 support") + variant('mpi', default=True, description='Enables MPI parallelism') + variant('hdf4', default=False, description='Enable HDF4 support') - # Dependencies: - depends_on("curl") # required for DAP support - depends_on("hdf", when='+hdf4') - depends_on("hdf5+mpi~cxx", when='+mpi') # required for NetCDF-4 support - depends_on("hdf5~mpi", when='~mpi') # required for NetCDF-4 support - depends_on("zlib") # required for NetCDF-4 support depends_on("m4") + depends_on("hdf", when='+hdf4') + + # Required for DAP support + depends_on("curl") + + # Required for NetCDF-4 support + depends_on("zlib") + depends_on("hdf5+mpi", when='+mpi') + depends_on("hdf5~mpi", when='~mpi') def install(self, spec, prefix): # Environment variables @@ -49,7 +52,7 @@ class Netcdf(Package): # /usr/lib/x86_64-linux-gnu/libcurl.so: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0' LIBS.append("-lcurl") CPPFLAGS.append("-I%s" % spec['curl'].prefix.include) - LDFLAGS.append ("-L%s" % spec['curl'].prefix.lib) + LDFLAGS.append( "-L%s" % spec['curl'].prefix.lib) if '+mpi' in spec: config_args.append('--enable-parallel4') -- cgit v1.2.3-70-g09d2 From a3d2d0cd22efef3fa24fce3a92b579d8cc938805 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 3 May 2016 15:44:23 -0500 Subject: Add latest OpenSSL versions --- var/spack/repos/builtin/packages/openssl/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 9e3109bfed..d0c95731a2 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -15,10 +15,12 @@ class Openssl(Package): version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') version('1.0.1r', '1abd905e079542ccae948af37e393d28') + version('1.0.1t', '9837746fcf8a6727d46d22ca35953da1') version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') version('1.0.2f', 'b3bf73f507172be9292ea2a8c28b659d') version('1.0.2g', 'f3c710c045cdee5fd114feb69feba7aa') + version('1.0.2h', '9392e65072ce4b614c1392eefc1f23d0') depends_on("zlib") parallel = False -- cgit v1.2.3-70-g09d2 From 88fa9084e2846008238a3136933a16d0ab6b413c Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 3 May 2016 15:58:14 -0500 Subject: Add latest version of GCC --- var/spack/repos/builtin/packages/gcc/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 6043b62279..8f90757232 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -38,6 +38,7 @@ class Gcc(Package): list_url = 'http://open-source-box.org/gcc/' list_depth = 2 + version('6.1.0', '8fb6cb98b8459f5863328380fbf06bd1') version('5.3.0', 'c9616fd448f980259c31de613e575719') version('5.2.0', 'a51bcfeb3da7dd4c623e27207ed43467') version('4.9.3', '6f831b4d251872736e8e9cc09746f327') -- cgit v1.2.3-70-g09d2 From c3317819cb89abdcd9fe1cb9431436c4e4ef8702 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 4 May 2016 10:37:52 +0200 Subject: mpi: add self.spec.[mpicc|mpicxx|mpifc|mpif77] to avoid hardcoding MPI wrappers names --- lib/spack/docs/packaging_guide.rst | 17 +++++++++++++++++ var/spack/repos/builtin/packages/mpich/package.py | 5 +++++ var/spack/repos/builtin/packages/openmpi/package.py | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index 519c0da232..34d11308f5 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -1831,6 +1831,23 @@ successfully find ``libdwarf.h`` and ``libdwarf.so``, without the packager having to provide ``--with-libdwarf=/path/to/libdwarf`` on the command line. +Message Parsing Interface (MPI) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +It is common for high performance computing software/packages to use ``MPI``. +As a result of conretization, a given package can be built using different +implementations of MPI such as ``Openmpi``, ``MPICH`` or ``IntelMPI``. +In some scenarios to configure a package one have to provide it with appropriate MPI +compiler wrappers such as ``mpicc``, ``mpic++``. +However different implementations of ``MPI`` may have different names for those +wrappers. In order to make package's ``install()`` method indifferent to the +choice ``MPI`` implementation, each package which implements ``MPI`` sets up +``self.spec.mpicc``, ``self.spec.mpicxx``, ``self.spec.mpifc`` and ``self.spec.mpif77`` +to point to ``C``, ``C++``, ``Fortran 90`` and ``Fortran 77`` ``MPI`` wrappers. +Package developers are advised to use these variables, for example ``self.spec['mpi'].mpicc`` +instead of hard-coding ``join_path(self.spec['mpi'].prefix.bin, 'mpicc')`` for +the reasons outlined above. + + Forking ``install()`` ~~~~~~~~~~~~~~~~~~~~~ diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index b317ec6651..aaa6386df7 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -54,6 +54,11 @@ class Mpich(Package): spack_env.set('MPICH_F90', spack_fc) spack_env.set('MPICH_FC', spack_fc) + self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') + self.spec.mpicxx = join_path(self.prefix.bin, 'mpic++') + self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') + self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') + def setup_dependent_package(self, module, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers? diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 3cb9b0be21..89a21e869c 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -45,6 +45,11 @@ class Openmpi(Package): spack_env.set('OMPI_FC', spack_fc) spack_env.set('OMPI_F77', spack_f77) + self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') + self.spec.mpicxx = join_path(self.prefix.bin, 'mpic++') + self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') + self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') + def install(self, spec, prefix): config_args = ["--prefix=%s" % prefix, -- cgit v1.2.3-70-g09d2 From f417b1cf904d99b4fb81ab31ec3ddd6da362d286 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 4 May 2016 11:01:52 +0200 Subject: p4est: use mpicc,mpicxx,mpifc,mpif77 compiler variables instead of hardcoding names --- var/spack/repos/builtin/packages/p4est/package.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/p4est/package.py b/var/spack/repos/builtin/packages/p4est/package.py index 017c4e3fbf..5b2474a067 100644 --- a/var/spack/repos/builtin/packages/p4est/package.py +++ b/var/spack/repos/builtin/packages/p4est/package.py @@ -24,10 +24,10 @@ class P4est(Package): '--without-blas', 'CPPFLAGS=-DSC_LOG_PRIORITY=SC_LP_ESSENTIAL', 'CFLAGS=-O2', - 'CC=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # TODO: use ENV variables or MPI class wrappers - 'CXX=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'), - 'FC=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'), - 'F77=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif77'), + 'CC=%s' % self.spec['mpi'].mpicc, + 'CXX=%s' % self.spec['mpi'].mpicxx, + 'FC=%s' % self.spec['mpi'].mpifc, + 'F77=%s' % self.spec['mpi'].mpif77 ] configure('--prefix=%s' % prefix, *options) -- cgit v1.2.3-70-g09d2 From 796bf5f85cd22039f6131b15d401ef4a82bf7f86 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 4 May 2016 17:33:19 +0200 Subject: mvapich2: add self.spec.[mpicc|mpicxx|mpifc|mpif77] --- var/spack/repos/builtin/packages/mvapich2/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py index 3e60b517db..3d4f2d0c68 100644 --- a/var/spack/repos/builtin/packages/mvapich2/package.py +++ b/var/spack/repos/builtin/packages/mvapich2/package.py @@ -146,6 +146,10 @@ class Mvapich2(Package): spack_env.set('MPICH_F77', spack_f77) spack_env.set('MPICH_F90', spack_fc) spack_env.set('MPICH_FC', spack_fc) + self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') + self.spec.mpicxx = join_path(self.prefix.bin, 'mpicxx') + self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') + self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') def install(self, spec, prefix): # we'll set different configure flags depending on our environment -- cgit v1.2.3-70-g09d2 From bfe009f98d8f468c839ed75f12d881c246dd2ceb Mon Sep 17 00:00:00 2001 From: "Robert.French" Date: Wed, 4 May 2016 15:26:10 +0000 Subject: Subversion uses serf for http repos Add Scons package Add serf package Subversion uses serf for http repos --- var/spack/repos/builtin/packages/scons/package.py | 13 ++++++ var/spack/repos/builtin/packages/serf/package.py | 51 ++++++++++++++++++++++ .../repos/builtin/packages/subversion/package.py | 2 + 3 files changed, 66 insertions(+) create mode 100644 var/spack/repos/builtin/packages/scons/package.py create mode 100644 var/spack/repos/builtin/packages/serf/package.py diff --git a/var/spack/repos/builtin/packages/scons/package.py b/var/spack/repos/builtin/packages/scons/package.py new file mode 100644 index 0000000000..594aeced88 --- /dev/null +++ b/var/spack/repos/builtin/packages/scons/package.py @@ -0,0 +1,13 @@ +from spack import * + +class Scons(Package): + """SCons is a software construction tool""" + homepage = "http://scons.org" + url = "http://downloads.sourceforge.net/project/scons/scons/2.5.0/scons-2.5.0.tar.gz" + + version('2.5.0', '9e00fa0df8f5ca5c5f5975b40e0ed354') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/repos/builtin/packages/serf/package.py b/var/spack/repos/builtin/packages/serf/package.py new file mode 100644 index 0000000000..a5c9057b99 --- /dev/null +++ b/var/spack/repos/builtin/packages/serf/package.py @@ -0,0 +1,51 @@ +############################################################################## +# 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 * + +class Serf(Package): + """Apache Serf - a high performance C-based HTTP client library built upon the Apache Portable Runtime (APR) library""" + homepage = 'https://serf.apache.org/' + url = 'https://archive.apache.org/dist/serf/serf-1.3.8.tar.bz2' + + version('1.3.8', '1d45425ca324336ce2f4ae7d7b4cfbc5567c5446') + + depends_on('apr') + depends_on('apr-util') + depends_on('scons') + depends_on('expat') + depends_on('openssl') + + def install(self, spec, prefix): + scons = which("scons") + + options = ['PREFIX=%s' % prefix] + options.append('APR=%s' % spec['apr'].prefix) + options.append('APU=%s' % spec['apr-util'].prefix) + options.append('OPENSSL=%s' % spec['openssl'].prefix) + options.append('LINKFLAGS=-L%s/lib' % spec['expat'].prefix) + options.append('CPPFLAGS=-I%s/include' % spec['expat'].prefix) + + scons(*options) + scons('install') diff --git a/var/spack/repos/builtin/packages/subversion/package.py b/var/spack/repos/builtin/packages/subversion/package.py index 5db1c3eb92..04cde94aad 100644 --- a/var/spack/repos/builtin/packages/subversion/package.py +++ b/var/spack/repos/builtin/packages/subversion/package.py @@ -37,6 +37,7 @@ class Subversion(Package): depends_on('apr-util') depends_on('zlib') depends_on('sqlite') + depends_on('serf') # Optional: We need swig if we want the Perl, Python or Ruby # bindings. @@ -54,6 +55,7 @@ class Subversion(Package): options.append('--with-apr-util=%s' % spec['apr-util'].prefix) options.append('--with-zlib=%s' % spec['zlib'].prefix) options.append('--with-sqlite=%s' % spec['sqlite'].prefix) + options.append('--with-serf=%s' % spec['serf'].prefix) #options.append('--with-swig=%s' % spec['swig'].prefix) configure(*options) -- cgit v1.2.3-70-g09d2 From 514a8c737a69f8176ccd5531a87b5042ff847ddc Mon Sep 17 00:00:00 2001 From: Greg Lee Date: Wed, 4 May 2016 16:38:43 -0700 Subject: added git commit for clang support --- var/spack/repos/builtin/packages/mrnet/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/mrnet/package.py b/var/spack/repos/builtin/packages/mrnet/package.py index a3abb71285..b52233be4a 100644 --- a/var/spack/repos/builtin/packages/mrnet/package.py +++ b/var/spack/repos/builtin/packages/mrnet/package.py @@ -6,6 +6,7 @@ class Mrnet(Package): url = "ftp://ftp.cs.wisc.edu/paradyn/mrnet/mrnet_5.0.1.tar.gz" list_url = "http://ftp.cs.wisc.edu/paradyn/mrnet" + version('5.0.1-2', git='https://github.com/dyninst/mrnet.git', commit='20b1eacfc6d680d9f6472146d2dfaa0f900cc2e9') version('5.0.1', '17f65738cf1b9f9b95647ff85f69ecdd') version('4.1.0', '5a248298b395b329e2371bf25366115c') version('4.0.0', 'd00301c078cba57ef68613be32ceea2f') -- cgit v1.2.3-70-g09d2 From 27de2a42d9d3b0f572c37a6ce1612b7df9855240 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 4 May 2016 20:27:58 -0400 Subject: Update Flex to 2.6.0 --- var/spack/repos/builtin/packages/flex/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/flex/package.py b/var/spack/repos/builtin/packages/flex/package.py index b065904912..e4795893e0 100644 --- a/var/spack/repos/builtin/packages/flex/package.py +++ b/var/spack/repos/builtin/packages/flex/package.py @@ -6,6 +6,7 @@ class Flex(Package): homepage = "http://flex.sourceforge.net/" url = "http://download.sourceforge.net/flex/flex-2.5.39.tar.gz" + version('2.6.0', '5724bcffed4ebe39e9b55a9be80859ec') version('2.5.39', 'e133e9ead8ec0a58d81166b461244fde') def install(self, spec, prefix): -- cgit v1.2.3-70-g09d2 From b12fb7ebc845313d404e4448c145cda4e00517f3 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 5 May 2016 10:24:32 +0200 Subject: mpi: move mpicc/mpicxx/mpifc/mpif77 to setup_dependent_package() --- var/spack/repos/builtin/packages/mpich/package.py | 2 +- var/spack/repos/builtin/packages/mvapich2/package.py | 2 ++ var/spack/repos/builtin/packages/openmpi/package.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index aaa6386df7..4b84f44bd7 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -54,12 +54,12 @@ class Mpich(Package): spack_env.set('MPICH_F90', spack_fc) spack_env.set('MPICH_FC', spack_fc) + def setup_dependent_package(self, module, dep_spec): self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') self.spec.mpicxx = join_path(self.prefix.bin, 'mpic++') self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') - def setup_dependent_package(self, module, dep_spec): """For dependencies, make mpicc's use spack wrapper.""" # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers? module.mpicc = join_path(self.prefix.bin, 'mpicc') diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py index 3d4f2d0c68..c68a04d251 100644 --- a/var/spack/repos/builtin/packages/mvapich2/package.py +++ b/var/spack/repos/builtin/packages/mvapich2/package.py @@ -146,6 +146,8 @@ class Mvapich2(Package): spack_env.set('MPICH_F77', spack_f77) spack_env.set('MPICH_F90', spack_fc) spack_env.set('MPICH_FC', spack_fc) + + def setup_dependent_package(self, module, dep_spec): self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') self.spec.mpicxx = join_path(self.prefix.bin, 'mpicxx') self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index 89a21e869c..92a5018886 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -45,6 +45,7 @@ class Openmpi(Package): spack_env.set('OMPI_FC', spack_fc) spack_env.set('OMPI_F77', spack_f77) + def setup_dependent_package(self, module, dep_spec): self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') self.spec.mpicxx = join_path(self.prefix.bin, 'mpic++') self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') -- cgit v1.2.3-70-g09d2 From c3bc4d6195a7f84525f117acfb68e2df5149d1ff Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 5 May 2016 10:28:04 +0200 Subject: mpich: remove module.mpicc as no formula is using it and it is a duplicate of self.spec.mpicc --- var/spack/repos/builtin/packages/mpich/package.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index 4b84f44bd7..5d68f20351 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -60,10 +60,6 @@ class Mpich(Package): self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') - """For dependencies, make mpicc's use spack wrapper.""" - # FIXME : is this necessary ? Shouldn't this be part of a contract with MPI providers? - module.mpicc = join_path(self.prefix.bin, 'mpicc') - def install(self, spec, prefix): config_args = ["--prefix=" + prefix, "--enable-shared"] -- cgit v1.2.3-70-g09d2 From 18d2b28c498026828aab4fc2ece62b2e062d74c2 Mon Sep 17 00:00:00 2001 From: "Robert D. French" Date: Thu, 5 May 2016 10:38:35 -0400 Subject: Build and install BBCP Build and install BBCP Use correct destination for install --- var/spack/repos/builtin/packages/bbcp/package.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 var/spack/repos/builtin/packages/bbcp/package.py diff --git a/var/spack/repos/builtin/packages/bbcp/package.py b/var/spack/repos/builtin/packages/bbcp/package.py new file mode 100644 index 0000000000..e9baa5ccf4 --- /dev/null +++ b/var/spack/repos/builtin/packages/bbcp/package.py @@ -0,0 +1,17 @@ +from spack import * + +class Bbcp(Package): + """Securely and quickly copy data from source to target""" + homepage = "http://www.slac.stanford.edu/~abh/bbcp/" + + version('git', git='http://www.slac.stanford.edu/~abh/bbcp/bbcp.git', branch="master") + + def install(self, spec, prefix): + cd("src") + make() + # BBCP wants to build the executable in a directory whose name depends on the system type + makesname = Executable("../MakeSname") + bbcp_executable_path = "../bin/%s/bbcp" % makesname(output=str).rstrip("\n") + destination_path = "%s/bin/" % prefix + mkdirp(destination_path) + install(bbcp_executable_path, destination_path) -- cgit v1.2.3-70-g09d2