Add ShengBTE (#16154)

* Add ShengBTE

Adding a new package; ShengBTE. I tried adding it a MakefilePackage, and use build_directory = 'Src', but it was as if the build_directory gets ignored and make complains about target not found. and using the make funtion here instead of os.system, I get errors that config.f90 is not found which is already available under Src as well.

* more enhancmenets

fix lint; use mkl spec; use build_directory variable

* one more fix

* Use Makefile template

* Update var/spack/repos/builtin/packages/shengbte/package.py

use mkl instead of intel-mkl as a dependency

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/shengbte/package.py

update recipe as suggested by reviewer

Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>

* enhance recipe

remove white space; changes as suggested by reviewer

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
asmaahassan90 2020-04-28 02:38:15 +02:00 committed by GitHub
parent f314ff6639
commit b04b6e1449
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,39 @@
# Copyright 2013-2020 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 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"
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)