diff --git a/recipes/libnetcdf/bld.bat b/recipes/libnetcdf/bld.bat new file mode 100644 index 0000000000000..ab6344f657ac6 --- /dev/null +++ b/recipes/libnetcdf/bld.bat @@ -0,0 +1,22 @@ +mkdir %SRC_DIR%\build +cd %SRC_DIR%\build + + +set LIB=%LIBRARY_LIB%;%LIB% +set LIBPATH=%LIBRARY_LIB%;%LIBPATH% +set INCLUDE=%LIBRARY_INC%;%INCLUDE% +set HDF5_DIR=%LIBRARY_PREFIX%\cmake + +cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% -DCMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% %SRC_DIR% +if errorlevel 1 exit 1 + +cmake -G "NMake Makefiles" ^ + -DBUILD_SHARED_LIBS=ON ^ + -DENABLE_TESTS=OFF ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ + -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% %SRC_DIR% +if errorlevel 1 exit 1 + +cmake --build . --target INSTALL --config Release +if errorlevel 1 exit 1 diff --git a/recipes/libnetcdf/build.sh b/recipes/libnetcdf/build.sh new file mode 100644 index 0000000000000..bbe36cbf839f8 --- /dev/null +++ b/recipes/libnetcdf/build.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [[ $(uname) == Darwin ]]; then + export LIBRARY_SEARCH_VAR=DYLD_FALLBACK_LIBRARY_PATH +else + export LIBRARY_SEARCH_VAR=LD_LIBRARY_PATH +fi + +export LDFLAGS="-L$PREFIX/lib $LDFLAGS" +export CFLAGS="-I$PREFIX/include $CFLAGS" +export CPPFLAGS="-I$PREFIX/include $CPPFLAGS" + +./configure --prefix=$PREFIX \ + --enable-shared \ + --enable-static \ + --enable-extra-example-tests \ + --disable-doxygen \ + --enable-netcdf-4 \ + --enable-ncgen4 \ + --enable-dap \ + --enable-hdf4 + +make +# https://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg11423.html +eval ${LIBRARY_SEARCH_VAR}=$PREFIX/lib make check || cat ncdump/test-suite.log +make install + +rm -rf $PREFIX/share diff --git a/recipes/libnetcdf/meta.yaml b/recipes/libnetcdf/meta.yaml new file mode 100644 index 0000000000000..91b587586f701 --- /dev/null +++ b/recipes/libnetcdf/meta.yaml @@ -0,0 +1,49 @@ +{% set version = "4.4.0" %} + +package: + name: libnetcdf + version: {{ version }} + +source: + fn: v{{ version }}.tar.gz + url: https://github.com/Unidata/netcdf-c/archive/v{{ version }}.tar.gz + md5: 4e3d3b05ab53d0ae6036a1a0fe1506e5 + +build: + number: 0 + features: + - vc9 # [win and py27] + - vc10 # [win and py34] + - vc14 # [win and py35] + +requirements: + build: + - python # [win] + - m4 # [unix] + - pkg-config # [unix] + - msinttypes # [win] + - cmake # [win] + - curl + - zlib 1.2* + - hdf4 + - hdf5 1.8.15* + run: + - curl + - zlib 1.2* + - hdf4 + - hdf5 1.8.15* + +test: + commands: + - nc-config --all # [unix] + +about: + home: http://www.unidata.ucar.edu/software/netcdf/ + license: MIT + summary: libraries and data formats that support array-oriented scientific data + +extra: + recipe-maintainers: + - jakirkham + - groutr + - ocefpaf diff --git a/recipes/libnetcdf/run_test.sh b/recipes/libnetcdf/run_test.sh new file mode 100644 index 0000000000000..318ce7ebb5de1 --- /dev/null +++ b/recipes/libnetcdf/run_test.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ncdump -h http://geoport-dev.whoi.edu/thredds/dodsC/estofs/atlantic