arpack-ng: add 3.4.0 with cmake build

This commit is contained in:
Denis Davydov 2016-07-06 10:56:16 +02:00
parent 2b9d02d594
commit f5f7abd71f
3 changed files with 75 additions and 4 deletions

View file

@ -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 ()

View file

@ -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

View file

@ -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 ()