From bf7cb3dca9c95782ff83fb54f095a00eeb96ddc9 Mon Sep 17 00:00:00 2001 From: Hironori-Yamaji <52182908+Hironori-Yamaji@users.noreply.github.com> Date: Wed, 28 Aug 2019 08:32:18 +0900 Subject: New package: openfdtd (#12498) --- .../repos/builtin/packages/openfdtd/package.py | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 var/spack/repos/builtin/packages/openfdtd/package.py diff --git a/var/spack/repos/builtin/packages/openfdtd/package.py b/var/spack/repos/builtin/packages/openfdtd/package.py new file mode 100644 index 0000000000..50a4049bd3 --- /dev/null +++ b/var/spack/repos/builtin/packages/openfdtd/package.py @@ -0,0 +1,49 @@ +# Copyright 2013-2019 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 Openfdtd(MakefilePackage): + """OpenFDTD is general purpose FDTD simulator applicable to a wide range + of applications. The FDTD method (Finite Difference Time Domain method) + is a method for numerically calculating the Maxwell equation, which is + the basic equation of the electromagnetic field, + by the difference method.""" + + homepage = "http://www.e-em.co.jp/OpenFDTD/" + url = "http://www.e-em.co.jp/OpenFDTD/OpenFDTD.zip" + + version('2.3.0', sha256='10ac70f2ed7160da87dd9222a5a17ca7b72365ee886235359afc48c4fb7b4be4') + + variant('mpi', default=False, description='Build with MPI Support') + + depends_on('mpi', when='+mpi') + + def edit(self, spec, prefix): + filter_file('gcc', spack_cc, './src/Makefile_gcc') + if '+mpi' in self.spec: + filter_file('mpicc', spec['mpi'].mpicc, './mpi/Makefile_gcc') + + # Openfdtd has "Makefile" and "Makefile_gcc". + # "Makefile" is used only in Windows development environment. + # The build in Windows development environment is currently unsupported. + def build(self, spec, prefix): + with working_dir('src'): + make('-f', 'Makefile_gcc') + + # To make an executable file for mpi needs object files + # which are made for an executable file not for mpi. + # Therefore, the build in the "src" directory is necessary + # for to make an executable file for mpi. + if '+mpi' in self.spec: + with working_dir('mpi'): + make('-f', 'Makefile_gcc') + + def install(self, spec, prefix): + mkdirp(prefix.bin) + install('ofd', prefix.bin) + if '+mpi' in self.spec: + install('ofd_mpi', prefix.bin) -- cgit v1.2.3-60-g2f50