Skip to content

Commit

Permalink
Move variants/compiler flags from spack.yaml to relevant `package.p…
Browse files Browse the repository at this point in the history
…y`s (#103)

* access-om3-nuopc: Propagated build_type==RelWithDebInfo down fms, parallelio packages

* access-om3-nuopc: esmf: Added +debug

* access-om3-nuopc: parallelio: Added compiler flags

* access-om3-nuopc: fms: added compiler flags, removed +deprecated_io

* access-om3-nuopc: removed +debug, made flags intel-specific, made fms openmp based on variant

* access-om3-nuopc: Moved fms out of compiler-specific section, added `build_type` to non-intel parallelio

* Apply suggestions from code review

Co-authored-by: Micael Oliveira <micael.oliveira@anu.edu.au>

* access-om3-nuopc: Fixed fms depends_on syntax error, simplified intel check

---------

Co-authored-by: Micael Oliveira <micael.oliveira@anu.edu.au>
  • Loading branch information
CodeGat and micaeljtoliveira authored May 3, 2024
1 parent 70599a4 commit d764062
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/access-om3-nuopc/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import CMakePackage, variant, version
from spack.package import CMakePackage, variant, version, depends_on
from spack.compilers import supported_compilers


class AccessOm3Nuopc(CMakePackage):
Expand Down Expand Up @@ -56,9 +57,14 @@ class AccessOm3Nuopc(CMakePackage):
depends_on("mpi")
depends_on("netcdf-fortran@4.6.0:")
depends_on("esmf@8.3.0:")
depends_on("fms@2021.03:")
depends_on("parallelio@2.5.10:")
depends_on("fortranxml@4.1.2:")
depends_on("fms@2021.03: build_type==RelWithDebInfo precision=64 +large_file ~gfs_phys ~quad_precision")
depends_on("fms +openmp", when="+openmp")
depends_on("fms ~openmp", when="~openmp")

depends_on("parallelio@2.5.10: build_type==RelWithDebInfo")
if 'intel' in supported_compilers():
depends_on("parallelio fflags='-qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source' cflags='-qno-opt-dynamic-align -fp-model precise -std=gnu99'")

flag_handler = CMakePackage.build_system_flags

Expand Down

0 comments on commit d764062

Please sign in to comment.