Hai All,
I installed Netcdf4 along with Hdf5 in ubuntu 14.04 LTS 64-bit.
You can follow the below steps to do the same.
szip
Download latest source of zlib from here http://www.zlib.net/ and install it
by
$ ./configure; make; sudo make install
Download szip from http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz
and extract it.
$ ./configure --prefix=/usr/local/szip
$ make; sudo make install
HDF5
We need to find the path of POSIX to enable threads in hdf configuration.
In the configure of hdf5, Â –with-pthread option must point to the directory that contains the POSIX Threads library install ([DIR]/includes/pthread.h, [DIR]/lib/libpthread*)
So lets locate it as shown below.
$ locate pthread.h -> /usr/include/
$ locate libpthread.a -> /usr/lib/x86_64-linux-gnu/
$ locate libpthread.so -> /usr/lib/x86_64-linux-gnu/
Download hdf5 latest source from http://www.hdfgroup.org/HDF5/release/obtainsrc.html
I downloaded http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.13.tar.bz2
and extract it and then go inside
$ ./configure --prefix=/usr/local/hdf5 --enable-fortran --enable-cxx --with-szlib=/usr/local/szip --enable-threadsafe --with-pthread=/usr/include/,/usr/lib/x86_64-linux-gnu/ --enable-hl --enable-shared --enable-unsupported
Note 1: In above configuration removed –enable-parallel, since it gives error on “mpi.h” while doing make.
Note 2: More over ROMS forum suggest that parallel netCDF will not improve much scaleup on model speedup. so lets go with single mode as for now.
SUMMARY OF THE HDF5 CONFIGURATION
========================
General Information:
——————-
HDF5 Version: 1.8.13
Configured on: Mon Feb 2 10:55:19 IST 2015
Configured by: tuxcoder@Ocean
Configure mode: production
Host system: x86_64-unknown-linux-gnu
Uname information: Linux Ocean 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Byte sex: little-endian
Libraries: static, shared
Installation point: /usr/local/hdf5
Compiling Options:
——————
Compilation Mode: production
C Compiler: /usr/bin/gcc
CFLAGS:
H5_CFLAGS: -std=c99 -pedantic -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2 -Wunreachable-code -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat -Wstrict-overflow -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -O3 -fomit-frame-pointer -finline-functions
AM_CFLAGS:
CPPFLAGS:
H5_CPPFLAGS: -D_POSIX_C_SOURCE=199506L -DNDEBUG -UH5_DEBUG_API
AM_CPPFLAGS: -I/usr/include/ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_BSD_SOURCE
Shared C Library: yes
Static C Library: yes
Statically Linked Executables: no
LDFLAGS:
H5_LDFLAGS:
AM_LDFLAGS: -L/usr/local/szip/lib -L/usr/lib/x86_64-linux-gnu/
Extra libraries: -lpthread -lz -ldl -lm
Archiver: ar
Ranlib: ranlib
Debugged Packages:
API Tracing: no
Languages:
———-
Fortran: yes
Fortran Compiler: /usr/bin/gfortran
Fortran 2003 Compiler: no
Fortran Flags:
H5 Fortran Flags:
AM Fortran Flags:
Shared Fortran Library: yes
Static Fortran Library: yes
C++: yes
C++ Compiler: /usr/bin/g++
C++ Flags:
H5 C++ Flags:
AM C++ Flags:
Shared C++ Library: yes
Static C++ Library: yes
Features:
———
Parallel HDF5: no
High Level library: yes
Threadsafety: yes
Default API Mapping: v18
With Deprecated Public Symbols: yes
I/O filters (external): deflate(zlib)
I/O filters (internal): shuffle,fletcher32,nbit,scaleoffset
MPE: no
Direct VFD: no
dmalloc: no
Clear file buffers before write: yes
Using memory checker: no
Function Stack Tracing: no
Strict File Format Checks: no
Optimization Instrumentation: no
Large File Support (LFS): yes
$ make
$ sudo make install
NetCdf4
Download latest netcdf from http://www.unidata.ucar.edu/downloads/netcdf/index.jsp
I downloaded netcdf-4.3.2 from here
extract it and go inside it.
$ CPPFLAGS="-I/usr/local/szip/include -I/usr/local/hdf5/include"
LDFLAGS="-L/usr/local/szip/lib -L/usr/local/hdf5/lib"
./configure --prefix=/usr/local/netcdf4 --enable-netcdf-4 --enable-shared
$ make
$ make check
================================================
Testsuite summary for netCDF 4.3.2
================================================
# TOTAL: 2
# PASS: 2
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
================================================
$ sudo make install
Thats’ it!