summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/libsharp/package.py
blob: a80eb7f58fe9eeb724dc8cd8b6fd3973f1742884 (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
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *


class Libsharp(AutotoolsPackage):
    """Libsharp is a code library for spherical harmonic transforms (SHTs) and
    spin-weighted spherical harmonic transforms, which evolved from the libpsht
    library."""

    variant('openmp', default=True, description='Build with openmp support')
    variant('mpi', default=True, description='Build with MPI support')

    homepage = "https://github.com/Libsharp/libsharp"
    git      = "https://github.com/Libsharp/libsharp.git"

    version('1.0.0', commit='cc4753ff4b0ef393f0d4ada41a175c6d1dd85d71')
    version('2018-01-17', commit='593d4eba67d61827191c32fb94bf235cb31205e1')

    depends_on('autoconf', type='build')
    depends_on('mpi', when='+mpi')

    def autoreconf(self, spec, prefix):
        """Generate autotools configuration"""
        bash = which('bash')
        bash('autoconf')

    def configure_args(self):
        args = []
        if '+openmp' not in self.spec:
            args.append("--disable-openmp")
        if '+mpi' not in self.spec:
            args.append("--disable-mpi")
        return args

    def install(self, spec, prefix):
        install_tree('auto/include', join_path(prefix, 'include'))
        install_tree('auto/lib', join_path(prefix, 'lib'))