From b574c4ad5190bad375b9b8b38857222d5e79682a Mon Sep 17 00:00:00 2001 From: alalazo Date: Fri, 29 Jan 2016 08:57:07 +0100 Subject: [PATCH 1/5] trilinos : updated package to meet changes in dependencies --- .../repos/builtin/packages/netcdf/package.py | 7 +++- .../builtin/packages/trilinos/package.py | 36 +++++++++++-------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 3cd0b2ee7a..579282e7f7 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -11,13 +11,15 @@ class Netcdf(Package): version('4.4.0', 'f01cb26a0126dd9a6224e76472d25f6c') version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') + variant('mpi', default=True, description='Enables MPI parallelism') variant('fortran', default=False, description="Download and install NetCDF-Fortran") variant('hdf4', default=False, description="Enable HDF4 support") # Dependencies: depends_on("curl") # required for DAP support depends_on("hdf", when='+hdf4') - depends_on("hdf5") # required for NetCDF-4 support + 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 def install(self, spec, prefix): @@ -41,6 +43,9 @@ def install(self, spec, prefix): "--enable-dap" ] + if '+mpi' in spec: + config_args.append('--enable-parallel') + CPPFLAGS.append("-I%s/include" % spec['hdf5'].prefix) LDFLAGS.append( "-L%s/lib" % spec['hdf5'].prefix) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 7c43f796a4..e6b97022d9 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -10,6 +10,7 @@ class Trilinos(Package): homepage = "https://trilinos.org/" url = "http://trilinos.csbsju.edu/download/files/trilinos-12.2.1-Source.tar.gz" + version('12.4.2', '7c830f7f0f68b8ad324690603baf404e') version('12.2.1', '6161926ea247863c690e927687f83be9') version('12.0.1', 'bd99741d047471e127b8296b2ec08017') version('11.14.3', '2f4f83f8333e4233c57d0f01c4b57426') @@ -17,33 +18,38 @@ class Trilinos(Package): version('11.14.1', '40febc57f76668be8b6a77b7607bb67f') variant('mpi', default=True, description='Add a dependency on MPI and enables MPI dependent packages') + variant('shared', default=True, description='Enables the build of shared libraries') + variant('debug', default=False, description='Builds a debug version of the libraries') # Everything should be compiled with -fpic depends_on('blas') depends_on('lapack') depends_on('boost') - depends_on('netcdf') depends_on('matio') depends_on('glm') depends_on('swig') + + # MPI related dependencies depends_on('mpi', when='+mpi') + depends_on('netcdf+mpi', when='+mpi') + depends_on('netcdf~mpi', when='~mpi') + + depends_on('python') # Needs py-numpy activated def install(self, spec, prefix): - - options = [ - '-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON', - '-DTrilinos_ENABLE_TESTS:BOOL=OFF', - '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', - '-DBUILD_SHARED_LIBS:BOOL=ON', - '-DBLAS_LIBRARY_DIRS:PATH=%s' % spec['blas'].prefix, - '-DLAPACK_LIBRARY_DIRS:PATH=%s' % spec['lapack'].prefix - ] - if '+mpi' in spec: - mpi_options = ['-DTPL_ENABLE_MPI:BOOL=ON'] - options.extend(mpi_options) - - # -DCMAKE_INSTALL_PREFIX and all the likes... + options = [] options.extend(std_cmake_args) + + options.extend(['-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON', + '-DTrilinos_ENABLE_TESTS:BOOL=OFF', + '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', + '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), + '-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'), + '-DTPL_ENABLE_MPI:BOOL=%s' % ('ON' if '+mpi' in spec else 'OFF'), + '-DBLAS_LIBRARY_DIRS:PATH=%s' % spec['blas'].prefix, + '-DLAPACK_LIBRARY_DIRS:PATH=%s' % spec['lapack'].prefix + ]) + with working_dir('spack-build', create=True): cmake('..', *options) make() From cd547939138c00a45a2252f073ce21d3742d5dd0 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 29 Jan 2016 11:42:06 +0100 Subject: [PATCH 2/5] Cleaning up --- var/spack/repos/builtin/packages/openssl/package.py | 7 ++++--- var/spack/repos/builtin/packages/trilinos/package.py | 8 +++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index bbb169ec6b..3b790eca66 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -9,9 +9,10 @@ class Openssl(Package): homepage = "http://www.openssl.org" url = "http://www.openssl.org/source/openssl-1.0.1h.tar.gz" - version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') - version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') - version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') + version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') # Not available + version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') # Not available + version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') # Not available + version('1.0.2f', 'b3bf73f507172be9292ea2a8c28b659d') depends_on("zlib") parallel = False diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index e6b97022d9..edc40476e3 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -17,7 +17,6 @@ class Trilinos(Package): version('11.14.2', 'a43590cf896c677890d75bfe75bc6254') version('11.14.1', '40febc57f76668be8b6a77b7607bb67f') - variant('mpi', default=True, description='Add a dependency on MPI and enables MPI dependent packages') variant('shared', default=True, description='Enables the build of shared libraries') variant('debug', default=False, description='Builds a debug version of the libraries') @@ -30,9 +29,8 @@ class Trilinos(Package): depends_on('swig') # MPI related dependencies - depends_on('mpi', when='+mpi') - depends_on('netcdf+mpi', when='+mpi') - depends_on('netcdf~mpi', when='~mpi') + depends_on('mpi') + depends_on('netcdf+mpi') depends_on('python') # Needs py-numpy activated @@ -45,7 +43,7 @@ def install(self, spec, prefix): '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), '-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'), - '-DTPL_ENABLE_MPI:BOOL=%s' % ('ON' if '+mpi' in spec else 'OFF'), + '-DTPL_ENABLE_MPI:STRING=ON', '-DBLAS_LIBRARY_DIRS:PATH=%s' % spec['blas'].prefix, '-DLAPACK_LIBRARY_DIRS:PATH=%s' % spec['lapack'].prefix ]) From 360abb070a639711f740aa7ef73a84ab76aff14f Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 1 Feb 2016 08:33:03 +0100 Subject: [PATCH 3/5] netcdf : fixed typo in configure option openssl : smarter URL computation --- .../repos/builtin/packages/netcdf/package.py | 3 +- .../repos/builtin/packages/openssl/package.py | 28 +++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/netcdf/package.py b/var/spack/repos/builtin/packages/netcdf/package.py index 579282e7f7..89b40f4a90 100644 --- a/var/spack/repos/builtin/packages/netcdf/package.py +++ b/var/spack/repos/builtin/packages/netcdf/package.py @@ -1,5 +1,6 @@ from spack import * + class Netcdf(Package): """NetCDF is a set of software libraries and self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented @@ -44,7 +45,7 @@ def install(self, spec, prefix): ] if '+mpi' in spec: - config_args.append('--enable-parallel') + config_args.append('--enable-parallel4') CPPFLAGS.append("-I%s/include" % spec['hdf5'].prefix) LDFLAGS.append( "-L%s/lib" % spec['hdf5'].prefix) diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 3b790eca66..345fce0669 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -1,3 +1,5 @@ +import urllib + from spack import * class Openssl(Package): @@ -9,9 +11,10 @@ class Openssl(Package): homepage = "http://www.openssl.org" url = "http://www.openssl.org/source/openssl-1.0.1h.tar.gz" - version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') # Not available - version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') # Not available - version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') # Not available + version('1.0.1h', '8d6d684a9430d5cc98a62a5d8fbda8cf') + version('1.0.1r', '1abd905e079542ccae948af37e393d28') + version('1.0.2d', '38dd619b2e77cbac69b99f52a053d25a') + version('1.0.2e', '5262bfa25b60ed9de9f28d5d52d77fc5') version('1.0.2f', 'b3bf73f507172be9292ea2a8c28b659d') depends_on("zlib") @@ -39,3 +42,22 @@ def install(self, spec, prefix): make() make("install") + + def url_for_version(self, version): + # This URL is computed pinging the place where the latest version is stored. To avoid slowdown + # due to repeated pinging, we store the URL in a private attribute + openssl_url = getattr(self, '_openssl_url', None) + + 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)) + openssl_url = older_url if response.getcode() == 404 else latest_url + self._openssl_url = openssl_url + + return openssl_url From e67507478a9f662d7adfa891bcb2c7b830b69f5c Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 1 Feb 2016 10:55:39 +0100 Subject: [PATCH 4/5] opencv : reverted url_for_version modifications --- .../repos/builtin/packages/openssl/package.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 345fce0669..36a33204fd 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -42,22 +42,3 @@ def install(self, spec, prefix): make() make("install") - - def url_for_version(self, version): - # This URL is computed pinging the place where the latest version is stored. To avoid slowdown - # due to repeated pinging, we store the URL in a private attribute - openssl_url = getattr(self, '_openssl_url', None) - - 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)) - openssl_url = older_url if response.getcode() == 404 else latest_url - self._openssl_url = openssl_url - - return openssl_url From c8d2275c06f05b8ddf2463c5aa110d1f44692038 Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 1 Feb 2016 10:56:48 +0100 Subject: [PATCH 5/5] opencv : reverted url_for_version modifications --- var/spack/repos/builtin/packages/openssl/package.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py index 36a33204fd..a225e30f6c 100644 --- a/var/spack/repos/builtin/packages/openssl/package.py +++ b/var/spack/repos/builtin/packages/openssl/package.py @@ -1,5 +1,3 @@ -import urllib - from spack import * class Openssl(Package):