2005-08-20 04:15:36 +08:00
|
|
|
************************************************************************
|
|
|
|
HDF5 Build and Install Instructions for Cygwin
|
|
|
|
************************************************************************
|
|
|
|
|
|
|
|
Preconditions:
|
|
|
|
--------------
|
|
|
|
|
2010-06-02 03:22:18 +08:00
|
|
|
1. Installed Cygwin 1.7.5 or higher
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
To install the Cygwin net release, go to http://www.cygwin.com and
|
|
|
|
click on "Install or update now!" icon. This will download a GUI
|
|
|
|
installer called setup.txt which can be run to download a complete
|
|
|
|
Cygwin installation via the internet. Then follow the instructions
|
|
|
|
on each screen to install Cygwin.
|
|
|
|
|
|
|
|
Cygwin uses packages to manage installing various software. Users can
|
|
|
|
choose to install or uninstall certain packages by running setup.exe.
|
|
|
|
http://www.cygwin.com/packages/ provides detailed information about
|
|
|
|
Cygwin packages.
|
|
|
|
|
|
|
|
To build HDF5 on Cygwin, Devel package (including gcc,gcc-g++,
|
|
|
|
gcc-g77, and gcc-java compiles, and gdb tool) should be installed.
|
|
|
|
|
|
|
|
2. Compilers Installed
|
|
|
|
|
2008-05-15 03:36:38 +08:00
|
|
|
2.1 C/C++ Compilers HDF5-1.8 Supported
|
2005-08-20 04:15:36 +08:00
|
|
|
|
2010-06-02 03:22:18 +08:00
|
|
|
gcc (4.3.4), which includes:
|
|
|
|
gcc4-core : C compiler
|
|
|
|
gcc4-g++ : C++ compiler
|
|
|
|
gcc4-fortran : fortran compiler
|
2005-08-20 04:15:36 +08:00
|
|
|
|
2010-06-02 03:22:18 +08:00
|
|
|
2.2 Using Compilers Not Supported
|
2005-08-20 04:15:36 +08:00
|
|
|
|
2010-06-02 03:22:18 +08:00
|
|
|
The compilers in 2.1 are supported and tested by HDF
|
2005-08-20 04:15:36 +08:00
|
|
|
group. Any other compilers may still work but they are not
|
|
|
|
guaranteed by HDF group.
|
|
|
|
|
2010-06-02 03:22:18 +08:00
|
|
|
If users want to use other compilers except those in 2.1,
|
2005-08-20 04:15:36 +08:00
|
|
|
try to set the following variables to override the default
|
|
|
|
choices.
|
|
|
|
|
|
|
|
CXX : C++ compiler command
|
|
|
|
FC : Fortran compiler command
|
|
|
|
|
|
|
|
For example, if users want to use pgf90 as fortran compiler, then
|
|
|
|
|
|
|
|
setenv FC pgf90
|
|
|
|
|
|
|
|
3. HDF5 Dependencies
|
|
|
|
|
|
|
|
3.1 Zlib
|
|
|
|
|
|
|
|
zlib-1.2.2 or later is supported and tested on Cygwin.
|
|
|
|
|
|
|
|
3.2 Szip
|
|
|
|
The HDF5 library has a predefined compression filter that uses
|
|
|
|
the extended-Rice lossless compression algorithm for chunked
|
|
|
|
datatsets. For more information about Szip compression and
|
|
|
|
license terms see
|
2007-02-27 04:43:21 +08:00
|
|
|
http://hdfgroup.org/HDF5/doc_resource/SZIP/index.html.
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
The latest supported public release of SZIP is available from
|
2007-02-27 04:43:21 +08:00
|
|
|
ftp://ftp.hdfgroup.org/lib-external/szip/2.0. Binary distribution can be
|
|
|
|
found under ftp://ftp.hdfgroup.org/lib-external/szip/2.0/bin/cygwin
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
Install HDF5 on Cygwin
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
1. Get HDF5 source code package
|
|
|
|
Users can download HDF5 source code package from HDF website
|
2007-02-27 04:43:21 +08:00
|
|
|
(http://hdfgroup.org).
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
2. Unpacking the distribution
|
|
|
|
|
|
|
|
The HDF5 source code is distributed in a variety of formats which
|
|
|
|
can be unpacked with the following commands, each of which creates
|
2010-06-02 03:22:18 +08:00
|
|
|
an `hdf5-1.8.5' directory.
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
2.1 Non-compressed tar archive (*.tar)
|
|
|
|
|
2010-06-02 03:22:18 +08:00
|
|
|
$ tar xf hdf5-1.8.5.tar
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
2.2 Gzip'd tar archive (*.tar.gz)
|
|
|
|
|
2010-06-02 03:22:18 +08:00
|
|
|
$ gunzip < hdf5-1.8.5.tar.gz | tar xf -
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
2.3 Bzip'd tar archive (*.tar.bz2)
|
|
|
|
|
2010-06-02 03:22:18 +08:00
|
|
|
$ bunzip2 < hdf5-1.8.5.tar.bz2 | tar xf -
|
2008-05-17 02:48:26 +08:00
|
|
|
|
|
|
|
2. Setup Environment
|
|
|
|
|
|
|
|
In Cygwin, most compilers and setting are automatically detected during
|
|
|
|
the configure script. However, if you are building Fortran we recommend
|
|
|
|
that you explicitly set the "FC" variable in your environment to use the
|
2010-06-02 03:22:18 +08:00
|
|
|
gfortran compiler. For example, issue the command:
|
2008-05-17 02:48:26 +08:00
|
|
|
|
2010-06-02 03:22:18 +08:00
|
|
|
$ export FC=gfortran
|
2005-08-20 04:15:36 +08:00
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
4. Configuring
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
Notes: See detailed information in hdf5/release_docs/INSTALL,
|
|
|
|
part 5. Full installation instructions for source
|
|
|
|
distributions
|
|
|
|
|
|
|
|
The host configuration file for cygwin i686-pc-cygwin is located
|
|
|
|
in the `config' directory and are based on architecture name,
|
|
|
|
vendor name, and operating system which are displayed near the
|
|
|
|
beginning of the `configure' output. The host config file influences
|
|
|
|
the behavior of configure by setting or augmenting shell variables.
|
|
|
|
|
|
|
|
In short,
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
To configure HDF5 C Library, using
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
$ ./configure
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
To configure HDF5 C/C++ Library, using
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
$ ./configure --enable-cxx
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
To configure HDF5 C/Fortran Library, using
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
$ ./configure --enable-fortran
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
To configure HDF5 C with Szip library, using
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
$ ./configure --with-szlib="path to szlib"
|
|
|
|
|
|
|
|
For example, if szip library was installed in the directory
|
|
|
|
/cygdrive/c/szip, which is parent directory of "include" and
|
|
|
|
"lib", then the following command will configure HDF5 C library
|
|
|
|
with szip enabled:
|
|
|
|
|
|
|
|
$ ./configure --with-szlib=/cygdrive/c/szip
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
To configure HDF5 C without Zlib,
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
To disable zlib, using
|
|
|
|
|
|
|
|
$ ./configure --without-zlib
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
Two ways to configure HDF5 C with specified Zlib
|
2005-08-20 04:15:36 +08:00
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
Using
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
$ ./configure --with-zlib=INCDIR,LIBDIR
|
|
|
|
|
|
|
|
For example, if the zlib library is installed in
|
|
|
|
/cygdrive/c/usr, which is the parent directory of directories
|
|
|
|
"include" and "lib",
|
|
|
|
|
|
|
|
$ ./configure --with-zlib=/cygdrive/c/usr/include,/cygdrive/c/usr/lib
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
Through the CPPFLAGS and LDFLAGS Variables
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
For example, if zlib was installed in the directory
|
|
|
|
/cygdrive/c/usr then using the following command to configure
|
|
|
|
HDF5 with zib
|
|
|
|
|
|
|
|
$ CPPFLAGS=-I/cygdrive/c/usr/include \
|
|
|
|
$ LDFLAGS=-L/cygdrive/c/usr/lib \
|
|
|
|
$ ./configure
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
To specify the installation directories, using
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
$ ./configure --prefix="path for installation"
|
|
|
|
|
|
|
|
By default, HDF5 library, header files, examples, and
|
|
|
|
support programs will be installed in /usr/local/lib,
|
|
|
|
/usr/local/include, /usr/local/doc/hdf5/examples, and
|
|
|
|
/usr/local/bin. To use a path other than /usr/local specify
|
|
|
|
the path with the `--prefix=PATH' switch as in the above
|
|
|
|
command.
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
Combination of Switches
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
All of the above switches can be combined together. For
|
|
|
|
example, if users want to configure HDF5 C/C++/Fortran
|
|
|
|
library with szip library enabled, with zlib library at
|
|
|
|
/cygdrive/c/usr/, and install HDF5 into directory
|
2011-08-10 02:55:31 +08:00
|
|
|
/cygdrive/c/hdf5 using gcc/g++ as C/C++ compiler and gfortran
|
2005-08-20 04:15:36 +08:00
|
|
|
as fortran compiler
|
|
|
|
|
|
|
|
$ ./configure
|
|
|
|
--with-szlib=/cygdrive/c/szip
|
|
|
|
--with-zlib=/cygdrive/c/usr/include,/cygdrive/c/usr/lib
|
|
|
|
--prefix=/cygdrive/c/hdf5
|
|
|
|
--enable-cxx
|
|
|
|
--enable-fortran
|
|
|
|
<"If no more switches, then hit Enter">
|
|
|
|
|
|
|
|
Notes: The command format above is for readilibity. In practice,
|
|
|
|
please type in the command above with at least one
|
|
|
|
space between each line, No "Enter" until users finish
|
|
|
|
the switches and want to run the configure.
|
|
|
|
|
|
|
|
|
|
|
|
or do it through CPPFLAGS and LDFLAGS variables:
|
|
|
|
|
|
|
|
$ CPPFLAGS=-I/cygdrive/c/usr/include \
|
|
|
|
$ LDFLAGS=-L/cygdrive/c/usr/lib \
|
|
|
|
|
|
|
|
$ ./configure
|
|
|
|
--with-szlib=/cygdrive/c/szip
|
|
|
|
--prefix=/cygdrive/c/hdf5
|
|
|
|
--enable-cxx
|
|
|
|
--enable-fortran
|
|
|
|
<"If no more switches, then hit Enter">
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
5. Make and Make Check
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
After configuration is done successfully, run the following series of
|
|
|
|
commands to build, test and install HDF5
|
|
|
|
|
|
|
|
$ make > "output file name"
|
|
|
|
$ make check > "output file name"
|
|
|
|
|
|
|
|
Before run "make install", check output file for "make check", there
|
|
|
|
should be no failures at all.
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
6. Make Install
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
$ make install > "output file name"
|
|
|
|
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
7. Check installed HDF5 library
|
2005-08-20 04:15:36 +08:00
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
After step 6, go to your installation directory, there should be
|
2005-08-20 04:15:36 +08:00
|
|
|
three subdirectories: "bin" "include" and "lib".
|
|
|
|
|
2008-05-17 02:48:26 +08:00
|
|
|
8. Known Problems
|
2005-08-20 04:15:36 +08:00
|
|
|
|
2008-05-15 03:36:38 +08:00
|
|
|
Shared libraries can not be built on Cygwin In release 1.8.
|
2005-08-20 04:15:36 +08:00
|
|
|
|
|
|
|
-----------------------------------------------------------------------
|
|
|
|
|
2007-02-27 04:43:21 +08:00
|
|
|
Need Further assistance, email help@hdfgroup.org
|