Skip to content

Commit

Permalink
Adding netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed May 21, 2016
1 parent 28a1fc0 commit df697ae
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 0 deletions.
22 changes: 22 additions & 0 deletions recipes/libnetcdf/bld.bat
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions recipes/libnetcdf/build.sh
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions recipes/libnetcdf/meta.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions recipes/libnetcdf/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

ncdump -h http://geoport-dev.whoi.edu/thredds/dodsC/estofs/atlantic

0 comments on commit df697ae

Please sign in to comment.