summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/shengbte/package.py
blob: c56dac10cd14ea9606f297f906fd5604ae9cf01e (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
# 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 Shengbte(MakefilePackage):
    """ShengBTE is a software package for solving the Boltzmann Transport
    Equation for phonons."""

    homepage = "www.shengbte.org"
    url = "www.shengbte.org/downloads/ShengBTE-v1.1.1-8a63749.tar.bz2"

    license("GPL-3.0-only")

    version(
        "1.1.1-8a63749", sha256="43920740d19ae854c8ecae0b648acfdf1d7726ca4c2b44f1a1684457f2f88522"
    )

    depends_on("mpi")
    depends_on("spglib")
    depends_on("mkl")

    parallel = False

    build_directory = "Src"

    def edit(self, spec, prefix):
        arch_make = join_path(self.build_directory, "arch.make")
        copy("arch.make.example", arch_make)
        filter_file("export FFLAGS=.*", "export FFLAGS=-debug -O2", arch_make)
        filter_file(
            "export LDFLAGS=.*", "export LDFLAGS=" + spec["spglib"].libs.ld_flags, arch_make
        )

        filter_file("export MPIFC=.*", "export MPIFC=%s" % spec["mpi"].mpifc, arch_make)
        filter_file("LAPACK=.*", "LAPACK=" + spec["mkl"].libs.ld_flags, arch_make)

    def install(self, spec, prefix):
        mkdirp(prefix.bin)
        install("ShengBTE", prefix.bin)