Fetching contributors…
Cannot retrieve contributors at this time
98 lines (74 sloc) 3.15 KB
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup mpi 1.0
PortGroup github 1.0
PortGroup cmake 1.0
PortGroup muniversal 1.0
github.setup Unidata netcdf-c 4.6.1 v
epoch 3
name netcdf
maintainers {takeshi @tenomoto} openmaintainer
platforms darwin
categories science
license Permissive
description libraries for array-oriented scientific data
long_description \
NetCDF (network Common Data Form) is a set of software libraries \
and machine-independent data formats that support the creation, \
access, and sharing of array-oriented scientific data.
checksums rmd160 33803fb0ad7fbb4da272f606e728d0120572a9ad \
sha256 240708c8c35dd698081c6d1d4bcea3026f6e4f1779e77f2f02e537603dbdc50e \
size 18203153
compilers.choose cc cpp
cmake.out_of_source yes
patchfiles patch-CMakeLists.txt.diff
configure.args-append -DENABLE_NETCDF_4=OFF \
-DCMAKE_PREFIX_PATH=${worksrcpath}/cmake/modules yes test
default_variants +netcdf4 +dap
if {[variant_isset netcdf4]} {
mpi.enforce_variant hdf5
variant netcdf4 description {enable support for netcdf-4 API} {
depends_lib-append port:hdf5
configure.args-delete -DENABLE_NETCDF_4=OFF
configure.args-append -DENABLE_NETCDF_4=ON
variant hdf4 description {enable support for hdf4} {
depends_lib-append port:hdf4 \
patchfiles-append patch-liblib-CMakeLists.txt.diff
configure.args-append -DENABLE_HDF4=ON
variant dap description {enable dap} {
depends_lib-append port:curl
configure.args-delete -DENABLE_DAP=OFF
configure.args-append -DENABLE_DAP=ON \
if { [variant_exists universal] && [variant_isset universal] } {
pre-configure {
# record configure date (as cmake does) but ensure date will be the same for achitectures
# helps ensure libnetcdf.settings is the same for all architectures
set date [exec "/bin/date"]
reinplace "s|@CONFIG_DATE@|${date}|g" ${worksrcpath}/
merger-post-destroot {
foreach arch ${universal_archs_to_use} {
reinplace "s|${build.dir}-${arch}|${build.dir}|g" ${destroot}-${arch}${prefix}/lib/libnetcdf.settings
if {[mpi_variant_isset]} {
configure.cflags-append -DHDF5_PARALLEL
configure.args-append -DENABLE_PARALLEL_TESTS=ON
notes "
As of version 4.2 c++ and fortran interfaces are separate ports,\
netcdf-cxx and netcdf-fortran, respectively.
github.livecheck.regex {([^"rba]+)}