summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/arpack-ng/package.py
blob: 6b152f786311decc2206e2dd657260b18cb88873 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from spack import *


class ArpackNg(Package):
    """
    ARPACK-NG is a collection of Fortran77 subroutines designed to solve large scale eigenvalue problems.

    Important Features:

    * Reverse Communication Interface.
    * Single and Double Precision Real Arithmetic Versions for Symmetric,
      Non-symmetric, Standard or Generalized Problems.
    * Single and Double Precision Complex Arithmetic Versions for Standard or
      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.

    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.

    arpack-ng is replacing arpack almost everywhere.
    """
    homepage = 'https://github.com/opencollab/arpack-ng'
    url = 'https://github.com/opencollab/arpack-ng/archive/3.3.0.tar.gz'

    version('3.3.0', 'ed3648a23f0a868a43ef44c97a21bad5')

    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
    # see https://github.com/opencollab/arpack-ng/issues/34
    patch('pdlamch10.patch', when='@3.3:')

    depends_on('blas')
    depends_on('lapack')
    depends_on('automake')
    depends_on('autoconf')
    depends_on('libtool@2.4.2:')

    depends_on('mpi', when='+mpi')

    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')

        options = ['--prefix=%s' % prefix]

        if '+mpi' in spec:
            options.extend([
                '--enable-mpi',
                'F77=mpif77' #FIXME: avoid hardcoding MPI wrapper names
            ])

        if '~shared' in spec:
            options.append('--enable-shared=no')

        bootstrap()
        configure(*options)
        make()
        make('install')