From 87444aef7e939e9c10a66fb9eb288d02074c856a Mon Sep 17 00:00:00 2001 From: Toyohisa Kameyama Date: Fri, 3 Apr 2020 18:11:46 +0900 Subject: [PATCH] ppOpen-APPL/BEM-AT: added new package at v0.1.0 (#15841) --- .../ppopen-appl-bem-at/duplicate_defs.patch | 13 +++++ .../packages/ppopen-appl-bem-at/package.py | 58 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100755 var/spack/repos/builtin/packages/ppopen-appl-bem-at/duplicate_defs.patch create mode 100644 var/spack/repos/builtin/packages/ppopen-appl-bem-at/package.py diff --git a/var/spack/repos/builtin/packages/ppopen-appl-bem-at/duplicate_defs.patch b/var/spack/repos/builtin/packages/ppopen-appl-bem-at/duplicate_defs.patch new file mode 100755 index 0000000000..d21d9364e5 --- /dev/null +++ b/var/spack/repos/builtin/packages/ppopen-appl-bem-at/duplicate_defs.patch @@ -0,0 +1,13 @@ +diff --git a/framework_with_templates/OAT_bem-bb-fw-dense-0.1.0.f90 b/framework_with_templates/OAT_bem-bb-fw-dense-0.1.0.f90 +index edabbed..16c6a52 100644 +--- a/framework_with_templates/OAT_bem-bb-fw-dense-0.1.0.f90 ++++ b/framework_with_templates/OAT_bem-bb-fw-dense-0.1.0.f90 +@@ -1201,8 +1201,6 @@ contains + integer i, j + + include "OAT.h" +- integer iusw1_ppohBEMresidual_direct +- integer iusw1_ppohBEMmatvec_direct + + character*100 ctmp + diff --git a/var/spack/repos/builtin/packages/ppopen-appl-bem-at/package.py b/var/spack/repos/builtin/packages/ppopen-appl-bem-at/package.py new file mode 100644 index 0000000000..cba923eeea --- /dev/null +++ b/var/spack/repos/builtin/packages/ppopen-appl-bem-at/package.py @@ -0,0 +1,58 @@ +# 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 * +import os + + +class PpopenApplBemAt(MakefilePackage): + """ + ppOpen-APPL/BEM-AT is ppOpen-APPL/Bem with auto tuning. + If you want to use ppOpen-APPL/BERM-AT, please copy files in + src/framework_with_template from ppOpen-APPL/BEM install directory. + """ + + homepage = "http://ppopenhpc.cc.u-tokyo.ac.jp/ppopenhpc/" + url = "file://{0}/ppohBEM_AT_0.1.0.tar.gz".format(os.getcwd()) + + version('0.1.0', sha256='215034fea7d9f64e6361d8e605e04c7f5d302c87ce048dcd6d146b14d22c17f9') + # In OAT_bem-bb-fw-dense-0.1.0.f90 the 2 variables are defined. + # But ame variables are already defined in include file DAT.h. + # This patch is deleted the variables definitions + # in OAT_bem-bb-fw-dense-0.1.0.f90. + patch('duplicate_defs.patch', when="@0.1.0") + + depends_on('mpi') + depends_on('ppopen-appl-bem', type='run') + + parallel = False + build_directory = 'framework_with_templates' + build_targets = ['SYSTEM=spack'] + + def edit(self, spec, prefix): + flags = ['-O3', self.compiler.openmp_flag] + fflags = flags[:] + if spec.satisfies('%gcc'): + fflags.append('-ffree-line-length-none') + with open(join_path(self.build_directory, 'Makefile'), 'a') as m: + m.write('ifeq ($(SYSTEM),spack)\n') + m.write(' CC = {0}\n'.format(spec['mpi'].mpicc)) + m.write(' F90 = {0}\n'.format(spec['mpi'].mpifc)) + m.write(' CCFLAGS = {0}\n'.format(' '.join(flags))) + m.write(' F90FLAGS = {0}\n'.format(' '.join(fflags))) + m.write(' FFLAGS = {0}\n'.format(' '.join(fflags))) + m.write(' LDFLAGS = {0}\n'.format(' '.join(flags))) + m.write('endif\n') + + def install(self, spec, prefix): + install_src_dir = join_path(prefix.src, self.build_directory) + mkdir(prefix.bin) + mkdirp(install_src_dir) + for f in find(self.build_directory, '*.out'): + copy(f, prefix.bin) + install_src = join_path(prefix.src, self.build_directory) + install_tree(self.build_directory, install_src_dir) + with working_dir(install_src): + make('clean')