Skip to content

Commit

Permalink
Merge pull request #21797 from xylar/libpnetcdf
Browse files Browse the repository at this point in the history
Add recipe for libpnetcdf
  • Loading branch information
carterbox authored Jul 6, 2023
2 parents f553f2d + eecabba commit 497e346
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
21 changes: 21 additions & 0 deletions recipes/libpnetcdf/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -xe

export MPICC=mpicc
export MPICXX=mpicxx
export MPIF77=mpifort
export MPIF90=mpifort

./configure --prefix=${PREFIX} \
--with-mpi=${PREFIX} \
--enable-shared=yes \
--enable-static=no

make

# MPI tests aren't working in CI (not uncommon)
# make check
# make ptest

make install
3 changes: 3 additions & 0 deletions recipes/libpnetcdf/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mpi:
- openmpi
- mpich
71 changes: 71 additions & 0 deletions recipes/libpnetcdf/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{% set version = "1.12.3" %}
{% set build = 0 %}

# recipe-lint fails if mpi is undefined
{% set mpi = mpi or 'mpich' %}
{% if mpi == "mpich" %}
# prioritize mpich via build number
{% set build = build + 100 %}
{% endif %}

package:
name: libpnetcdf
version: {{ version }}

source:
url: https://parallel-netcdf.github.io/Release/pnetcdf-{{ version }}.tar.gz
sha256: 439e359d09bb93d0e58a6e3f928f39c2eae965b6c97f64e67cd42220d6034f77

build:
number: {{ build }}
skip: True # [win]
{% set mpi_prefix = "mpi_" + mpi %}
# add build string so packages can depend on mpi variants dependencies:
# `PKG_NAME * mpi_mpich_*` for mpich
# `PKG_NAME * mpi_*` for any mpi
string: {{ mpi_prefix }}_h{{ PKG_HASH }}_{{ build }}

run_exports:
- {{ pin_subpackage('libpnetcdf', max_pin='x.x.x') }} {{ mpi_prefix }}_*

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('fortran') }}
- m4
- make
host:
- {{ mpi }}

test:
commands:
- pnetcdf-config --all
- test -f ${PREFIX}/lib/pkgconfig/pnetcdf.pc
- test -f ${PREFIX}/include/pnetcdf
- test -f ${PREFIX}/include/pnetcdf.h
- test -f ${PREFIX}/include/pnetcdf.mod
- test -f ${PREFIX}/include/pnetcdf.inc
- test ! -f ${PREFIX}/lib/libpnetcdf.a
- test -f ${PREFIX}/lib/libpnetcdf${SHLIB_EXT}
- pnetcdf-config --has-c++ | grep -q yes
- pnetcdf-config --has-fortran | grep -q yes
# disabled for now
# - pnetcdf-config --netcdf4 | grep -q enabled


about:
home: https://parallel-netcdf.github.io/
license: custom
license_file: COPYRIGHT
summary: |
PnetCDF is a high-performance parallel I/O library for accessing Unidata's
NetCDF, files in classic formats, specifically the formats of CDF-1, 2, and
5.
dev_url: https://github.com/Parallel-NetCDF/PnetCDF

extra:
recipe-maintainers:
- xylar
- zklaus
- jedwards4b

0 comments on commit 497e346

Please sign in to comment.