summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/nn-c/package.py
blob: 7392fddf3d02413b457861dc115f845f7bb47585 (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
# Copyright 2013-2023 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.package import *


class NnC(AutotoolsPackage):
    """nn: Natural Neighbours interpolation. nn is a C code
    for Natural Neighbours interpolation of 2D scattered data.
    It provides a C library and a command line utility nnbathy."""

    homepage = "https://github.com/sakov/nn-c"
    git = "https://github.com/sakov/nn-c.git"

    version("master", branch="master")
    version("1.86.2", commit="343c7784d38d3270d75d450569fc0b64767c37e9")

    variant("pic", default=True, description="Produce position-independent code (for shared libs)")

    configure_directory = "nn"

    def configure_args(self):
        args = []
        if "+pic" in self.spec:
            args.extend(
                [
                    "CFLAGS={0}".format(self.compiler.cc_pic_flag),
                    "CXXFLAGS={0}".format(self.compiler.cxx_pic_flag),
                    "FFLAGS={0}".format(self.compiler.fc_pic_flag),
                ]
            )
        return args