Skip to content

Commit

Permalink
Update ESMF 8.3.0 to use external PIO (spack#102)
Browse files Browse the repository at this point in the history
* Update ESMF to use external PIO and fix PIO versions
  • Loading branch information
kgerheiser committed Jun 16, 2022
1 parent 0b75448 commit cfa4b72
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
16 changes: 13 additions & 3 deletions var/spack/repos/builtin/packages/esmf/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Esmf(MakefilePackage):
maintainers = ['climbfuji']

version('8.3.0', sha256='0ff43ede83d1ac6beabd3d5e2a646f7574174b28a48d1b9f2c318a054ba268fd')
version('8.3.0b09', commit='5b7e546c4b')
version('8.2.0', sha256='3693987aba2c8ae8af67a0e222bea4099a48afe09b8d3d334106f9d7fc311485')
version('8.1.1', sha256='58c2e739356f21a1b32673aa17a713d3c4af9d45d572f4ba9168c357d586dc75')
version('8.0.1', sha256='9172fb73f3fe95c8188d889ee72fdadb4f978b1d969e1d8e401e8d106def1d84')
Expand All @@ -47,6 +48,7 @@ class Esmf(MakefilePackage):
depends_on('netcdf-fortran@3.6:', when='+netcdf')
depends_on('parallel-netcdf@1.2.0:', when='+pnetcdf')
depends_on('xerces-c@3.1.0:', when='+xerces')
depends_on('parallelio@2.5.7:', when='@8.3.0: +pio')

# Testing dependencies
depends_on('perl', type='test')
Expand Down Expand Up @@ -261,9 +263,17 @@ def edit(self, spec, prefix):
# and NetCDF formats through ParallelIO (PIO), a third-party IO
# software library that is integrated in the ESMF library.

# PIO-dependent features will be enabled and will use the
# PIO library that is included and built with ESMF.
os.environ['ESMF_PIO'] = 'internal'
# FIXME - When ESMF beta is no longer needed set this to 8.3.0:
if spec.satisfies('@8.3.0b12:'):
# ESMF 8.3.0 introduced external PIO
os.environ['ESMF_PIO'] = 'external'
os.environ['ESMF_PIO_INCLUDE'] = spec['parallelio'].prefix.include
os.environ['ESMF_PIO_LIBPATH'] = spec['parallelio'].prefix.lib
else:
# PIO-dependent features will be enabled and will use the
# PIO library that is included and built with ESMF.
os.environ['ESMF_PIO'] = 'internal'

else:
# Disables PIO-dependent code.
os.environ['ESMF_PIO'] = 'OFF'
Expand Down
10 changes: 8 additions & 2 deletions var/spack/repos/builtin/packages/parallelio/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ class Parallelio(CMakePackage):

maintainers = ['tkameyama']

version('2_5_4', sha256='e51dc71683da808a714deddc1a80c2650ce847110383e42f1710f3ba567e7a65')
version('2_5_2', sha256='935bc120ef3bf4fe09fb8bfdf788d05fb201a125d7346bf6b09e27ac3b5f345c')
version('2.5.7', sha256='af8af04e41af17f98f2c90b996ef0d8bcd980377e0b35e57b38938c7fdc87cbd')
version('2.5.4', sha256='e51dc71683da808a714deddc1a80c2650ce847110383e42f1710f3ba567e7a65')
version('2.5.2', sha256='935bc120ef3bf4fe09fb8bfdf788d05fb201a125d7346bf6b09e27ac3b5f345c')

variant('pnetcdf', default=False, description='enable pnetcdf')
variant('timing', default=False, description='enable GPTL timing')
Expand All @@ -32,10 +33,15 @@ class Parallelio(CMakePackage):
resource(name='CMake_Fortran_utils',
git='https://github.com/CESM-Development/CMake_Fortran_utils.git',
tag='master')

resource(name='genf90',
git='https://github.com/PARALLELIO/genf90.git',
tag='genf90_200608')

def url_for_version(self, version):
url = 'https://github.com/NCAR/ParallelIO/archive/refs/tags/pio{}.tar.gz'
return url.format(version.underscored)

def cmake_args(self):
define = self.define
define_from_variant = self.define_from_variant
Expand Down

0 comments on commit cfa4b72

Please sign in to comment.