263 lines
10 KiB
HTML
263 lines
10 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<title>Put your title here!!</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<meta name="keywords" content="scientific visualization">
|
|
<meta name="sitemap" content="put a brief descriptive phrase here that will show up in the site map:foo">
|
|
|
|
|
|
<div id="maincenter">
|
|
|
|
|
|
<head>
|
|
<title>Building H5Part</title>
|
|
</head>
|
|
|
|
<body bgcolor="#F0F0F0">
|
|
<font face="arial,helvetica" size="+2" color="#555588"><h2>Building H5Part</h2></font>
|
|
<UL>
|
|
<LI><a href="#Quickstart">Quickstart guide for the impatient.</a>
|
|
<LI><a href="#Details">Details of the Configuration Script</a>
|
|
<!-- <LI><a href="UsingC++.html">Using the C++ interface</a> -->
|
|
<LI><a href="#ConfigOptions">Important Configure Options</a>
|
|
<LI><a href="#EnvVariables">Important Environment Variables</a>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a name="Quickstart">
|
|
<h2>Quickstart <i>for the impatient</i></h2>
|
|
</a>
|
|
|
|
<OL>
|
|
|
|
<LI><b>Configure</b>:<br>
|
|
For the serial implementation
|
|
<pre>
|
|
./configure
|
|
</pre>
|
|
For the parallel implementation configure with
|
|
<pre>
|
|
./configure --enable-parallel
|
|
</pre>
|
|
If you also want to build fortran bindings, add the
|
|
<code>--enable-fortran</code> flag to the configure line.
|
|
</LI><p>
|
|
|
|
<LI><b>Make the Library</b>:<br>
|
|
Type <code>make</code> to build the library. The libraries are
|
|
named accordingly.
|
|
<UL>
|
|
<LI>libH5Part.a: Serial C/C++ Library.</LI>
|
|
<LI>libpH5Part.a: Parallel C/C++ library.</LI>
|
|
<LI>libH5PartF.a: Serial F77/F90 library.</LI>
|
|
<LI>libpH5PartF.a: Parallel F77/F90 library.</LI>
|
|
</UL>
|
|
</LI><p>
|
|
|
|
<LI><b>Make Regression Tests and Examples</b>:<br>
|
|
Just type <code>make tests</code> to build regression tests
|
|
and/or example programs for H5Part. These tests are
|
|
<UL>
|
|
<LI>H5PartF: Fortran example (only build if --enable-fortran
|
|
is specified).</LI>
|
|
<LI>H5PartFpar: Parallel Fortran example (only built if both
|
|
--enable-fortran and --enable-parallel are specified).</LI>
|
|
<LI>H5PartTest: Serial C example. This test writes a sample
|
|
datafile and then reopens it for reading. It demonstrates
|
|
the most basic reading/writing capabilities.</LI>
|
|
<LI>H5PartTestP: Parallel C example (only built if
|
|
--enable-parallel is specified). This program only works
|
|
as an MPI/parallel program.</LI>
|
|
<LI>Bench: This program will only be built if
|
|
--enable-parallel is specified. It compares the
|
|
performance of raw binary
|
|
I/O (one file per processor), raw binary MPI-IO based
|
|
parallel I/O to a single file, and the parallel H5Part/HDF5 to
|
|
a single file. Generally, H5Part should be very close to the
|
|
MPI-IO implementation in terms of performance, but slower
|
|
than one-file-per-processor. If HDF5 is slower the
|
|
MPI-IO, it would indicate that some performance tuning
|
|
will be required for your platform (contact us, and we will
|
|
see what we can do!).</LI>
|
|
</UL>
|
|
</LI><p>
|
|
<LI><b>Building Your Own Programs</b>:<br>
|
|
There are many different subtleties to linking on various
|
|
computer platforms, but typically one does the following.
|
|
<UL>
|
|
<LI>C/C++ Serial:
|
|
<br><code>#include
|
|
< H5Part.h > </code> into your
|
|
source file.
|
|
<br><code>$CC -I<i>path_to_H5Part.h</i>
|
|
-I<i>path_to_hdf5.h</i> -o outfile
|
|
MyFile.cc -L<i>path_to_libH5Part.a</i> -lH5Part
|
|
-L<i>path_to_libhdf5</i> -lhdf5 -lz <i>-lsz</i></code>
|
|
</LI>
|
|
<LI>C/C++ Parallel:
|
|
<br><code>#include
|
|
< H5Part.h > </code> into your
|
|
source file.
|
|
<br><code>$MPICC -I<i>path_to_H5Part.h</i>
|
|
-I<i>path_to_hdf5.h</i> -DPARALLEL_IO
|
|
-DH5_HAVE_PARALLEL -o outfile
|
|
MyFile.cc -L<i>path_to_libH5Part.a</i> -lH5Part
|
|
-L<i>path_to_libhdf5</i> -lhdf5 -lz <i>-lsz</i></code>
|
|
</LI>
|
|
|
|
<LI>Fortran Serial:
|
|
<br><code>include
|
|
'H5Part.inc'</code> into your
|
|
source file.
|
|
<br><code>$FC -I<i>path_to_H5Part.h</i>
|
|
-I<i>path_to_hdf5.h</i> -o outfile
|
|
MyFile.cc -L<i>path_to_libH5PartF.a</i> -lH5PartF
|
|
-L<i>path_to_libhdf5</i> -lhdf5 -lz <i>-lsz</i> -lc</code>
|
|
</LI>
|
|
<LI>Fortran Parallel:
|
|
<br><code>include
|
|
'H5Part.inc'</code> into your
|
|
source file.
|
|
<br><code>$MPIF90 -I<i>path_to_H5Part.h</i>
|
|
-o outfile
|
|
MyFile.cc -L<i>path_to_libpH5PartF.a</i> -lpH5PartF
|
|
-L<i>path_to_libhdf5</i> -lhdf5 -lz <i>-lsz</i> -lc</code>
|
|
</LI><p>
|
|
</UL>
|
|
|
|
</OL>
|
|
|
|
<hr>
|
|
|
|
<a name="Details">
|
|
<h1>Details for H5Part Configure and Build</h1>
|
|
</a>
|
|
|
|
|
|
<a name="ConfigOptions">
|
|
<h2>Configure Options</h2>
|
|
</a>
|
|
H5Part uses GNU Autoconf to generate a Makefile from the makefile
|
|
template called <code>Makefile.in</code>.
|
|
The configure script pays attention to the following
|
|
configure options;<p>
|
|
|
|
<UL>
|
|
<LI><b>--prefix=PREFIX</b> Install files in PREFIX</LI>
|
|
<LI><b>--enable-fortran</b> By default H5part will make no attempt to
|
|
build Fortran bindings. If you add the
|
|
<code>--enable-fortran</code> 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 <code>FC</code> environment variable in your shell.</LI>
|
|
<LI><b>--enable-parallel</b> The version of HDF5 that you build for
|
|
Parallel I/O differs from the library you would build for
|
|
serial I/O. Consequently, the H5Part libraries must be built
|
|
specifically for the kind of I/O you have in mind (parallel or
|
|
serial). The configure script will attempt to find an
|
|
<code>mpicc</code> if it is available. If no
|
|
<code>mpicc</code> 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 <code>MPIROOT</code>
|
|
environment variable.</LI>
|
|
<LI><b>--enable-tools</b> Builds the currently available tools
|
|
<br>
|
|
<b>h5pAttrib</b>, an inspection tool that prints the number of timesteps in a file
|
|
the file attributes, the step attributes, the dataset names and their values.
|
|
<br>
|
|
<b>h5pToGNUplot</b>, a converter to two column ASCII format to load in GNUplot.
|
|
</LI>
|
|
<LI><b>--enable-python</b><font color=red> Under construction</font> Option to build python bindings. It has not been tested.
|
|
</LI>
|
|
<LI><b>--help</b> Prints configure options.
|
|
</LI>
|
|
</UL>
|
|
<p>
|
|
|
|
<a name="MakeOptions">
|
|
<h2>Make Options</h2>
|
|
</a>
|
|
|
|
<UL>
|
|
<LI>make</LI>builds the libraries and test programs
|
|
<LI>make install</LI>builds and installs
|
|
<LI>make clean</LI>removes extraneous object files
|
|
<LI>make distclean</LI>returns configuration to unconfigured state
|
|
</UL>
|
|
|
|
<a name="EnvVariables">
|
|
<h2>Environment Variables for Configure</h2>
|
|
</a>
|
|
The
|
|
configuration script is of limited intelligence. Sometimes, you
|
|
have to define the following environment variables in order to
|
|
help it on its way. You will often only need to tell it where to
|
|
find the HDF5 libraries (<code>H5ROOT</code> for serial or
|
|
<code>PHDF5ROOT</code> 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;
|
|
<p>
|
|
|
|
<UL>
|
|
<LI><b>CC</b>: Use the <code>CC</code> environment variable to tell the
|
|
configure script where to find the C compiler. You can
|
|
also directly modify this variable in the
|
|
<code>Makefile</code> that is generated by the autoconfigure</LI>
|
|
<LI><b>CXX</b>: Use the <code>CXX</code> environment variable to tell the
|
|
configure script where to find the C++ compiler. You can
|
|
also directly modify this variable in the
|
|
<code>Makefile</code> that is generated by the autoconfigure</LI>
|
|
<LI><b>FC</b>: Use the <code>FC</code> environment variable to tell the
|
|
configure script where to find the fortran compiler. You can
|
|
also directly modify this variable in the
|
|
<code>Makefile</code> that is generated by the autoconfigure</LI>
|
|
<LI><b>MPICC</b>: If you are building for parallel C I/O, then it is
|
|
useful to tell the configure script where to find the
|
|
<code>mpicc</code> script. Normally, <code>mpicc</code> is
|
|
merely a wrapper script for a build using a regular C-compiler.
|
|
If no <code>mpicc</code> is available, then the
|
|
<code>configure</code> script will attempt to locate the mpi
|
|
header files and libraries. In that case, it may be useful to
|
|
define the <code>MPI_HOME</code> environment variable.</LI>
|
|
<LI><b>MPICXX</b>If you are building for parallel C++</LI>
|
|
<LI><b>MPIFC</b>: If you are building for parallel Fortran I/O, then it is
|
|
useful to tell the configure script where to find the parallel fortran compiler.
|
|
<LI><b>MPIROOT</b>: Set this environment variable to help the
|
|
configure script to locate the MPI libraries that should be
|
|
used to build the parallel version of the libraries. This
|
|
variable will be ignored if configured only to build the
|
|
serial implementation of the library.</LI>
|
|
<LI><b>HDF5ROOT</b>: Find the path to your serial HDF5 installation. If you
|
|
are building the serial version of H5part, then you should set
|
|
the <code>PHDF5ROOT</code> environment variable.</LI>
|
|
</UL><p>
|
|
|
|
<h3>Common compiler environemt variables for NERSC platforms</h3>
|
|
<UL>
|
|
<LI><b>DaVinci</b>: Linux ia64 </LI>
|
|
CC=icc CXX=icc F90=ifort MPICC=icc MPIFC=ifort MPILIB=-L/usr/lib/ -lmpi MPIINC=-I/usr/include
|
|
<LI><b>Bassi</b>: AIX</LI>
|
|
CC=cc_r CXX=cc_r FC=xlf_r MPICC=mpcc_r MPICXX=mpcc_r MPIFC=mpxlf_r
|
|
<LI><b>Jacquard</b>: Linux x86_64</LI>
|
|
CC=pathcc CXX=pathCC FC=pathf90 MPICC=mpicc MPICXX=mpicxx MPIFC=mpif90
|
|
<LI><b>Starsky.lbl.gov:</b> (Darwin) PowerPC</LI>
|
|
CC=gcc CXX=g++ FC=g95
|
|
</UL>
|
|
<br>
|
|
NOTE: You might need to set the MPI library path (MPILIB) and MPI includes (MPIIINC) if they are in non standard places. For example: <br>
|
|
MPILIB=-L/usr/lpp/ppe.poe/lib -lmpi_r MPIINC=-I/usr/lpp/ppe.poe/include/thread
|
|
<h3>How to set the variables for configure:</h3>
|
|
It is very simple just call env with the variables together with configure. Notice the quotes in MPILIB.
|
|
<pre>
|
|
% env CC=icc CXX=icc F90=ifort MPICC=icc MPILIB=-L/usr/lib/ -lmpi MPIINC=-I/usr/include ./configure (configure options follow here)
|
|
</pre>
|
|
In the worst case, you can edit the <code>src/Makefile.am</code> and <code>test/Makefile.am</code> as
|
|
needed to perform the proper build.
|
|
</div>
|
|
|