summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/fstrack/package.py
blob: 4a0da90af87e3e6fdcc8dc9ae22d817b49289bdb (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
# Copyright 2013-2024 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 Fstrack(MakefilePackage):
    """Package with tools to analyze symmetry components of elastic tensors,
    predict synthetic waveforms and compute automated shear wave splitting
    along ray paths, and to track finite strain and predict LPO from mantle
    flow given on GMT/netcdf grds."""

    homepage = "http://www-udc.ig.utexas.edu/external/becker/data.html#fstrack"
    url = "http://www-udc.ig.utexas.edu/external/becker/software/fstrack-0.5.3.092918.tgz"

    license("Unlicense")

    version(
        "0.5.3.092918", sha256="34b31687fdfa207b9659425238b805eaacf0b0209e7e3343c1a3cb4c9e62345d"
    )

    variant("flow", default=True, description="Build the flow tracker")

    depends_on("gmt@4.0:4", when="+flow")
    depends_on("netcdf-c", when="+flow")

    parallel = False

    def setup_build_environment(self, env):
        # Compilers
        env.set("F90", spack_fc)

        # Compiler flags (assumes GCC)
        env.set("CFLAGS", "-O2")
        env.set("FFLAGS", "-ffixed-line-length-132 -x f77-cpp-input -O2")
        env.set("FFLAGS_DEBUG", "-g -x f77-cpp-input")
        env.set("F90FLAGS", "-O2 -x f95-cpp-input")
        env.set("F90FLAGS_DEBUG", "-g -x f95-cpp-input")
        env.set("LDFLAGS", "-lm")

        if "+flow" in self.spec:
            env.set("GMTHOME", self.spec["gmt"].prefix)
            env.set("NETCDFDIR", self.spec["netcdf-c"].prefix)

    def build(self, spec, prefix):
        with working_dir("eispack"):
            make()

        with working_dir("d-rex"):
            make()

        with working_dir("fstrack"):
            if "+flow" in spec:
                make("really_all")
            else:
                make()