-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unifies flexpart-ifs, -opr and -fdb (#860)
- Loading branch information
1 parent
93e868a
commit 77ed8e0
Showing
7 changed files
with
58 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,20 @@ class FdbFortran(CMakePackage): | |
depends_on('eckit') | ||
depends_on('metkit') | ||
depends_on('eccodes +fortran') | ||
|
||
depends_on('[email protected]:') | ||
|
||
|
||
def cmake_args(self): | ||
args = [ | ||
self.define('Deckit_DIR', self.spec['eckit'].prefix), | ||
self.define('Dmetkit_DIR', self.spec['metkit'].prefix), | ||
self.define('Deccodes_DIR', self.spec['eccodes'].prefix), | ||
self.define('Dfdb5_DIR', self.spec['fdb'].prefix), | ||
] | ||
return args | ||
@property | ||
def libs(self): | ||
return find_libraries("libfdbf", | ||
root=self.prefix, | ||
shared=False, | ||
recursive=True) | ||
|
||
def cmake_args(self): | ||
args = [ | ||
self.define('Deckit_DIR', self.spec['eckit'].prefix), | ||
self.define('Dmetkit_DIR', self.spec['metkit'].prefix), | ||
self.define('Deccodes_DIR', self.spec['eccodes'].prefix), | ||
self.define('Dfdb5_DIR', self.spec['fdb'].prefix), | ||
] | ||
return args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,12 @@ class Fdb(SpackFdb): | |
|
||
depends_on("[email protected]:", type="build", when="@5.11.6:") | ||
|
||
@property | ||
def libs(self): | ||
return find_libraries("libfdb5", | ||
root=self.prefix, | ||
shared=True, | ||
recursive=True) | ||
|
||
def setup_build_environment(self, env): | ||
env.set('CTEST_OUTPUT_ON_FAILURE', 1) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,49 @@ | ||
# 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 * | ||
from distutils.dir_util import copy_tree | ||
|
||
|
||
class FlexpartIfs(MakefilePackage): | ||
"""flexpart is a Lagrangian dispersion model""" | ||
|
||
homepage = 'https://github.com/MeteoSwiss-APN/flexpart-ifs' | ||
url = 'https://github.com/MeteoSwiss-APN/flexpart-ifs/archive/refs/tags/v9.2mch.tar.gz' | ||
git = '[email protected]:MeteoSwiss-APN/flexpart-ifs.git' | ||
homepage = 'https://github.com/MeteoSwiss/flexpart' | ||
url = 'https://github.com/MeteoSwiss/flexpart/archive/refs/tags/v10.4.4.tar.gz' | ||
git = '[email protected]:MeteoSwiss/flexpart.git' | ||
maintainers = ['pirmink'] | ||
|
||
version('meteoswiss-10', branch='meteoswiss-10') | ||
version('main', branch='main') | ||
version('fdb', tag='10.4.4_fdb') | ||
version('10.4.4', tag='10.4.4') | ||
|
||
depends_on('eccodes jp2k=none +fortran') | ||
depends_on('eccodes +fortran') | ||
depends_on('netcdf-fortran') | ||
depends_on('fdb-fortran', when='@fdb') | ||
|
||
conflicts('%nvhpc') | ||
conflicts('%pgi') | ||
|
||
build_directory = 'src' | ||
|
||
@property | ||
def build_targets(self): | ||
return ['ncf=yes', 'VERBOSE=1', 'serial'] | ||
|
||
def edit(self, spec, prefix): | ||
copy('src/makefile.meteoswiss', 'src/makefile') | ||
|
||
def setup_build_environment(self, env): | ||
env.set('ECCODESROOT', self.spec['eccodes'].prefix) | ||
env.set( | ||
'ECCODES_LD_FLAGS', '-L' + self.spec['eccodes'].prefix + | ||
'/lib64 -leccodes_f90 -leccodes') | ||
env.set('EBROOTNETCDFMINFORTRAN', self.spec['netcdf-fortran'].prefix) | ||
#abuse of JASPER_LD_FLAGS since there is no other entrypoint var for LDFLAGS | ||
env.set('JASPER_LD_FLAGS', '-Wl,--no-relax') | ||
# not really required, just a default since the -I flags would be inconsistent with an empty string | ||
env.set('CURL_INCLUDES', '/usr') | ||
env.set('ECCODES_DIR', self.spec['eccodes'].prefix) | ||
env.set('ECCODES_LD_FLAGS', self.spec['eccodes:fortran'].libs.ld_flags) | ||
env.set('NETCDF_FORTRAN_INCLUDE', | ||
'-I' + self.spec['netcdf-fortran'].prefix.include) | ||
env.set('NETCDF_FORTRAN_LD_FLAGS', | ||
self.spec['netcdf-fortran'].libs.ld_flags) | ||
if self.spec.satisfies('@fdb'): | ||
env.set('FDB_DIR', self.spec['fdb'].prefix) | ||
env.set('FDB_LD_FLAGS', self.spec['fdb'].libs.ld_flags) | ||
env.set('FDB_FORTRAN_DIR', self.spec['fdb-fortran'].prefix) | ||
env.set('FDB_FORTRAN_LD_FLAGS', | ||
self.spec['fdb-fortran'].libs.ld_flags) | ||
|
||
def build(self, spec, prefix): | ||
with working_dir(self.build_directory): | ||
make('-f', 'makefile_meteoswiss') | ||
|
||
def install(self, spec, prefix): | ||
mkdir(prefix.bin) | ||
mkdir(prefix.share) | ||
mkdir(prefix.share + '/test/') | ||
mkdir(prefix.share + '/options/') | ||
copy_tree('options/', prefix.share + '/options/') | ||
install('src/FLEXPART', prefix.bin) | ||
install('test/*', prefix.share + '/test/') | ||
install(join_path(self.build_directory, 'FLEXPART'), prefix.bin) | ||
install_tree('test_meteoswiss', prefix.share.test_meteoswiss) | ||
install_tree('options', join_path(prefix.share, 'options')) | ||
install_tree('options.meteoswiss', | ||
join_path(prefix.share, 'options.meteoswiss')) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters