We recommned that you build against the 1.8.x tree of HDF5. Although older version of H5Part work with the 1.6.x branch, current and future releases may not.
Download and install HDF5 1.8:
Build H5Part:
./configureFor the parallel implementation configure with
./configure --enable-parallelIf you also want to build fortran bindings, add the
--enable-fortran
flag to the configure line.
make
to build the library. The libraries are
named accordingly.
make tests
to build regression tests
and/or example programs for H5Part. These tests are
#include
< H5Part.h >
into your
source file.
$CC -Ipath_to_H5Part.h
-Ipath_to_hdf5.h -o outfile
MyFile.cc -Lpath_to_libH5Part.a -lH5Part
-Lpath_to_libhdf5 -lhdf5 -lz -lsz
#include
< H5Part.h >
into your
source file.
$MPICC -Ipath_to_H5Part.h
-Ipath_to_hdf5.h -DPARALLEL_IO
-DH5_HAVE_PARALLEL -o outfile
MyFile.cc -Lpath_to_libH5Part.a -lH5Part
-Lpath_to_libhdf5 -lhdf5 -lz -lsz
include
'H5Part.inc'
into your
source file.
$FC -Ipath_to_H5Part.h
-Ipath_to_hdf5.h -o outfile
MyFile.cc -Lpath_to_libH5PartF.a -lH5PartF
-Lpath_to_libhdf5 -lhdf5 -lz -lsz -lc
include
'H5Part.inc'
into your
source file.
$MPIF90 -Ipath_to_H5Part.h
-o outfile
MyFile.cc -Lpath_to_libpH5PartF.a -lpH5PartF
-Lpath_to_libhdf5 -lhdf5 -lz -lsz -lc
Makefile.in
.
The configure script pays attention to the following
configure options;
--enable-fortran
flag to the ./configure line, it
will create a small test program to determine how to generate
the fortran bindings and then create a library that includes
those bindings. You may need to set the fortran compiler by
setting the FC
environment variable in your shell.mpicc
if it is available. If no
mpicc
is available it will use the regular
C-compiler and will try to locate the location of the MPI
include files and libraries. You can assist the configure
program in its search by setting the MPIROOT
environment variable.H5ROOT
for serial or
PHDF5ROOT
for parallel builds). All of these
environment variables can also be overidden in the Makefile that
is generated by the autoconfigure script.
The configure script pays attention to the following
environment variables;
CC
environment variable to tell the
configure script where to find the C compiler. You can
also directly modify this variable in the
Makefile
that is generated by the autoconfigureCXX
environment variable to tell the
configure script where to find the C++ compiler. You can
also directly modify this variable in the
Makefile
that is generated by the autoconfigureFC
environment variable to tell the
configure script where to find the fortran compiler. You can
also directly modify this variable in the
Makefile
that is generated by the autoconfigurempicc
script. Normally, mpicc
is
merely a wrapper script for a build using a regular C-compiler.
If no mpicc
is available, then the
configure
script will attempt to locate the mpi
header files and libraries. In that case, it may be useful to
define the MPI_HOME
environment variable.PHDF5ROOT
environment variable.
module add intel
module add hdf5_par
CC=icc CXX=icc FC=ifort MPICC=icc MPICXX=icc MPIFC=ifort
./configure --enable-fortran --enable-parallel --with-hdf5path=$HDF5_PAR_DIR
make install
module add hdf5_par
CC=mpicc CXX=mpicxx FC=mpif90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90
./configure --enable-fortran --enable-parallel --with-hdf5path=$HDF5_PAR_DIR
make install
module add hdf5_par
module add zlib
module add szip
export CC=cc CXX=CC FC=ftn MPICC=cc MPICXX=CC MPIFC=ftn
export LDFLAGS=${HDF5} ${SZIP} ${ZLIB}
./configure --enable-parallel --with-hdf5path=$HDF5_PAR_DIR
make install
(NOTE: Can't compile with --enable-fortran option, since configure
throws an error about a fortran flag.)