diff options
author | Tomoki, Karatsu <49965247+t-karatsu@users.noreply.github.com> | 2021-01-19 16:55:18 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 08:55:18 +0100 |
commit | 5033250140ad34213af966c5416ad8d49df08677 (patch) | |
tree | 9c7748d81b3e5dfc48b7aa1afd50aaf5d4c02757 /var | |
parent | f781fd1878700e87868018a9d240ce9eb1c9f056 (diff) | |
download | spack-5033250140ad34213af966c5416ad8d49df08677.tar.gz spack-5033250140ad34213af966c5416ad8d49df08677.tar.bz2 spack-5033250140ad34213af966c5416ad8d49df08677.tar.xz spack-5033250140ad34213af966c5416ad8d49df08677.zip |
specfem3d-globe: add new package (#20830)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/specfem3d-globe/gcc_rm_werror.patch | 11 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/specfem3d-globe/package.py | 63 |
2 files changed, 74 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/specfem3d-globe/gcc_rm_werror.patch b/var/spack/repos/builtin/packages/specfem3d-globe/gcc_rm_werror.patch new file mode 100644 index 0000000000..f53c4661b7 --- /dev/null +++ b/var/spack/repos/builtin/packages/specfem3d-globe/gcc_rm_werror.patch @@ -0,0 +1,11 @@ +--- spack-src/flags.guess.org 2021-01-07 14:37:33.000000000 +0900 ++++ spack-src/flags.guess 2021-01-07 14:38:07.000000000 +0900 +@@ -115,7 +115,7 @@ + # with some versions of gfortran/gcc you make get errors about unused functions when compiling with the options below; + # if so, either change -Wunused to -Wunused -Werror=no-unused-function, or remove -Wunused, or remove -Werror + # +- DEF_FFLAGS="-std=gnu -fimplicit-none -frange-check -fmax-errors=10 -pedantic -pedantic-errors -Waliasing -Wampersand -Wcharacter-truncation -Wline-truncation -Wsurprising -Wno-tabs -Wunderflow -ffpe-trap=invalid,zero,overflow -Wunused -Werror" # -mcmodel=medium ++ DEF_FFLAGS="-std=gnu -fimplicit-none -frange-check -fmax-errors=10 -pedantic -pedantic-errors -Waliasing -Wampersand -Wcharacter-truncation -Wline-truncation -Wsurprising -Wno-tabs -Wunderflow -ffpe-trap=invalid,zero,overflow -Wunused" # -mcmodel=medium + OPT_FFLAGS="-O3 -finline-functions" + DEBUG_FFLAGS="-g -O0 -ggdb -fbacktrace -fbounds-check" + # useful to track loss of accuracy because of automatic double to single precision conversion: -Wconversion (this may generate many warnings...) diff --git a/var/spack/repos/builtin/packages/specfem3d-globe/package.py b/var/spack/repos/builtin/packages/specfem3d-globe/package.py new file mode 100644 index 0000000000..e331a2e8c8 --- /dev/null +++ b/var/spack/repos/builtin/packages/specfem3d-globe/package.py @@ -0,0 +1,63 @@ +# Copyright 2013-2021 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 Specfem3dGlobe(AutotoolsPackage, CudaPackage): + """Program specfem3D from SPECFEM3D_GLOBE is + a 3-D spectral-element solver for the Earth. + It uses a mesh generated by program meshfem3D.""" + + homepage = "https://github.com/geodynamics/specfem3d_globe" + url = "https://github.com/geodynamics/specfem3d_globe/archive/v7.0.2.tar.gz" + + version('7.0.2', sha256='78b4cfbe4e5121927ab82a8c2e821b65cdfff3e94d017303bf21af7805186d9b') + + variant('opencl', default=False, + description="Build with OpenCL code generator") + variant('openmp', default=True, + description="Build with OpenMP code generator") + variant('double-precision', default=False, + description="Treat REAL as double precision") + + depends_on('mpi') + depends_on('opencl', when='+opencl') + + # When building with the gcc compiler,'Werror' is added to FFLAGS. + # In the case of using the gcc compiler and the default simulation + # settings, there is the process which always causes + # array out-of-bounds reference error. + # This issue will be fixed in version 8.0.0, + # so, remove '-Werror' when building with gcc compiler + # in versions up to 7.0.2 of specfem3d-globe. + # https://github.com/geodynamics/specfem3d_globe/issues/717 + patch('gcc_rm_werror.patch', when='@:7.0.2%gcc') + + def configure_args(self): + args = [] + + if '+cuda' in self.spec: + args.append('--with-cuda') + args.append('CUDA_LIB={0}' + .format(spec['cuda'].libs.directories[0])) + args.append('CUDA_INC={0}' + .format(spec['cuda'].prefix.include)) + args.append('MPI_INC={0}' + .format(spec['mpi'].prefix.include)) + if '+opencl' in self.spec: + args.append('--with-opencl') + args.append('OCL_LIB={0}' + .format(spec['opencl'].libs.directories[0])) + args.append('OCL_INC={0}' + .format(spec['opencl'].prefix.include)) + + args.extend(self.enable_or_disable('openmp')) + args.extend(self.enable_or_disable('double-precision')) + + return args + + def install(self, spec, prefix): + install_tree('.', prefix) |