openfdtd: add version 2.6.3, 2.7.1, 2.7.3 and support Fujitsu Compiler. (#28472)

This commit is contained in:
Toyohisa Kameyama 2022-02-05 04:54:39 +09:00 committed by GitHub
parent c29e6dbd20
commit 797c061743
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,18 +16,35 @@ class Openfdtd(MakefilePackage):
homepage = "http://www.e-em.co.jp/OpenFDTD/" homepage = "http://www.e-em.co.jp/OpenFDTD/"
url = "http://www.e-em.co.jp/OpenFDTD/OpenFDTD.zip" url = "http://www.e-em.co.jp/OpenFDTD/OpenFDTD.zip"
version('2.7.3', sha256='22171d1dd74b4e48299b0d0c69ca933aac89d4eb77c59f579af35861eaca0faa')
version('2.7.1', sha256='3fb5fbeca3dc63243a6dc116d0f3ce3d1a854b4813f3928812ae99e07575ab1a')
version('2.6.3', sha256='1551cce7f96c1c53ad5d5e676bce2b26fd1593dd5f492a801e976a8a65a42a00')
version('2.6.0', sha256='92f7b92dc55ff6d8fc8c31eda77ca10fe25a5f54b002f2523a3d67f485d77e9f') version('2.6.0', sha256='92f7b92dc55ff6d8fc8c31eda77ca10fe25a5f54b002f2523a3d67f485d77e9f')
version('2.3.0', sha256='10ac70f2ed7160da87dd9222a5a17ca7b72365ee886235359afc48c4fb7b4be4', version('2.3.0', sha256='10ac70f2ed7160da87dd9222a5a17ca7b72365ee886235359afc48c4fb7b4be4')
url='http://www.e-em.co.jp/OpenFDTD/old/OpenFDTD_230.zip')
variant('mpi', default=False, description='Build with MPI Support') variant('mpi', default=False, description='Build with MPI Support')
depends_on('mpi', when='+mpi') depends_on('mpi', when='+mpi')
def url_for_version(self, version):
url = self.url
if version < Version('2.7.3'):
url = 'http://www.e-em.co.jp/OpenFDTD/old/OpenFDTD_{0}.zip'
return url.format(version.joined)
def edit(self, spec, prefix): def edit(self, spec, prefix):
filter_file('gcc', spack_cc, './src/Makefile_gcc') makefiles = [join_path('src', 'Makefile_gcc')]
if '+mpi' in self.spec: if spec.satisfies('+mpi'):
filter_file('mpicc', spec['mpi'].mpicc, './mpi/Makefile_gcc') makefiles.append(join_path('mpi', 'Makefile_gcc'))
for makefile in makefiles:
m = FileFilter(makefile)
m.filter('gcc', spack_cc)
m.filter('-fopenmp', self.compiler.openmp_flag)
if spec.satisfies('+mpi'):
m.filter('mpicc', spec['mpi'].mpicc)
if spec.satisfies('%fj'):
m.filter('-Ofast', '-Kfast,ocl -D_VECTOR')
m.filter('-O2', '-Kfast,ocl -D_VECTOR')
# Openfdtd has "Makefile" and "Makefile_gcc". # Openfdtd has "Makefile" and "Makefile_gcc".
# "Makefile" is used only in Windows development environment. # "Makefile" is used only in Windows development environment.