mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
ae3c53acf1
Add decriptions to use libtestD.dll. Description: libtestD.dll should be placed to a place that the user can find in order to test HDF5 DLL within HDF5 workspace. Solution: Explained in document. Platforms tested: No need Misc. update:
660 lines
19 KiB
Plaintext
660 lines
19 KiB
Plaintext
HDF5 Build and Install Instructions for Windows 2000/XP.
|
|
----------------------------------------------------------
|
|
|
|
The instructions which follow assume that you will be using the
|
|
source code release 'zip' file (hdf5-1_6_???.zip).
|
|
|
|
***************************WARNINGS****************************
|
|
Please read CAREFULLY about Preconditions before you go to the
|
|
following sections
|
|
|
|
Preconditions
|
|
|
|
1. Installed MicroSoft Developer Studio,Visual C++ 6.0 and
|
|
WinZip.
|
|
|
|
2. Set up a directory structure to unpack the library.
|
|
For example:
|
|
|
|
c:\ (any drive)
|
|
MyHDFstuff\ (any folder name)
|
|
|
|
4. HDF5 uses zlib for compression and zlib is NOT distributed
|
|
with hdf5 lib in 1.6.??? release. You have to install your own
|
|
zlib library or you may go to HDF web site
|
|
(ftp://ftp.ncsa.uiuc.edu/HDF/gzip/)
|
|
to download the correponding zlib library by yourself. If you
|
|
want to build HDF5 library without using zlib, please read section V.
|
|
|
|
5. HDF4-related tools are not built and released with HDF5 library
|
|
packages any more. To obtain HDF4-related tools, please check
|
|
http://hdf.ncsa.uiuc.edu/h4toh5/ and ftp://hdf.ncsa.uiuc.edu/HDF5/h4toh5/
|
|
|
|
6. For .NET users, please go to section VI.
|
|
|
|
7. For DLL users, please do read and follow "DLL hints" at Section IV.
|
|
|
|
8. For users who would like to build, test and use HDF5 snapshot release, please
|
|
read Section VII.
|
|
|
|
|
|
---------------------------------------------------------------
|
|
|
|
The following sections discuss installation procedures in detail:
|
|
|
|
Section I: What do we build and install
|
|
Section II: Building and testing hdf5 libraries and non-hdf4
|
|
related hdf5 tools
|
|
tools
|
|
Section III: Building an application using the HDF5 library or
|
|
DLL
|
|
Section IV: Some more helpful pointers
|
|
Section V: Disable gzip compression
|
|
Section VI: How to build in HDF5 in VS 7.0(.NET)
|
|
Section VII: Build and test HDF5 snapshot release
|
|
Section VIII: Misc.
|
|
|
|
|
|
***************************************************************
|
|
|
|
Section I:
|
|
|
|
What do we build and install?
|
|
|
|
HDF5 static library:
|
|
debug and release version
|
|
|
|
HDF5 Dynamic Link Library(DLL):
|
|
debug and release version as well as export libraries for
|
|
DLL
|
|
|
|
HDF5 tool library:
|
|
debug and release version
|
|
|
|
HDF5 tool export library for DLL:
|
|
debug and release version
|
|
|
|
HDF5 tools:
|
|
non-hdf4 related tools
|
|
|
|
HDF5 library testing programs:
|
|
hdf5 library related comprehensive tests
|
|
|
|
HDF5 related tools testing programs:
|
|
hdf5 tools testing programs
|
|
|
|
HDF5 examples:
|
|
simple HDF5 examples
|
|
|
|
NOTE: ** We use zlib 1.1.4 for both binary and source
|
|
release.
|
|
**
|
|
|
|
**************************************************************
|
|
|
|
Section II:
|
|
|
|
Building and testing hdf5 libraries and non-hdf4 related tools
|
|
|
|
==================================================
|
|
|
|
STEP 1: Building hdf5 libraries and non-hdf4 related tools
|
|
|
|
|
|
1. Unpack all.zip in 'hdf5' and move the zlib.dll from
|
|
c:\myHDFstuff\hdf5\src\zlib\dll to the Windows system
|
|
directory.
|
|
|
|
The system directory can usually be found under the path
|
|
C:\WINNT\system or C:\WINDOWS\system
|
|
|
|
2. Invoke Microsoft Visual C++, go to "File" and select
|
|
the "Open Workspace" option.
|
|
|
|
Then open the c:\myHDFstuff\hdf5\proj\all\all.dsw
|
|
workspace.
|
|
|
|
3. Select project hdf5dll, right click mouse; choose settings,
|
|
find "Link", go to the Category box and choose "Input",
|
|
go to the box "Object/library modules" and go to the end of the line;
|
|
see whether the zlib dll library path is the same as C:\zlib114\dll
|
|
or the correct path where you install your dll export library.
|
|
If not, replace the old zlib dll library path with the correct path.
|
|
|
|
You should do this for both Debug and release version.
|
|
|
|
4. Go to "Tools" and select "Options", find "Directories";
|
|
4.1 Find the box "Show directories for", choose "Include files",
|
|
If you cannot find your zlib header path(for example, C:\zlib114\include)
|
|
from the directory list,
|
|
add the header path(C:\zlib114\include) to the included directories.
|
|
4.2 Find the box "Show directories for", choose "Library files",
|
|
If you cannot find your zlib library path(for example, C:\zlib114\lib)
|
|
from the directory list,
|
|
add the library path(C:\zlib114\lib) to the included directories.
|
|
|
|
5. Select "Build", then Select "Set Active Configuration".
|
|
|
|
On Windows platform select as the active configuration
|
|
|
|
"all -- Win32 Debug" to build debug versions of
|
|
single-threaded static libraries, Debug multithreaded
|
|
DLLs and tests.
|
|
or
|
|
|
|
"all -- Win32 Release" to build release versions of
|
|
single-threaded static libraries, multithreaded DLLs
|
|
and tests.
|
|
|
|
|
|
Warning messages can be ignored.
|
|
|
|
When the debug or release build is done the directories
|
|
listed below will contain the following files:
|
|
|
|
c:\MyHDFstuff\hdf5\proj\hdf5\debug -
|
|
c:\MyHDFstuff\hdf5\proj\hdf5\release -
|
|
|
|
hdf5.lib- the hdf5 library
|
|
|
|
c:\MyHDFstuff\hdf5\proj\hdf5dll\debug -
|
|
|
|
hdf5ddll.dll- the hdf5 library
|
|
hdf5ddll.lib- the dll export library
|
|
|
|
c:\MyHDFstuff\hdf5\proj\hdf5dll\release -
|
|
|
|
hdf5dll.dll- the hdf5 library
|
|
hdf5dll.lib- the dll export library
|
|
|
|
c:\MyHDFstuff\hdf5\test\"test directory"-
|
|
|
|
where test directory is one of the following:
|
|
|
|
big(dll)
|
|
|
|
bittests(dll)
|
|
|
|
chunk(dll)
|
|
|
|
cmpd_dset(dll)
|
|
|
|
dsets(dll)
|
|
|
|
dtypes(dll)
|
|
|
|
enum(dll)
|
|
|
|
extend(dll)
|
|
|
|
external(dll)
|
|
|
|
fillval(dll)
|
|
|
|
flush1(dll)
|
|
|
|
flush2(dll)
|
|
|
|
gheap(dll)
|
|
|
|
hyperslab(dll)
|
|
|
|
iopipe(dll)
|
|
|
|
istore(dll)
|
|
|
|
links(dll)
|
|
|
|
mount(dll)
|
|
|
|
mtime(dll)
|
|
|
|
ohdr(dll)
|
|
|
|
overhead(dll)
|
|
|
|
stab(dll)
|
|
|
|
testhdf5(dll)
|
|
|
|
unlink(dll)
|
|
|
|
|
|
c:\MyHDFstuff\hdf5\tools\toolslib\debug
|
|
c:\MyHDFstuff\hdf5\tools\toolslib\release
|
|
|
|
toolslib.lib- the tools library
|
|
|
|
c:\MyHDFstuff\hdf5\tools\toolslibD\debug
|
|
c:\MyHDFstuff\hdf5\tools\toolslibD\release
|
|
|
|
toolslibD.lib- the dll export library
|
|
|
|
c:\MyHDFstuff\hdf5\tools\"tools directory"-
|
|
where non-hdf4 related tools directory is one of the
|
|
following:
|
|
|
|
h5dump(dll)
|
|
|
|
h5ls(dll)
|
|
|
|
h5debug(dll)
|
|
|
|
h5import(dll)
|
|
|
|
h5repart(dll)
|
|
|
|
gifconv(dll)
|
|
|
|
|
|
Test and tool directory contains debug and release
|
|
subdirectories with the corresponding tests and tools.
|
|
|
|
|
|
STEP 2: testing hdf5 libraries and non-hdf4 related tools
|
|
|
|
In a command prompt window run the test batch file which resides in
|
|
the hdf5\test directory(for example: C:\MyHDFstuff\hdf5\test)to make
|
|
sure that the library was built correctly.
|
|
|
|
You can possibily test four versions of hdf5 library and tools. They are:
|
|
|
|
release version
|
|
release dll version
|
|
debug version
|
|
debug dll version
|
|
|
|
NOTE:
|
|
|
|
1) hdf5ddll.dll and hdf5dll.dll should be placed into some place that
|
|
the application can find, one suggestion is to use
|
|
the C:\WINNT\system or C:\WINDOWS\system directory before using the dlls.
|
|
|
|
2) If you want to test HDF5 DLL using HDF5 test projects inside HDF5 workspace,
|
|
libtestD.dll should also be placed into some place that the application
|
|
can find, one suggestion is to use the C:\WINNT\system or C:\WINDOWS\system
|
|
directory before testing HDF5 DLL using HDF5 test projects inside HDF5
|
|
workspace.
|
|
|
|
We strongly suggest you to redirect your testing results into
|
|
an output file and you can easily check the testing results.
|
|
You may use either NotePad or WordPad or whatever other
|
|
windows tools to check the results. For the purpose of printing,
|
|
please choose font less than 14 for better alignment of the text.
|
|
|
|
1. hdf5 library testing
|
|
|
|
cd into the hdf5\test directory.
|
|
|
|
(1) basic tests
|
|
|
|
Go to a) b) c) or d) to test your chosen version
|
|
|
|
a) release static version
|
|
type:
|
|
hdf5test release >"Your output filename"
|
|
|
|
b) release dll version
|
|
type:
|
|
hdf5test release dll > "Your output filename"
|
|
|
|
c) debug static version
|
|
type:
|
|
hdf5test debug >"Your output filename"
|
|
|
|
d) debug dll version
|
|
type:
|
|
hdf5test debug dll >"Your output filename"
|
|
|
|
(2) timing tests
|
|
|
|
Go to a) b) c) or d) to test your chosen version
|
|
|
|
a) release static version
|
|
type:
|
|
hdf5timingtest release >"Your output filename"
|
|
|
|
b) release dll version
|
|
type:
|
|
hdf5timingtest release dll >"Your output filename"
|
|
|
|
c) debug static version
|
|
type:
|
|
hdf5timingtest debug >"Your output filename"
|
|
|
|
d) debug dll version
|
|
type:
|
|
hdf5timingtest debug dll >"Your output filename"
|
|
|
|
|
|
Use notepad or wordpad to check results. You should
|
|
not find any FAILED marks in your output files.
|
|
|
|
Note: big test is currently not working for windows because it needs
|
|
to allocate more space, however, HDF5 can support more than 4GB
|
|
file if you are using NTFS. We still investigate the possibility to support
|
|
this test.
|
|
|
|
2. hdf5 tools testing
|
|
|
|
Currently we are only supporting h5dump test. We are
|
|
investigating h5ls test now.
|
|
|
|
1) h5dump test
|
|
|
|
cd back into hdf5 directory and then cd into tools
|
|
directory(...\hdf5\tools)
|
|
|
|
Go to a) b) c) or d) to test your chosen version
|
|
|
|
a) release static version
|
|
type:
|
|
dumptest release >"Your output filename"
|
|
|
|
b) release dll version
|
|
type:
|
|
dumptest release dll > "Your output filename"
|
|
|
|
c) debug static version
|
|
type:
|
|
dumptest debug >"Your output filename"
|
|
|
|
d) debug dll version
|
|
type:
|
|
dumptest debug dll >"Your output filename"
|
|
|
|
|
|
We are using "fc" command to compare whether dumper
|
|
generates correct results. Supposedly you should find
|
|
"FC: no differences encountered" in your output file.
|
|
However, since we are comparing the actual dumper output
|
|
with the expected dumper output under different directory,
|
|
you may see something like:
|
|
|
|
"
|
|
***** ..\TESTFILES\tall-1.ddl
|
|
#############################
|
|
Expected output for 'h5dump tall.h5'
|
|
#############################
|
|
HDF5 "tall.h5" {
|
|
GROUP "/" {
|
|
***** TALL-1.RESULTS
|
|
HDF5 "..\..\testfiles\tall.h5" {
|
|
GROUP "/" {
|
|
*****
|
|
"
|
|
|
|
The actual dumper output is correct. The difference showing
|
|
here is the different representations of filename of the same
|
|
file.
|
|
|
|
STEP 3: BUILDING THE EXAMPLES
|
|
|
|
1. Invoke Microsoft Visual C++, go to "File" and select
|
|
the "Open Workspace" option.
|
|
Then open the workspace
|
|
c:\myHDFstuff\hdf5\examples\allexamples\allexamples.dsw.
|
|
|
|
2. Select "Build", then Select "Set Active Configuration".
|
|
|
|
On Windows platform select as the active configuration
|
|
|
|
"allexamples -- Win32 Debug" to build debug versions
|
|
of the examples.
|
|
|
|
or
|
|
|
|
"allexamples -- Win32 Release" to build release
|
|
versions the examples.
|
|
|
|
When the debug build or release build is done
|
|
there should be the following subdirectories in
|
|
C:\myHDFstuff\hdf5\examples\
|
|
|
|
attributetest
|
|
|
|
chunkread
|
|
|
|
compoundtest
|
|
|
|
extendwritetest
|
|
|
|
grouptest
|
|
|
|
readtest
|
|
|
|
selecttest
|
|
|
|
writetest
|
|
|
|
|
|
|
|
3. Run the batch file "InstallExamples.bat" which
|
|
resides in the top level directory(C:\MyHDFSTUFF\hdf5).
|
|
This file creates 2 new directories,examplesREL and
|
|
examplesDBG,in the examples directory and places
|
|
all the executables in it. Both the release and debug
|
|
versions of the examples should be built before this
|
|
step is done. The examples should be tested in these 2
|
|
new directories due to some dependencies between the
|
|
examples. Especially writetest.exe and extendwritetest.exe
|
|
should be executed before chunkread.exe and readtest.exe
|
|
due to dependencies among these files.
|
|
|
|
Section III:
|
|
BUILDING AN APPLICATION USING THE HDF5 LIBRARY OR DLL- SOME HELPFUL
|
|
POINTERS
|
|
====================================================================
|
|
|
|
If you are building an application that uses the HDF5 library the
|
|
following locations will need to be specified for locating header files
|
|
and linking in the HDF libraries:
|
|
|
|
<top-level HDF5 directory>\src
|
|
|
|
where <top-level HDF5 directory> may be
|
|
|
|
C:\MyHDFstuff\hdf5\
|
|
|
|
To specify this location in the settings for your VC++ project:
|
|
|
|
1. Open your VC project in Microsoft Visual C++ and make sure it is
|
|
the active project.
|
|
|
|
2. Go to the Project menu and chose the 'Settings' option.
|
|
|
|
3. Chose the build configuration you would like to modify in the
|
|
drop down menu labeled with 'Settings For:'
|
|
|
|
4. Chose the C/C++ tab
|
|
|
|
5. At the bottom of the window, there should be a text-area labeled
|
|
with 'Project Options:'. In this text-area, scroll until you
|
|
reach the end and type /I "<top-level HDF5 directory>\src" and
|
|
then click OK.
|
|
|
|
To link the HDF5 library with your application:
|
|
|
|
1. Open your VC project in Microsoft Visual C++ and make sure it is
|
|
the active project.
|
|
|
|
2. Go to the Project menu and chose the 'Add to Project' option and
|
|
then 'Files' option.
|
|
|
|
3. Change the 'Files of type:' to 'Library Files (.lib)'
|
|
|
|
4. Navigate through the directories until you find the location of
|
|
the hdf5.lib.
|
|
|
|
5. Select hdf5.lib and click OK.
|
|
|
|
|
|
To use the DLL:
|
|
|
|
1. Follow the steps for specifing the location of the header files
|
|
as shown above.
|
|
|
|
2. Follow the steps for linking the HDF5 library as shown above
|
|
except now link the export library that is created with the DLL.
|
|
The export library is called hdf5dll.lib or hdf5ddll.lib for
|
|
debug version.
|
|
|
|
3. Place the DLL in a location that Windows will be able to locate
|
|
it. The searched path and order for DLL's is
|
|
|
|
a) The directory where the executable module for the current
|
|
process is located.
|
|
b) The current directory.
|
|
c} The Windows system directory. The GetSystemDirectory function
|
|
retrieves the path of this directory.
|
|
d) The Windows directory. The GetWindowsDirectory function
|
|
retrieves the path of this directory.
|
|
e) The directories listed in the PATH environment variable.
|
|
4. To modify your own application settings, please DO FOLLOW th "DLL Hints"
|
|
at section IV "MORE HELPFUL POINTERS".
|
|
|
|
|
|
Section IV:
|
|
MORE HELPFUL POINTERS
|
|
=====================
|
|
|
|
|
|
Here are some notes that may be of help if you are not familiar with
|
|
using the Visual C++ Development Environment.
|
|
|
|
Project name and location issues:
|
|
|
|
The files in all.zip must end up in the hdf5\ directory installed by
|
|
hdf5-1_4_0.zip
|
|
|
|
If you must install all.dsw and all.dsp in another directory,
|
|
relative to hdf5\ , you will be asked to locate the sub-project
|
|
files, when you open the project all.dsw.
|
|
|
|
If you want to rename all (the entire project), you will need to
|
|
modify two files all.dsw and all.dsp as text (contrary to the
|
|
explicit warnings in the files).
|
|
|
|
You can also modify all.dsw and all.dsp as text, to allow these 2
|
|
files to be installed in another directory.
|
|
|
|
|
|
Settings... details:
|
|
|
|
If you create your own project, the necessary settings can be read
|
|
from the all.dsp file(as text), or from the Project Settings in the
|
|
Developer Studio project settings dialog.
|
|
|
|
Project
|
|
Settings
|
|
C/C++
|
|
Category
|
|
PreProcessor
|
|
Code Generation
|
|
Use run-time Library
|
|
These are all set to use
|
|
Single-Threaded
|
|
|
|
DLL... hints:
|
|
|
|
If you want to use DLL versions of hdf5 library in your application,
|
|
you should
|
|
1) put hdf5 DLL into windows system directory
|
|
2) add hdf5 DLL export library into your project
|
|
3) Follow "Settings... details" into the last line:
|
|
change Single-Threaded into Multithreaded DLL or
|
|
Debug Multithreaded DLL
|
|
4) Follow "Settings.. details" into PreProcessor:
|
|
Project
|
|
Settings
|
|
C/C++
|
|
Category
|
|
PreProcessor
|
|
|
|
Find PreProcessor definations and Add _HDF5USEDLL_ at the
|
|
end of the PreProcessor definations
|
|
|
|
|
|
|
|
|
|
Section V:
|
|
|
|
Disable gzip compression
|
|
============================================
|
|
|
|
If you would like to remove gzip compression from the hdf5 library
|
|
follow the steps below.
|
|
|
|
|
|
1) Open the H5pubconf.h file from the src directory and remove the
|
|
following four lines:
|
|
|
|
#define H5_HAVE_ZLIB_H 1
|
|
#define H5_HAVE_LIBZ 1
|
|
#define H5_HAVE_COMPRESS2 1
|
|
#define H5_HAVE_COMPRESSION 1
|
|
|
|
then save the file.
|
|
|
|
2) run-compile HDF5 library according to the previous steps.
|
|
|
|
Section VI:
|
|
|
|
How to build HDF5 in VS 7.0(.NET)
|
|
============================================
|
|
We just briefly introduce you how to build HDF5 in VS 7.0(.NET);
|
|
|
|
1. Open the old dataspace file with the "Open solution" option,
|
|
.NET will automatically convert the data space file to solution file.
|
|
2. Then find "Build" and go to "Configuration Manager"; choose "release"
|
|
or "debug", then choose "build all".
|
|
3. If you want to change some project setting, select the project and right
|
|
click the button to choose Properties; find the similar menu there as in 6.0.
|
|
4. You need to specify the zlib include header files and libraries under
|
|
Tools->Options->Projects->VC++ Directories and choose Include and libraries under
|
|
the category of "show directories for" to add the corresponding path.
|
|
|
|
Note: Currently we only build and test .NET on windows XP.
|
|
|
|
Section VII:
|
|
|
|
Build and test HDF5 snapshot release
|
|
|
|
Note: This section is only for users who would like to build and test HDF5 snapshot release.
|
|
|
|
If you want to test and build HDF5 snapshot release, you need extra steps to automatically
|
|
generate H5Tinit.c before going to section II step 1(2).
|
|
|
|
Previous step: section II, step 1(1).
|
|
Extra steps:
|
|
1) After extracting all.zip to the correct path, open the
|
|
c:\myHDFstuff\hdf5\misc\typegen\typegen.dsw.
|
|
2) Build the project file.
|
|
3) Invoke command prompt and go to c:\myHDFstuff\hdf5\src.
|
|
4) type H5Tinit.exe >H5Tinit.c
|
|
5) Go back to section II, continue with step 1(2).
|
|
|
|
Section VIII:
|
|
|
|
Misc.
|
|
|
|
1) drivers we support
|
|
The default driver on windows we support is sec2 driver. However, stdio driver
|
|
is also supported. If you want to use stdio driver in your application, you
|
|
may set environment variable HDF5_DRIVER to "stdio".
|
|
|
|
On windows 2000, the following steps should be followed to set environment
|
|
variable,
|
|
|
|
a) Go to Control panel and find "system",
|
|
b) Click "system" and choose "advanced",
|
|
c) Choose Environment Variables
|
|
d) Add new variable "HDF5_DRIVER"
|
|
e) set the "HDF5_DRIVER" to "stdio"
|
|
|
|
Reminder: if you don't want to use stdio driver, please remember to delete
|
|
the environment variable "HDF5_DRIVER" or change the variable value to "sec2".
|
|
|
|
Please send email to hdfhelp@ncsa.uiuc.edu for further assistance.
|
|
|