From b04b6e14490e4bdb61457741d52bded336751618 Mon Sep 17 00:00:00 2001 From: asmaahassan90 <31959389+asmaahassan90@users.noreply.github.com> Date: Tue, 28 Apr 2020 02:38:15 +0200 Subject: 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 * Update var/spack/repos/builtin/packages/shengbte/package.py update recipe as suggested by reviewer Co-Authored-By: Adam J. Stewart * enhance recipe remove white space; changes as suggested by reviewer Co-authored-by: Adam J. Stewart --- .../repos/builtin/packages/shengbte/package.py | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 var/spack/repos/builtin/packages/shengbte/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/shengbte/package.py b/var/spack/repos/builtin/packages/shengbte/package.py new file mode 100644 index 0000000000..59697a51ce --- /dev/null +++ b/var/spack/repos/builtin/packages/shengbte/package.py @@ -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) -- cgit v1.2.3-70-g09d2