From 246c07f864d2db571f7e3ab55e875a4e75b93281 Mon Sep 17 00:00:00 2001 From: homerdin Date: Fri, 14 Jul 2017 15:55:51 -0500 Subject: New Package: miniFE (#4712) * New Package: miniFE * Removed extra property, using variant value directly --- var/spack/repos/builtin/packages/minife/package.py | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 var/spack/repos/builtin/packages/minife/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/minife/package.py b/var/spack/repos/builtin/packages/minife/package.py new file mode 100644 index 0000000000..ced755d112 --- /dev/null +++ b/var/spack/repos/builtin/packages/minife/package.py @@ -0,0 +1,80 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## + +import tarfile + +from spack import * + + +class Minife(MakefilePackage): + """Proxy Application. MiniFE is an proxy application + for unstructured implicit finite element codes. + """ + + homepage = "https://mantevo.org/" + url = "http://mantevo.org/downloads/releaseTarballs/miniapps/MiniFE/miniFE-2.0.1.tgz" + + tags = ['proxy-app'] + + version('2.0.1', '3113d7c8fc01495d08552672b0dbd015') + + variant('build', default='ref', description='Type of Parallelism', + values=('ref', 'openmp_ref', 'qthreads', 'kokkos')) + + depends_on('mpi') + depends_on('qthreads', when='build=qthreads') + + @property + def build_version(self): + return self.version.up_to(2) + + @property + def build_targets(self): + targets = [ + '--directory=miniFE-{0}_{1}/src'.format( + self.build_version, self.spec.variants['build'].value), + 'CXX={0}'.format(self.spec['mpi'].mpicxx), + 'CC={0}'.format(self.spec['mpi'].mpicc) + ] + + return targets + + def edit(self, spec, prefix): + inner_tar = tarfile.open(name='miniFE-{0}_{1}.tgz'.format( + self.build_version, + self.spec.variants['build'].value)) + inner_tar.extractall() + + makefile = FileFilter('miniFE-{0}_{1}/src/Makefile'.format( + self.build_version, + self.spec.variants['build'].value)) + + makefile.filter('-fopenmp', self.compiler.openmp_flag, string=True) + + def install(self, spec, prefix): + mkdirp(prefix.bin) + install('miniFE-{0}_{1}/src/miniFE.x'.format( + self.build_version, self.spec.variants['build'].value), + prefix.bin) -- cgit v1.2.3-70-g09d2