From f5f7abd71f04b08a454c0a83dd87d2f806dcc23a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 6 Jul 2016 10:56:16 +0200 Subject: arpack-ng: add 3.4.0 with cmake build --- .../builtin/packages/arpack-ng/make_install.patch | 24 ++++++++++++++ .../repos/builtin/packages/arpack-ng/package.py | 38 +++++++++++++++++++--- .../builtin/packages/arpack-ng/parpack_cmake.patch | 17 ++++++++++ 3 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 var/spack/repos/builtin/packages/arpack-ng/make_install.patch create mode 100644 var/spack/repos/builtin/packages/arpack-ng/parpack_cmake.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/arpack-ng/make_install.patch b/var/spack/repos/builtin/packages/arpack-ng/make_install.patch new file mode 100644 index 0000000000..ad5cffcc19 --- /dev/null +++ b/var/spack/repos/builtin/packages/arpack-ng/make_install.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 607d221..50426c3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -389,3 +389,19 @@ target_link_libraries(bug_1323 arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) + add_test(bug_1323 Tests/bug_1323) + + add_dependencies(check dnsimp_test bug_1315_single bug_1315_double bug_1323) ++ ++############################ ++# install ++############################ ++# 'make install' to the correct location ++install(TARGETS arpack ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin) ++ ++if (MPI) ++ install(TARGETS parpack ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++ RUNTIME DESTINATION bin) ++endif () diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py index fcd5171a7d..c7501b5a6d 100644 --- a/var/spack/repos/builtin/packages/arpack-ng/package.py +++ b/var/spack/repos/builtin/packages/arpack-ng/package.py @@ -54,6 +54,7 @@ class ArpackNg(Package): homepage = 'https://github.com/opencollab/arpack-ng' url = 'https://github.com/opencollab/arpack-ng/archive/3.3.0.tar.gz' + version('3.4.0', 'ae9ca13f2143a7ea280cb0e2fd4bfae4') version('3.3.0', 'ed3648a23f0a868a43ef44c97a21bad5') variant('shared', default=True, description='Enables the build of shared libraries') @@ -61,16 +62,45 @@ class ArpackNg(Package): # The function pdlamch10 does not set the return variable. This is fixed upstream # see https://github.com/opencollab/arpack-ng/issues/34 - patch('pdlamch10.patch', when='@3.3:') + patch('pdlamch10.patch', when='@3.3.0') + + patch('make_install.patch', when='@3.4.0') + patch('parpack_cmake.patch', when='@3.4.0') depends_on('blas') depends_on('lapack') - depends_on('automake') - depends_on('autoconf') - depends_on('libtool@2.4.2:') + depends_on('automake', when='@3.3.0') + depends_on('autoconf', when='@3.3.0') + depends_on('libtool@2.4.2:', when='@3.3.0') + depends_on('cmake@2.8.6:', when='@3.4.0:') depends_on('mpi', when='+mpi') + @when('@3.4.0:') + def install(self, spec, prefix): + + options = ['-DEXAMPLES=ON'] + options.extend(std_cmake_args) + + # Arpack do directly find_package(BLAS REQUIRED) and + # find_package(LAPACK REQUIRED). + + if '+mpi' in spec: + options.append('-DMPI=ON') + + # TODO: -DINTERFACE64=ON + + if '+shared' in spec: + options.append('-DBUILD_SHARED_LIBS=ON') + + cmake('.', *options) + make() + # TODO: make test does not work + # make('test') + + make('install') + + @when('@3.3.0') def install(self, spec, prefix): # Apparently autotools are not bootstrapped # TODO: switch to use the CMake build in the next version diff --git a/var/spack/repos/builtin/packages/arpack-ng/parpack_cmake.patch b/var/spack/repos/builtin/packages/arpack-ng/parpack_cmake.patch new file mode 100644 index 0000000000..0ba8600046 --- /dev/null +++ b/var/spack/repos/builtin/packages/arpack-ng/parpack_cmake.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 607d221..345b7fc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -113,11 +113,12 @@ set_target_properties(arpack PROPERTIES OUTPUT_NAME arpack${LIBSUFFIX}) + + if (MPI) + # add_library(parpack SHARED +- add_library(parpack ++ add_library(parpack + ${parpacksrc_STAT_SRCS} + ${parpackutil_STAT_SRCS}) + + target_link_libraries(parpack ${MPI_Fortran_LIBRARIES}) ++ target_link_libraries(parpack arpack) + set_target_properties(parpack PROPERTIES OUTPUT_NAME parpack${LIBSUFFIX}) + endif () -- cgit v1.2.3-70-g09d2 From a47b3ba01bc3f93795c0702c3858784a64d3bd91 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 6 Jul 2016 13:23:51 +0200 Subject: arpack-ng: use spec['mpi'].mpif77 --- var/spack/repos/builtin/packages/arpack-ng/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py index c7501b5a6d..5adc8c0b8c 100644 --- a/var/spack/repos/builtin/packages/arpack-ng/package.py +++ b/var/spack/repos/builtin/packages/arpack-ng/package.py @@ -113,7 +113,7 @@ class ArpackNg(Package): if '+mpi' in spec: options.extend([ '--enable-mpi', - 'F77=mpif77' #FIXME: avoid hardcoding MPI wrapper names + 'F77=%s' % spec['mpi'].mpif77 ]) if '~shared' in spec: -- cgit v1.2.3-70-g09d2 From 63e45c586c93da209590c31e7185084af87fa316 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 6 Jul 2016 13:27:02 +0200 Subject: arpack-ng: flake8 fixes and minor update of incode comments --- .../repos/builtin/packages/arpack-ng/package.py | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py index 5adc8c0b8c..97f6ca3218 100644 --- a/var/spack/repos/builtin/packages/arpack-ng/package.py +++ b/var/spack/repos/builtin/packages/arpack-ng/package.py @@ -27,7 +27,8 @@ from spack import * class ArpackNg(Package): """ - ARPACK-NG is a collection of Fortran77 subroutines designed to solve large scale eigenvalue problems. + ARPACK-NG is a collection of Fortran77 subroutines designed to solve large + scale eigenvalue problems. Important Features: @@ -38,16 +39,17 @@ class ArpackNg(Package): Generalized Problems. * Routines for Banded Matrices - Standard or Generalized Problems. * Routines for The Singular Value Decomposition. - * Example driver routines that may be used as templates to implement numerous - Shift-Invert strategies for all problem types, data types and precision. + * Example driver routines that may be used as templates to implement + numerous Shift-Invert strategies for all problem types, data types and + precision. - This project is a joint project between Debian, Octave and Scilab in order to - provide a common and maintained version of arpack. + This project is a joint project between Debian, Octave and Scilab in order + to provide a common and maintained version of arpack. - Indeed, no single release has been published by Rice university for the last - few years and since many software (Octave, Scilab, R, Matlab...) forked it and - implemented their own modifications, arpack-ng aims to tackle this by providing - a common repository and maintained versions. + Indeed, no single release has been published by Rice university for the + last few years and since many software (Octave, Scilab, R, Matlab...) + forked it and implemented their own modifications, arpack-ng aims to tackle + this by providing a common repository and maintained versions. arpack-ng is replacing arpack almost everywhere. """ @@ -60,7 +62,8 @@ class ArpackNg(Package): variant('shared', default=True, description='Enables the build of shared libraries') variant('mpi', default=False, description='Activates MPI support') - # The function pdlamch10 does not set the return variable. This is fixed upstream + # The function pdlamch10 does not set the return variable. + # This is fixed upstream # see https://github.com/opencollab/arpack-ng/issues/34 patch('pdlamch10.patch', when='@3.3.0') @@ -82,8 +85,10 @@ class ArpackNg(Package): options = ['-DEXAMPLES=ON'] options.extend(std_cmake_args) - # Arpack do directly find_package(BLAS REQUIRED) and - # find_package(LAPACK REQUIRED). + # TODO: + # Arpack calls directly find_package(BLAS REQUIRED) and + # find_package(LAPACK REQUIRED). Make sure correct Blas/Lapack are + # picked up. if '+mpi' in spec: options.append('-DMPI=ON') @@ -103,8 +108,6 @@ class ArpackNg(Package): @when('@3.3.0') def install(self, spec, prefix): # Apparently autotools are not bootstrapped - # TODO: switch to use the CMake build in the next version - # rather than bootstrapping. which('libtoolize')() bootstrap = Executable('./bootstrap') -- cgit v1.2.3-70-g09d2 From c8fc56686cbab2f7f9d2dd76740604d2daeb9783 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 6 Jul 2016 13:42:59 +0200 Subject: arpack-ng: fix corrupted parpack_cmake.patch --- var/spack/repos/builtin/packages/arpack-ng/parpack_cmake.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/arpack-ng/parpack_cmake.patch b/var/spack/repos/builtin/packages/arpack-ng/parpack_cmake.patch index 0ba8600046..9b11bea6ac 100644 --- a/var/spack/repos/builtin/packages/arpack-ng/parpack_cmake.patch +++ b/var/spack/repos/builtin/packages/arpack-ng/parpack_cmake.patch @@ -3,15 +3,16 @@ index 607d221..345b7fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,11 +113,12 @@ set_target_properties(arpack PROPERTIES OUTPUT_NAME arpack${LIBSUFFIX}) - + if (MPI) # add_library(parpack SHARED -- add_library(parpack +- add_library(parpack + add_library(parpack ${parpacksrc_STAT_SRCS} ${parpackutil_STAT_SRCS}) - + target_link_libraries(parpack ${MPI_Fortran_LIBRARIES}) + target_link_libraries(parpack arpack) set_target_properties(parpack PROPERTIES OUTPUT_NAME parpack${LIBSUFFIX}) endif () + -- cgit v1.2.3-70-g09d2 From 3d755a148b1940218a3c990b1d8342ea88ae8012 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 6 Jul 2016 18:29:56 +0200 Subject: arpack-ng: fix binaries for macOS --- var/spack/repos/builtin/packages/arpack-ng/package.py | 1 + 1 file changed, 1 insertion(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py index 97f6ca3218..d9021f8043 100644 --- a/var/spack/repos/builtin/packages/arpack-ng/package.py +++ b/var/spack/repos/builtin/packages/arpack-ng/package.py @@ -84,6 +84,7 @@ class ArpackNg(Package): options = ['-DEXAMPLES=ON'] options.extend(std_cmake_args) + options.append('-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % prefix) # TODO: # Arpack calls directly find_package(BLAS REQUIRED) and -- cgit v1.2.3-70-g09d2