mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-07 16:37:56 +08:00
[svn-r27606] Merge revisions 27593 through 27605 from trunk to vds branch.
Tested: ummon
This commit is contained in:
commit
1d3a7ec651
@ -4,11 +4,11 @@
|
||||
************************************************************************
|
||||
|
||||
Table of Contents
|
||||
|
||||
|
||||
Section I: Preconditions
|
||||
Section II: Quick Step Building HDF5 Libraries with CMake Script Mode
|
||||
Section II: Quick Step Building HDF5 Libraries with CMake Script Mode
|
||||
Section III: Quick Step Building HDF5 Libraries with CMake Command Mode
|
||||
Section IV: Further considerations
|
||||
Section IV: Further considerations
|
||||
Section V: Options for building HDF5 Libraries with CMake command line
|
||||
Section VI: CMake option defaults for HDF5
|
||||
Section VII: User Defined Options for HDF5 Libraries with CMake
|
||||
@ -20,7 +20,7 @@ Section VIII: Options for platform configuration files
|
||||
========================================================================
|
||||
I. Preconditions
|
||||
========================================================================
|
||||
Obtaining HDF5 source code
|
||||
Obtaining HDF5 source code
|
||||
1. Create a directory for your development; for example, "myhdfstuff".
|
||||
|
||||
2. Obtain compressed (*.tar or *.zip) HDF5 source from
|
||||
@ -29,17 +29,17 @@ Obtaining HDF5 source code
|
||||
Uncompress the file. There should be a hdf5-1.8."X" folder.
|
||||
|
||||
CMake version
|
||||
1. We suggest you obtain the latest CMake from the Kitware web site.
|
||||
1. We suggest you obtain the latest CMake from the Kitware web site.
|
||||
The HDF5 1.8."X" product requires a minimum CMake version 3.1.0,
|
||||
where "X" is the current HDF5 release version.
|
||||
where "X" is the current HDF5 release version.
|
||||
|
||||
|
||||
========================================================================
|
||||
II. Quick Step Building HDF5 Libraries with CMake Script Mode
|
||||
========================================================================
|
||||
This short set of instructions is written for users who want to quickly
|
||||
build the HDF5 C and C++ static libraries and tools with SZIP and ZLIB
|
||||
compression included. This procedure will use the default settings in
|
||||
This short set of instructions is written for users who want to quickly
|
||||
build the HDF5 C and C++ static libraries and tools with SZIP and ZLIB
|
||||
compression included. This procedure will use the default settings in
|
||||
the config/cmake/cacheinit.cmake file.
|
||||
HDF Group recommends using the ctest script mode to build HDF5.
|
||||
|
||||
@ -57,7 +57,7 @@ CMake build script:
|
||||
External compression szip and zlib libraries:
|
||||
SZip.tar.gz
|
||||
ZLib.tar.gz
|
||||
|
||||
|
||||
Platform configuration files:
|
||||
HDF518config.cmake
|
||||
-----------------------------------------------
|
||||
@ -65,18 +65,18 @@ Platform configuration files:
|
||||
To build HDF5 with the SZIP and ZLIB external libraries you will need to:
|
||||
|
||||
1. Change to the development directory "myhdfstuff".
|
||||
|
||||
|
||||
2. Download the SZip.tar.gz and ZLib.tar.gz to "myhdfstuff".
|
||||
Do not uncompress the files.
|
||||
|
||||
|
||||
3. Download the CTestScript.cmake file to "myhdfstuff".
|
||||
CTestScript.cmake file should not be modified.
|
||||
|
||||
CTestScript.cmake file should not be modified.
|
||||
|
||||
4. Download the platform configuration file, HDF518config.cmake,
|
||||
to "myhdfstuff". Do not modify the file unless you want to change
|
||||
default build environment. (See http://www.hdfgroup.org/HDF5/release/chgcmkbuild.html)
|
||||
|
||||
5. From the "myhdfstuff" directory execute the CTest Script with the
|
||||
5. From the "myhdfstuff" directory execute the CTest Script with the
|
||||
following options:
|
||||
|
||||
On 32-bit Windows with Visual Studio 2012, execute:
|
||||
@ -90,31 +90,31 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to:
|
||||
On Linux and Mac, execute:
|
||||
ctest -S HDF518config.cmake -C Release -VV -O hdf5.log
|
||||
|
||||
The command above will configure, build, test, and create an install
|
||||
The command above will configure, build, test, and create an install
|
||||
package in the myhdfstuff folder. It will have the format:
|
||||
HDF5-1.8.NN-<platform>.<zip or tar.gz>
|
||||
|
||||
On Unix, <platform> will be "Linux". A similar .sh file will also be created.
|
||||
On Windows, <platform> will be "win64" or "win32". If you have an
|
||||
installer on your system, you will also see a similar file that ends
|
||||
On Windows, <platform> will be "win64" or "win32". If you have an
|
||||
installer on your system, you will also see a similar file that ends
|
||||
in either .exe (NSIS) or .msi (WiX).
|
||||
|
||||
|
||||
The -S option uses the script version of ctest.
|
||||
|
||||
The value for the -C option (as shown above, "-C Release") must
|
||||
match the setting for CTEST_BUILD_CONFIGURATION in the platform
|
||||
|
||||
The value for the -C option (as shown above, "-C Release") must
|
||||
match the setting for CTEST_BUILD_CONFIGURATION in the platform
|
||||
configuration file.
|
||||
|
||||
|
||||
The -VV option is for most verbose; use -V for less verbose.
|
||||
|
||||
|
||||
The "-O hdf5.log" option saves the output to a log file hdf5.log.
|
||||
|
||||
6. To install, "X" is the current release version
|
||||
|
||||
|
||||
On Windows, execute:
|
||||
HDF5-1.8."X"-win32.msi or HDF5-1.8."X"-win64.msi
|
||||
By default this program will install the hdf5 library into the
|
||||
"C:\Program Files" directory and will create the following
|
||||
"C:\Program Files" directory and will create the following
|
||||
directory structure:
|
||||
HDF_Group
|
||||
--HDF5
|
||||
@ -124,14 +124,14 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to:
|
||||
------lib
|
||||
------cmake
|
||||
|
||||
On Linux, change to the install destination directory
|
||||
On Linux, change to the install destination directory
|
||||
(create it if doesn't exist) and execute:
|
||||
<path-to>/myhdfstuff/HDF5-1.8."X"-Linux.sh
|
||||
After accepting the license, the script will prompt:
|
||||
By default the HDF5 will be installed in:
|
||||
"<current directory>/HDF5-1.8."X"-Linux"
|
||||
Do you want to include the subdirectory HDF5-1.8."X"-Linux?
|
||||
Saying no will install in: "<current directory>" [Yn]:
|
||||
Saying no will install in: "<current directory>" [Yn]:
|
||||
Note that the script will create the following directory structure
|
||||
relative to the install point:
|
||||
HDF_Group
|
||||
@ -141,10 +141,10 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to:
|
||||
------include
|
||||
------lib
|
||||
------share
|
||||
|
||||
|
||||
On Mac you will find HDF5-1.8."X"-Darwin.dmg in the myhdfstuff folder. Click
|
||||
on the dmg file to proceed with installation. After accepting the license,
|
||||
there will be a folder with the following structure:
|
||||
there will be a folder with the following structure:
|
||||
HDF_Group
|
||||
--HDF5
|
||||
----1.8."X"
|
||||
@ -152,7 +152,7 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to:
|
||||
------include
|
||||
------lib
|
||||
------share
|
||||
|
||||
|
||||
By default the installation will create the bin, include, lib and cmake
|
||||
folders in the <install destination directory>/HDF_Group/HDF5/1.8."X"
|
||||
|
||||
@ -160,47 +160,47 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to:
|
||||
========================================================================
|
||||
III. Quick Step Building HDF5 C Static Libraries and Tools with CMake
|
||||
========================================================================
|
||||
Notes: This short set of instructions is written for users who want to
|
||||
quickly build the just the HDF5 C static library and tools from
|
||||
Notes: This short set of instructions is written for users who want to
|
||||
quickly build the just the HDF5 C static library and tools from
|
||||
the HDF5 source code package using the CMake command line tools.
|
||||
|
||||
|
||||
Go through these steps:
|
||||
|
||||
1. Change to the development directory "myhdfstuff".
|
||||
|
||||
2. Uncompress the HDF5 source file
|
||||
|
||||
|
||||
3. Create a folder "build" in the "myhdfstuff" directory.
|
||||
|
||||
4. Change into the "build" folder.
|
||||
|
||||
|
||||
4. Change into the "build" folder.
|
||||
|
||||
5. Configure the C library, tools and tests with one of the following commands:
|
||||
|
||||
On Windows 32 bit
|
||||
cmake -G "Visual Studio 11 2012" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X"
|
||||
cmake -G "Visual Studio 11 2012" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X"
|
||||
|
||||
On Windows 64 bit
|
||||
cmake -G "Visual Studio 11 2012 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X"
|
||||
|
||||
cmake -G "Visual Studio 11 2012 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X"
|
||||
|
||||
On Linux and Mac
|
||||
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5-1.8."X"
|
||||
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5-1.8."X"
|
||||
|
||||
where "X" is the current release version.
|
||||
|
||||
|
||||
6. Build the C library, tools and tests with this command:
|
||||
cmake --build . --config Release
|
||||
|
||||
|
||||
7. Test the C library and tools with this command:
|
||||
ctest . -C Release
|
||||
|
||||
|
||||
8. Create an install image with this command:
|
||||
cpack -C Release CPackConfig.cmake
|
||||
|
||||
9. To install
|
||||
|
||||
9. To install
|
||||
On Windows, execute:
|
||||
HDF5-1.8."X"-win32.msi or HDF5-1.8."X"-win64.msi
|
||||
By default this program will install the hdf5 library into the
|
||||
"C:\Program Files" directory and will create the following
|
||||
"C:\Program Files" directory and will create the following
|
||||
directory structure:
|
||||
HDF_Group
|
||||
--HDF5
|
||||
@ -210,14 +210,14 @@ Notes: This short set of instructions is written for users who want to
|
||||
------lib
|
||||
------cmake
|
||||
|
||||
On Linux, change to the install destination directory
|
||||
On Linux, change to the install destination directory
|
||||
(create if doesn't exist) and execute:
|
||||
<path-to>/myhdfstuff/build/HDF5-1.8."X"-Linux.sh
|
||||
After accepting the license, the script will prompt:
|
||||
By default the HDF5 will be installed in:
|
||||
"<current directory>/HDF5-1.8."X"-Linux"
|
||||
Do you want to include the subdirectory HDF5-1.8."X"-Linux?
|
||||
Saying no will install in: "<current directory>" [Yn]:
|
||||
Saying no will install in: "<current directory>" [Yn]:
|
||||
Note that the script will create the following directory structure
|
||||
relative to the install point:
|
||||
HDF_Group
|
||||
@ -227,10 +227,10 @@ Notes: This short set of instructions is written for users who want to
|
||||
------include
|
||||
------lib
|
||||
------share
|
||||
|
||||
|
||||
On Mac you will find HDF5-1.8."X"-Darwin.dmg in the build folder. Click
|
||||
on the dmg file to proceed with installation. After accepting the license,
|
||||
there will be a folder with the following structure:
|
||||
there will be a folder with the following structure:
|
||||
HDF_Group
|
||||
--HDF5
|
||||
----1.8."X"
|
||||
@ -241,41 +241,41 @@ Notes: This short set of instructions is written for users who want to
|
||||
|
||||
|
||||
========================================================================
|
||||
IV. Further considerations
|
||||
IV. Further considerations
|
||||
========================================================================
|
||||
|
||||
1. We suggest you obtain the latest CMake for windows from the Kitware
|
||||
web site. The HDF5 1.8."X" product requires a minimum CMake version 3.1.0.
|
||||
|
||||
web site. The HDF5 1.8."X" product requires a minimum CMake version 3.1.0.
|
||||
|
||||
2. If you plan to use Zlib or Szip:
|
||||
A. Download the binary packages and install them in a central location.
|
||||
For example on Windows, create a folder extlibs and install the
|
||||
A. Download the binary packages and install them in a central location.
|
||||
For example on Windows, create a folder extlibs and install the
|
||||
packages there. Add the following CMake options:
|
||||
-DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib
|
||||
-DZLIB_INCLUDE_DIR:PATH=some_location/include
|
||||
-DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib
|
||||
-DSZIP_INCLUDE_DIR:PATH=some_location/include
|
||||
where "some_location" is the full path to the extlibs folder.
|
||||
where "some_location" is the full path to the extlibs folder.
|
||||
|
||||
B. Use source packages from an SVN server by adding the following CMake
|
||||
B. Use source packages from an SVN server by adding the following CMake
|
||||
options:
|
||||
HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN"
|
||||
ZLIB_SVN_URL:STRING="http://some_location/zlib/trunk"
|
||||
SZIP_SVN_URL:STRING="http://some_location/szip/trunk"
|
||||
where "some_location" is the URL to the SVN repository. Also set
|
||||
CMAKE_BUILD_TYPE to the configuration type.
|
||||
|
||||
C. Use source packages from a compressed file by adding the following
|
||||
|
||||
C. Use source packages from a compressed file by adding the following
|
||||
CMake options:
|
||||
HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ"
|
||||
ZLIB_TGZ_NAME:STRING="zlib_src.ext"
|
||||
SZIP_TGZ_NAME:STRING="szip_src.ext"
|
||||
TGZPATH:STRING="some_location"
|
||||
where "some_location" is the URL or full path to the compressed
|
||||
where "some_location" is the URL or full path to the compressed
|
||||
file and ext is the type of compression file. Also set CMAKE_BUILD_TYPE
|
||||
to the configuration type during configuration
|
||||
|
||||
3. If you are building on Apple Darwin platforms, you should add the
|
||||
|
||||
3. If you are building on Apple Darwin platforms, you should add the
|
||||
following options:
|
||||
Compiler choice - use xcode by setting the ENV variables of CC and CXX
|
||||
Shared fortran is not supported, build static:
|
||||
@ -283,12 +283,12 @@ IV. Further considerations
|
||||
Additional options:
|
||||
CMAKE_ANSI_CFLAGS:STRING=-fPIC
|
||||
CTEST_USE_LAUNCHERS:BOOL=ON
|
||||
CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF
|
||||
|
||||
CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF
|
||||
|
||||
4. Windows developers should install NSIS or WiX to create an install image with CPack.
|
||||
Visual Studio Express users will not be able to package HDF5 into
|
||||
an install image executable.
|
||||
|
||||
|
||||
5. Developers can copy the config/cmake/cacheinit.cmake file and alter the
|
||||
the settings for the developers' environment. Then the only options needed
|
||||
on the command line are those options that are different. Example using HDF
|
||||
@ -299,31 +299,31 @@ IV. Further considerations
|
||||
|
||||
Notes: CMake and HDF5
|
||||
|
||||
1. Using CMake for building and using HDF5 is under active development.
|
||||
While we have attempted to provide error-free files, please
|
||||
understand that development with CMake has not been extensively
|
||||
1. Using CMake for building and using HDF5 is under active development.
|
||||
While we have attempted to provide error-free files, please
|
||||
understand that development with CMake has not been extensively
|
||||
tested outside of HDF. The CMake specific files may change
|
||||
before the next release.
|
||||
|
||||
2. CMake support for HDF5 development should be usable on any
|
||||
system where CMake is supported. Please send us any comments on
|
||||
how CMake support can be improved on any system. Visit the
|
||||
|
||||
2. CMake support for HDF5 development should be usable on any
|
||||
system where CMake is supported. Please send us any comments on
|
||||
how CMake support can be improved on any system. Visit the
|
||||
KitWare site for more information about CMake.
|
||||
|
||||
|
||||
3. Build and test results can be submitted to our CDash server,
|
||||
please read the HDF and CDash document at:
|
||||
www.hdfgroup.org/CDash/HowToSubmit.
|
||||
|
||||
www.hdfgroup.org/CDash/HowToSubmit.
|
||||
|
||||
4. See the appendix at the bottom of this file for examples of using
|
||||
a ctest script for building and testing. Using a ctest script is
|
||||
preferred because of its flexibility.
|
||||
|
||||
|
||||
Notes: CMake in General
|
||||
|
||||
1. More information about using CMake can be found at the KitWare site at
|
||||
1. More information about using CMake can be found at the KitWare site at
|
||||
www.cmake.org.
|
||||
|
||||
2. CMake uses the command line; however, the visual CMake tool is
|
||||
|
||||
2. CMake uses the command line; however, the visual CMake tool is
|
||||
available for the configuration step. The steps are similar for
|
||||
all the operating systems supported by CMake.
|
||||
|
||||
@ -348,27 +348,27 @@ These five steps are described in detail below.
|
||||
|
||||
The visual CMake executable is named "cmake-gui.exe" on Windows and should be
|
||||
available in your Start menu. For Linux, UNIX, and Mac users the
|
||||
executable is named "cmake-gui" and can be found where CMake was
|
||||
installed.
|
||||
|
||||
Specify the source and build directories.
|
||||
|
||||
executable is named "cmake-gui" and can be found where CMake was
|
||||
installed.
|
||||
|
||||
Specify the source and build directories.
|
||||
|
||||
***** Make the build and source directories different. ******
|
||||
|
||||
For example on Windows, if the source is at c:\MyHDFstuff\hdf5,
|
||||
then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5 as the
|
||||
|
||||
For example on Windows, if the source is at c:\MyHDFstuff\hdf5,
|
||||
then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5 as the
|
||||
build directory.
|
||||
|
||||
|
||||
RECOMMENDED:
|
||||
Users can perform the configuration step without using the visual
|
||||
cmake-gui program. We use the file cacheinit.cmake in the
|
||||
config/cmake source folder for our testing. This file enables all of the
|
||||
basic options and we turn specific options on or off for testing
|
||||
Users can perform the configuration step without using the visual
|
||||
cmake-gui program. We use the file cacheinit.cmake in the
|
||||
config/cmake source folder for our testing. This file enables all of the
|
||||
basic options and we turn specific options on or off for testing
|
||||
using the following command line within the build directory:
|
||||
|
||||
|
||||
cmake -C <sourcepath>/config/cmake/cacheinit.cmake -G "<generator>" [-D<options>] <sourcepath>
|
||||
|
||||
Where <generator> is
|
||||
|
||||
Where <generator> is
|
||||
* MinGW Makefiles
|
||||
* NMake Makefiles
|
||||
* Unix Makefiles
|
||||
@ -424,128 +424,128 @@ These five steps are described in detail below.
|
||||
|
||||
2. Configure the cache settings
|
||||
|
||||
2.1 Visual CMake users, click the Configure button. If this is the first time you are
|
||||
running cmake-gui in this directory, you will be prompted for the
|
||||
generator you wish to use (for example on Windows, Visual Studio 11).
|
||||
CMake will read in the CMakeLists.txt files from the source directory and
|
||||
display options for the HDF5 project. After the first configure you
|
||||
2.1 Visual CMake users, click the Configure button. If this is the first time you are
|
||||
running cmake-gui in this directory, you will be prompted for the
|
||||
generator you wish to use (for example on Windows, Visual Studio 11).
|
||||
CMake will read in the CMakeLists.txt files from the source directory and
|
||||
display options for the HDF5 project. After the first configure you
|
||||
can adjust the cache settings and/or specify the locations of other programs.
|
||||
|
||||
|
||||
Any conflicts or new values will be highlighted by the configure
|
||||
process in red. Once you are happy with all the settings and there are no
|
||||
more values in red, click the Generate button to produce the appropriate
|
||||
build files.
|
||||
|
||||
On Windows, if you are using a Visual Studio generator, the solution and
|
||||
process in red. Once you are happy with all the settings and there are no
|
||||
more values in red, click the Generate button to produce the appropriate
|
||||
build files.
|
||||
|
||||
On Windows, if you are using a Visual Studio generator, the solution and
|
||||
project files will be created in the build folder.
|
||||
|
||||
|
||||
On linux, if you are using the Unix Makefiles generator, the Makefiles will
|
||||
be created in the build folder.
|
||||
|
||||
2.2 Preferred command line example on Windows in c:\MyHDFstuff\hdf5\build directory:
|
||||
|
||||
|
||||
cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 11 2012" \
|
||||
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF \
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release ..
|
||||
|
||||
2.3 On Windows, if you are using a Visual Studio Express version you must
|
||||
2.3 On Windows, if you are using a Visual Studio Express version you must
|
||||
be sure that the following two options are correctly set/unset:
|
||||
|
||||
|
||||
HDF5_NO_PACKAGES:BOOL=ON
|
||||
HDF5_USE_FOLDERS:BOOL=OFF
|
||||
|
||||
|
||||
3. Build HDF5
|
||||
|
||||
On Windows, you can build HDF5 using either the Visual Studio Environment
|
||||
|
||||
On Windows, you can build HDF5 using either the Visual Studio Environment
|
||||
or the command line. The command line can be used on all platforms;
|
||||
Windows, linux, Unix, and Mac.
|
||||
|
||||
To build from the command line, navigate to your build directory and
|
||||
execute the following:
|
||||
|
||||
cmake --build . --config {Debug | Release}
|
||||
|
||||
|
||||
cmake --build . --config {Debug | Release}
|
||||
|
||||
NOTE: "--config {Debug | Release}" may be optional on your platform. We
|
||||
recommend choosing either Debug or Release on Windows.
|
||||
|
||||
3.1 If you wish to use the Visual Studio environment, open the solution
|
||||
file in your build directory. Be sure to select either Debug or
|
||||
recommend choosing either Debug or Release on Windows.
|
||||
|
||||
3.1 If you wish to use the Visual Studio environment, open the solution
|
||||
file in your build directory. Be sure to select either Debug or
|
||||
Release and build the solution.
|
||||
|
||||
|
||||
3.2.1 The external libraries (zlib and szip) can be configured
|
||||
to allow building the libraries by downloading from an SVN repository.
|
||||
The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following
|
||||
configuration option:
|
||||
-DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN"
|
||||
|
||||
|
||||
The options to control the SVN URL (config/cmake/cacheinit.cmake file) are:
|
||||
ZLIB_SVN_URL:STRING="http://${svn_url}/zlib/trunk"
|
||||
SZIP_SVN_URL:STRING="http://${svn_url}/szip/trunk"
|
||||
${svn_url} should be changed to your location. Also define CMAKE_BUILD_TYPE
|
||||
to be the configuration type.
|
||||
|
||||
|
||||
3.2.2 Or the external libraries (zlib and szip) can be configured
|
||||
to allow building the libraries by using a compressed file.
|
||||
The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT' and is enabled by
|
||||
The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT' and is enabled by
|
||||
adding the following configuration option:
|
||||
-DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ"
|
||||
|
||||
The options to control the SVN URL (config/cmake/cacheinit.cmake
|
||||
|
||||
The options to control the SVN URL (config/cmake/cacheinit.cmake
|
||||
file) are:
|
||||
ZLIB_TGZ_NAME:STRING="zlib_src.ext"
|
||||
SZIP_TGZ_NAME:STRING="szip_src.ext"
|
||||
TGZPATH:STRING="some_location"
|
||||
where "some_location/xxxx_src.ext" is the URL or full path to
|
||||
the compressed file and where ext is the type of the compression
|
||||
where "some_location/xxxx_src.ext" is the URL or full path to
|
||||
the compressed file and where ext is the type of the compression
|
||||
file such as .bz2, .tar, .tar.gz, .tgz, or .zip. Also define
|
||||
CMAKE_BUILD_TYPE to be the configuration type.
|
||||
|
||||
4. Test HDF5
|
||||
|
||||
To test the build, navigate to your build directory and execute:
|
||||
|
||||
|
||||
ctest . -C {Debug | Release}
|
||||
|
||||
|
||||
NOTE: "-C {Debug | Release}" may be optional on your platform. We
|
||||
recommend choosing either Debug or Release to match the build
|
||||
step on Windows.
|
||||
step on Windows.
|
||||
|
||||
5. Packaging HDF5 (create an install image)
|
||||
|
||||
|
||||
To package the build into a simple installer using WiX toolset or the NullSoft installer NSIS
|
||||
on Windows, or into compressed files (.tar.gz, .sh, .zip), use the CPack tool.
|
||||
|
||||
To package the build, navigate to your build directory and execute;
|
||||
|
||||
|
||||
cpack -C {Debug | Release} CPackConfig.cmake
|
||||
|
||||
|
||||
NOTE: See note 8 of this document for NSIS information.
|
||||
See note 9 of this document for WiX information.
|
||||
Also, if you are using a Visual Studio Express version or do not
|
||||
want to enable the packaging components, set HDF5_NO_PACKAGES
|
||||
Also, if you are using a Visual Studio Express version or do not
|
||||
want to enable the packaging components, set HDF5_NO_PACKAGES
|
||||
to ON (on the command line add -DHDF5_NO_PACKAGES:BOOL=ON)
|
||||
|
||||
6. The files that support building HDF5 with CMake are all the files in the
|
||||
config/cmake folder, the CMakeLists.txt files in each source folder, and
|
||||
CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing
|
||||
performed by The HDF Group. It should be altered for the user's
|
||||
|
||||
6. The files that support building HDF5 with CMake are all the files in the
|
||||
config/cmake folder, the CMakeLists.txt files in each source folder, and
|
||||
CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing
|
||||
performed by The HDF Group. It should be altered for the user's
|
||||
installation and needs. The cacheinit.cmake file settings are used by
|
||||
The HDF Group for daily testing. It should be altered/ignored for the user's
|
||||
The HDF Group for daily testing. It should be altered/ignored for the user's
|
||||
installation and needs.
|
||||
|
||||
7. More information about using CMake can be found at the KitWare site,
|
||||
7. More information about using CMake can be found at the KitWare site,
|
||||
www.cmake.org.
|
||||
|
||||
|
||||
8. Nullsoft Scriptable Install System
|
||||
The Nullsoft Scriptable Install System (NSIS) is an open source installation
|
||||
system. It was created by the WinAmp authors to distribute that application,
|
||||
but it is now a general-purpose system which anyone might use. NSIS installers
|
||||
recognize /S for silent installation and /D=dir to specify the
|
||||
"output directory", which is where the program will be installed. These
|
||||
options are case-sensitive, so be sure to type them in upper case.
|
||||
The Nullsoft Scriptable Install System (NSIS) is an open source installation
|
||||
system. It was created by the WinAmp authors to distribute that application,
|
||||
but it is now a general-purpose system which anyone might use. NSIS installers
|
||||
recognize /S for silent installation and /D=dir to specify the
|
||||
"output directory", which is where the program will be installed. These
|
||||
options are case-sensitive, so be sure to type them in upper case.
|
||||
|
||||
9. WiX Toolset
|
||||
WiX--the Windows Installer XML toolset--lets developers create installers for
|
||||
WiX--the Windows Installer XML toolset--lets developers create installers for
|
||||
Windows Installer, the Windows installation engine. See http://wixtoolset.org.
|
||||
|
||||
|
||||
@ -553,14 +553,14 @@ These five steps are described in detail below.
|
||||
VI. CMake Option Defaults for HDF5
|
||||
========================================================================
|
||||
|
||||
In the options listed below, there are three columns of information:
|
||||
Option Name, Option Description, and Option Default.
|
||||
The config/cmake/cacheinit.cmake file overrides the following values.
|
||||
In the options listed below, there are three columns of information:
|
||||
Option Name, Option Description, and Option Default.
|
||||
The config/cmake/cacheinit.cmake file can override the following values.
|
||||
|
||||
---------------- General Build Options ---------------------
|
||||
BUILD_SHARED_LIBS "Build Shared Libraries" OFF
|
||||
BUILD_SHARED_LIBS "Build Shared Libraries" ON
|
||||
BUILD_STATIC_EXECS "Build Static Executabless" OFF
|
||||
BUILD_TESTING "Build HDF5 Unit Testing" OFF
|
||||
BUILD_TESTING "Build HDF5 Unit Testing" ON
|
||||
|
||||
---------------- HDF5 Build Options ---------------------
|
||||
HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" ON
|
||||
@ -568,7 +568,7 @@ HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" ON
|
||||
HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF
|
||||
HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" ON
|
||||
HDF5_BUILD_TOOLS "Build HDF5 Tools" ON
|
||||
if (HDF5_BUILD_FORTRAN)
|
||||
if (HDF5_BUILD_FORTRAN)
|
||||
HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON
|
||||
|
||||
---------------- HDF5 Advanced Options ---------------------
|
||||
@ -591,14 +591,13 @@ HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks"
|
||||
HDF5_TEST_VFD "Execute tests with different VFDs" OFF
|
||||
HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF
|
||||
HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." OFF
|
||||
HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON
|
||||
HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON
|
||||
HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF
|
||||
if (APPLE)
|
||||
if (APPLE)
|
||||
HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF
|
||||
if (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
if (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
HDF5_ENABLE_TRACE "Enable API tracing capability" ON
|
||||
if (HDF5_TEST_VFD)
|
||||
if (HDF5_TEST_VFD)
|
||||
HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON
|
||||
|
||||
---------------- External Library Options ---------------------
|
||||
@ -607,7 +606,7 @@ HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF
|
||||
HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF
|
||||
ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0
|
||||
SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0
|
||||
if (HDF5_ENABLE_SZIP_SUPPORT)
|
||||
if (HDF5_ENABLE_SZIP_SUPPORT)
|
||||
HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF
|
||||
if (WINDOWS)
|
||||
H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin"
|
||||
@ -624,9 +623,9 @@ VII. User Defined Options for HDF5 Libraries with CMake
|
||||
Support for User Defined macros and options has been added. The file
|
||||
UserMacros.cmake has an example of the technique. In the folder,
|
||||
config/cmake/UserMacros, is an implementation for Windows Visual Studio
|
||||
users for linking libraries to the static CRT - Windows_MT.cmake.
|
||||
users for linking libraries to the static CRT - Windows_MT.cmake.
|
||||
|
||||
Copy the contents of the file, both macro and option, into the
|
||||
Copy the contents of the file, both macro and option, into the
|
||||
UserMacros.cmake file. Then enable the option to the CMake configuration,
|
||||
build and test process.
|
||||
|
||||
@ -648,7 +647,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script.
|
||||
#########################################################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
||||
set(CTEST_SOURCE_VERSION 1.8.15-pre7)
|
||||
set(CTEST_SOURCE_VERSION 1.8.16)
|
||||
set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION})
|
||||
set(CTEST_BINARY_NAME "build")
|
||||
set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
|
||||
@ -709,7 +708,7 @@ endif()
|
||||
###################################################################
|
||||
set(MODEL "Experimental")
|
||||
######### Following describes computer ############
|
||||
## following is optional to describe build ##
|
||||
## following is optional to describe build ##
|
||||
set(SITE_BUILDNAME_SUFFIX "STATIC")
|
||||
###################################################################
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,39 +2,34 @@
|
||||
* Build and Test HDF5 Examples with CMake *
|
||||
************************************************************************
|
||||
|
||||
Notes: This short instruction is written for users who want to quickly
|
||||
Notes: This short instruction is written for users who want to quickly
|
||||
test the installation of HDF5 by using the CMake tools to build
|
||||
and test the HDF5 Examples. The following instructions will show
|
||||
the default usage and then present common changes for non-default
|
||||
installations.
|
||||
For more information, see the USING_HDF5_CMake.txt file.
|
||||
|
||||
More information about using CMake can be found at the KitWare
|
||||
|
||||
More information about using CMake can be found at the KitWare
|
||||
site, www.cmake.org.
|
||||
|
||||
|
||||
CMake uses the command line and these instructions use the script
|
||||
method of the ctest command.
|
||||
|
||||
|
||||
========================================================================
|
||||
I. Preconditions
|
||||
I. Preconditions
|
||||
========================================================================
|
||||
|
||||
1. We suggest you obtain the latest CMake for windows from the Kitware
|
||||
web site. The HDF5 1.8.x product requires a minimum CMake version
|
||||
of 3.1.0.
|
||||
|
||||
2. You have installed the HDF5 library built with CMake, by executing
|
||||
the HDF Install Utility (the *.exe file in the binary package for
|
||||
Windows or the *.sh on Linux). If you are using a Windows platform,
|
||||
you can obtain a pre-built Windows binary from The HDF Group's website
|
||||
at www.hdfgroup.org. See Section "III. Common changes to the
|
||||
HDF518_Examples.cmake file", for the line to change the location.
|
||||
|
||||
3. On Windows, you have installed the 7Zip package. See Section "III.
|
||||
Common changes to the HDF518_Examples.cmake file", for the line to
|
||||
change the command.
|
||||
web site. The HDF5 1.8.x product requires a minimum CMake version
|
||||
of 3.1.0.
|
||||
|
||||
2. You have installed the HDF5 library built with CMake, by executing
|
||||
the HDF Install Utility (the *.msi file in the binary package for
|
||||
Windows or the *.sh on Linux). If you are using a Windows platform,
|
||||
you can obtain a pre-built Windows binary from The HDF Group's website
|
||||
at www.hdfgroup.org. See Section "III. Common changes to the
|
||||
HDF518_Examples.cmake file", for the line to change the location.
|
||||
|
||||
|
||||
========================================================================
|
||||
@ -42,16 +37,16 @@ II. Building HDF5 Examples with CMake
|
||||
========================================================================
|
||||
|
||||
Files in the HDF5 install directory:
|
||||
HDF5Examples-0.1.1-Source.zip (or HDF5Examples-0.1.1-Source.tar.gz)
|
||||
HDF5Examples-0.1.1-Source folder
|
||||
HDF518_Examples.cmake
|
||||
|
||||
|
||||
Default installation process:
|
||||
Create a directory to run the examples, i.e. \test_hdf5.
|
||||
Copy HDF5Examples-0.1.1-Source.zip(.tar.gz) to this directory, uncompress.
|
||||
Copy HDF5Examples-0.1.1-Source folder to this directory.
|
||||
Copy HDF518_Examples.cmake to this directory.
|
||||
Edit line 8 of the HDF518_Examples.cmake file and change the INSTALLDIR
|
||||
Edit line 8 of the HDF518_Examples.cmake file and change the INSTALLDIR
|
||||
to the HDF5 install location.
|
||||
|
||||
|
||||
Execute from this directory:
|
||||
ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log
|
||||
|
||||
@ -60,7 +55,7 @@ The script will use the examples folder HDF5Examples-0.1.1-Source,
|
||||
It will then configure, build, and execute the examples. All the log files
|
||||
will be found under the build\Testing\Temporary directory, check these for
|
||||
errors.
|
||||
|
||||
|
||||
The amount of script information can be increased by adding -V to the ctest
|
||||
command. Even more information can be shown by adding -VV instead of -V.
|
||||
|
||||
@ -79,5 +74,3 @@ Line 16: comment to NOT build and test Fortran examples with F2003 option.
|
||||
|
||||
Line 17: uncomment to use a compressed source file.
|
||||
|
||||
Line 71: change the CTEST_7Z_COMMAND to a different unzip program.
|
||||
|
||||
|
@ -2,60 +2,60 @@
|
||||
* Build and Install HDF5 Applications with CMake *
|
||||
************************************************************************
|
||||
|
||||
Notes: This short instruction is written for users who want to quickly
|
||||
build HDF5 applications using the CMake tools. Users can adapt
|
||||
these instructions for their own applications. For more information,
|
||||
Notes: This short instruction is written for users who want to quickly
|
||||
build HDF5 applications using the CMake tools. Users can adapt
|
||||
these instructions for their own applications. For more information,
|
||||
see the "Minimum C Project Files for CMake" section.
|
||||
|
||||
More information about using CMake can be found at the KitWare
|
||||
|
||||
More information about using CMake can be found at the KitWare
|
||||
site, www.cmake.org.
|
||||
|
||||
CMake uses the command line; however, the visual CMake tool is
|
||||
|
||||
CMake uses the command line; however, the visual CMake tool is
|
||||
available for the configuration step. The steps are similar for
|
||||
all of the operating systems supported by CMake.
|
||||
|
||||
|
||||
NOTES:
|
||||
1. Using CMake for building and using HDF5 is under active
|
||||
development. While we have attempted to provide error-free
|
||||
files, please understand that development with CMake has not
|
||||
been extensively tested outside of HDF. The CMake specific
|
||||
1. Using CMake for building and using HDF5 is under active
|
||||
development. While we have attempted to provide error-free
|
||||
files, please understand that development with CMake has not
|
||||
been extensively tested outside of HDF. The CMake specific
|
||||
files may change before the next release.
|
||||
|
||||
2. CMake for HDF5 development should be usable on any system
|
||||
where CMake is supported. Please send us any comments on how
|
||||
CMake support can be improved on any system.
|
||||
|
||||
3. See the appendix at the bottom of this file for an example
|
||||
of using a ctest script for building and testing. See
|
||||
|
||||
2. CMake for HDF5 development should be usable on any system
|
||||
where CMake is supported. Please send us any comments on how
|
||||
CMake support can be improved on any system.
|
||||
|
||||
3. See the appendix at the bottom of this file for an example
|
||||
of using a ctest script for building and testing. See
|
||||
INSTALL_CMake.txt for more information.
|
||||
|
||||
|
||||
|
||||
========================================================================
|
||||
I. Preconditions
|
||||
I. Preconditions
|
||||
========================================================================
|
||||
|
||||
1. We suggest you obtain the latest CMake for windows from the Kitware
|
||||
web site. The HDF5 1.8.x product requires a minimum CMake version
|
||||
of 3.1.0.
|
||||
|
||||
2. You have installed the HDF5 library built with CMake, by executing
|
||||
the HDF Install Utility (the *.exe file in the binary package for
|
||||
Windows). If you are using a Windows platform, you can obtain a
|
||||
pre-built Windows binary from The HDF Group's website at
|
||||
web site. The HDF5 1.8.x product requires a minimum CMake version
|
||||
of 3.1.0.
|
||||
|
||||
2. You have installed the HDF5 library built with CMake, by executing
|
||||
the HDF Install Utility (the *.msi file in the binary package for
|
||||
Windows). If you are using a Windows platform, you can obtain a
|
||||
pre-built Windows binary from The HDF Group's website at
|
||||
www.hdfgroup.org.
|
||||
|
||||
3. Set the environment variable HDF5_DIR to the installed location of
|
||||
the config files for HDF5. On Windows:
|
||||
HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.8.x/cmake/hdf5
|
||||
|
||||
3. Set the environment variable HDF5_DIR to the installed location of
|
||||
the config files for HDF5. On Windows:
|
||||
HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.8.x/cmake
|
||||
|
||||
(Note there are no quote characters used on Windows and all platforms
|
||||
use forward slashes)
|
||||
|
||||
4. Created separate source and build directories.
|
||||
(CMake commands are executed in the build directory)
|
||||
|
||||
5. Created a CMakeLists.txt file(s) for your source. See Section III
|
||||
5. Created a CMakeLists.txt file(s) for your source. See Section III
|
||||
below.
|
||||
|
||||
|
||||
@ -65,6 +65,7 @@ II. Building HDF5 Applications with CMake
|
||||
========================================================================
|
||||
|
||||
Go through these steps to build HDF5 applications with CMake.
|
||||
(The application must support building with CMake.)
|
||||
|
||||
1. Run CMake
|
||||
2. Configure the cache settings
|
||||
@ -79,22 +80,22 @@ These steps are described in more detail below.
|
||||
|
||||
The visual CMake executable is named "cmake-gui.exe" on Windows and should be
|
||||
available in your Start menu. For Linux, UNIX, and Mac users the
|
||||
executable is named "cmake-gui" and can be found where CMake was
|
||||
installed.
|
||||
|
||||
Specify the source and build directories. Make the build and source
|
||||
directories different. For example on Windows, if the source is at
|
||||
c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or
|
||||
c:\MyHDFstuff\build\hdf5 for the build directory.
|
||||
|
||||
executable is named "cmake-gui" and can be found where CMake was
|
||||
installed.
|
||||
|
||||
Specify the source and build directories. Make the build and source
|
||||
directories different. For example on Windows, if the source is at
|
||||
c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or
|
||||
c:\MyHDFstuff\build\hdf5 for the build directory.
|
||||
|
||||
PREFERRED:
|
||||
Users can perform the configuration step without using the visual
|
||||
cmake-gui program. The following is an example command line
|
||||
Users can perform the configuration step without using the visual
|
||||
cmake-gui program. The following is an example command line
|
||||
configuration step executed within the build directory:
|
||||
|
||||
|
||||
cmake -G "<generator>" [-D<options>] <sourcepath>
|
||||
|
||||
Where <generator> is
|
||||
|
||||
Where <generator> is
|
||||
* MinGW Makefiles
|
||||
* NMake Makefiles
|
||||
* Unix Makefiles
|
||||
@ -111,63 +112,63 @@ These steps are described in more detail below.
|
||||
|
||||
2. Configure the cache settings
|
||||
|
||||
2.1 Visual CMake users, click the Configure button. If this is the first time you are
|
||||
running cmake-gui in this directory, you will be prompted for the
|
||||
generator you wish to use (for example on Windows, Visual Studio 10).
|
||||
CMake will read in the CMakeLists.txt files from the source directory and
|
||||
display options for the HDF5 project. After the first configure you
|
||||
2.1 Visual CMake users, click the Configure button. If this is the first time you are
|
||||
running cmake-gui in this directory, you will be prompted for the
|
||||
generator you wish to use (for example on Windows, Visual Studio 10).
|
||||
CMake will read in the CMakeLists.txt files from the source directory and
|
||||
display options for the HDF5 project. After the first configure you
|
||||
can adjust the cache settings and/or specify locations of other programs.
|
||||
|
||||
|
||||
Any conflicts or new values will be highlighted by the configure
|
||||
process in red. Once you are happy with all the settings and there are no
|
||||
more values in red, click the Generate button to produce the appropriate
|
||||
build files.
|
||||
|
||||
On Windows, if you are using a Visual Studio generator, the solution and
|
||||
process in red. Once you are happy with all the settings and there are no
|
||||
more values in red, click the Generate button to produce the appropriate
|
||||
build files.
|
||||
|
||||
On Windows, if you are using a Visual Studio generator, the solution and
|
||||
project files will be created in the build folder.
|
||||
|
||||
|
||||
On linux, if you are using the Unix Makefiles generator, the Makefiles will
|
||||
be created in the build folder.
|
||||
|
||||
2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory:
|
||||
|
||||
|
||||
cmake -G "Visual Studio 11" -DBUILD_TESTING:BOOL=ON ..
|
||||
|
||||
3. Build HDF5 Applications
|
||||
|
||||
On Windows, you can build HDF5 applications using either the Visual Studio Environment
|
||||
|
||||
On Windows, you can build HDF5 applications using either the Visual Studio Environment
|
||||
or the command line. The command line is normally used on linux, Unix, and Mac.
|
||||
|
||||
To build from the command line, navigate to your build directory and
|
||||
execute the following:
|
||||
|
||||
cmake --build . --config {Debug | Release}
|
||||
|
||||
|
||||
cmake --build . --config {Debug | Release}
|
||||
|
||||
NOTE: "--config {Debug | Release}" may be optional on your platform. We
|
||||
recommend choosing either Debug or Release on Windows. If you are
|
||||
using the pre-built binaries from HDF, use Release.
|
||||
|
||||
3.1 If you wish to use the Visual Studio environment, open the solution
|
||||
file in your build directory. Be sure to select either Debug or
|
||||
using the pre-built binaries from HDF, use Release.
|
||||
|
||||
3.1 If you wish to use the Visual Studio environment, open the solution
|
||||
file in your build directory. Be sure to select either Debug or
|
||||
Release and build the solution.
|
||||
|
||||
|
||||
4. Test HDF5 Applications
|
||||
|
||||
To test the build, navigate to your build directory and execute:
|
||||
|
||||
|
||||
ctest . -C {Debug | Release}
|
||||
|
||||
|
||||
NOTE: "-C {Debug | Release}" may be optional on your platform. We
|
||||
recommend choosing either Debug or Release to match the build
|
||||
step on Windows.
|
||||
step on Windows.
|
||||
|
||||
5. The files that support building with CMake are all of the files in the
|
||||
config/cmake folder, the CMakeLists.txt files in each source folder, and
|
||||
CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing
|
||||
performed by The HDF Group. It should be altered for the user's
|
||||
5. The files that support building with CMake are all of the files in the
|
||||
config/cmake folder, the CMakeLists.txt files in each source folder, and
|
||||
CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing
|
||||
performed by The HDF Group. It should be altered for the user's
|
||||
installation and needs. The cacheinit.cmake file settings are used by
|
||||
The HDF Group for daily testing. It should be altered/ignored for the user's
|
||||
installation and needs.
|
||||
The HDF Group for daily testing. It should be altered/ignored for the user's
|
||||
installation and needs.
|
||||
|
||||
|
||||
|
||||
@ -175,17 +176,17 @@ These steps are described in more detail below.
|
||||
III. Minimum C Project Files for CMake
|
||||
========================================================================
|
||||
|
||||
Create a CMakeLists.txt file at the source root. Include the
|
||||
Create a CMakeLists.txt file at the source root. Include the
|
||||
following text in the file:
|
||||
|
||||
##########################################################
|
||||
cmake_minimum_required (VERSION 3.1.0)
|
||||
PROJECT (HDF5MyApp C CXX)
|
||||
project (HDF5MyApp C CXX)
|
||||
|
||||
FIND_PACKAGE (HDF5 NAMES hdf5)
|
||||
# FIND_PACKAGE (HDF5) # Find non-cmake built HDF5
|
||||
find_package (HDF5 NAMES hdf5 COMPONENTS C static)
|
||||
# find_package (HDF5) # Find non-cmake built HDF5
|
||||
INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR})
|
||||
set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES})
|
||||
set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_STATIC_LIBRARY})
|
||||
|
||||
set (example hdf_example)
|
||||
|
||||
@ -193,7 +194,7 @@ add_executable (${example} ${PROJECT_SOURCE_DIR}/${example}.c)
|
||||
TARGET_C_PROPERTIES (${example} " " " ")
|
||||
target_link_libraries (${example} ${LINK_LIBS})
|
||||
|
||||
ENABLE_TESTING ()
|
||||
enable_testing ()
|
||||
include (CTest)
|
||||
|
||||
add_test (NAME test_example COMMAND ${example})
|
||||
@ -216,8 +217,8 @@ NOTE: these files are available at the HDF web site:
|
||||
http://www.hdfgroup.org/HDF5/release/cmakebuild.html
|
||||
|
||||
CTestScript.cmake
|
||||
|
||||
HDF518ExamplesWindowsbinaryCMake.cmake
|
||||
|
||||
HDF518_Examples.cmake
|
||||
|
||||
|
||||
|
||||
@ -226,10 +227,10 @@ ctest
|
||||
========================================================================
|
||||
|
||||
############################################################################
|
||||
# Product specific script, HDF518Example.cmake, that uses the
|
||||
# Product specific script, HDF518_Examples.cmake, that uses the
|
||||
# CTestScript.cmake file (see Appendix in the CMake.txt). Usage:
|
||||
# "ctest -S HDF518Example.cmake,hdf518Examples -C Release -O hdf518EX.log"
|
||||
# where hdf518Examples is the source folder relative to the location of these scripts
|
||||
# "ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log"
|
||||
# where HDF5Examples-0.1.1-Source is the source folder relative to the location of these scripts
|
||||
############################################################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
||||
@ -259,7 +260,7 @@ set(REPOSITORY_URL "http://svn.${hdfgroup_url}/hdf5-examples/trunk/1_8")
|
||||
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5Examples-1.8")
|
||||
|
||||
# location of the installed hdf5 (cmake configuration folder)
|
||||
set(ENV{HDF5_DIR} "/usr/share/cmake/hdf5")
|
||||
set(ENV{HDF5_DIR} "/usr/share/cmake")
|
||||
|
||||
include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)
|
||||
|
||||
|
1
src/H5.c
1
src/H5.c
@ -31,7 +31,6 @@
|
||||
#include "H5Pprivate.h" /* Property lists */
|
||||
#include "H5SLprivate.h" /* Skip lists */
|
||||
#include "H5Tprivate.h" /* Datatypes */
|
||||
#include "H5TSprivate.h" /* Thread safety */
|
||||
|
||||
/****************/
|
||||
/* Local Macros */
|
||||
|
@ -186,7 +186,7 @@ H5S_create(H5S_class_t type)
|
||||
FUNC_ENTER_NOAPI(NULL)
|
||||
|
||||
/* Create a new dataspace */
|
||||
if(NULL == (new_ds = H5FL_MALLOC(H5S_t)))
|
||||
if(NULL == (new_ds = H5FL_CALLOC(H5S_t)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
|
||||
|
||||
/* Initialize default dataspace state */
|
||||
|
43
test/th5s.c
43
test/th5s.c
@ -2324,6 +2324,48 @@ test_h5s_extent_copy(void)
|
||||
CHECK(ret, FAIL, "H5Sclose");
|
||||
} /* test_h5s_extent_copy() */
|
||||
|
||||
/****************************************************************
|
||||
**
|
||||
** test_h5s_bug1(): Test Creating dataspace with H5Screate then
|
||||
* setting extent with H5Sextent_copy.
|
||||
**
|
||||
****************************************************************/
|
||||
static void
|
||||
test_h5s_bug1(void)
|
||||
{
|
||||
hid_t space1; /* Dataspace to copy extent to */
|
||||
hid_t space2; /* Scalar dataspace */
|
||||
hsize_t dims[2] = {10, 10}; /* Dimensions */
|
||||
hsize_t start[2] = {0, 0}; /* Hyperslab start */
|
||||
htri_t select_valid; /* Whether the dataspace selection is valid */
|
||||
herr_t ret; /* Generic error return */
|
||||
|
||||
/* Create dataspaces */
|
||||
space1 = H5Screate(H5S_SIMPLE);
|
||||
CHECK(space1, FAIL, "H5Screate");
|
||||
space2 = H5Screate_simple(2, dims, NULL);
|
||||
CHECK(space2, FAIL, "H5Screate");
|
||||
|
||||
/* Copy extent to space1 */
|
||||
ret = H5Sextent_copy(space1, space2);
|
||||
CHECK(ret, FAIL, "H5Sextent_copy");
|
||||
|
||||
/* Select hyperslab in space1 containing entire extent */
|
||||
ret = H5Sselect_hyperslab(space1, H5S_SELECT_SET, start, NULL, dims, NULL);
|
||||
CHECK(ret, FAIL, "H5Sselect_hyperslab");
|
||||
|
||||
/* Check that space1's selection is valid */
|
||||
select_valid = H5Sselect_valid(space1);
|
||||
CHECK(select_valid, FAIL, "H5Sselect_valid");
|
||||
VERIFY(select_valid, TRUE, "H5Sselect_valid result");
|
||||
|
||||
/* Close dataspaces */
|
||||
ret = H5Sclose(space1);
|
||||
CHECK(ret, FAIL, "H5Sclose");
|
||||
ret = H5Sclose(space2);
|
||||
CHECK(ret, FAIL, "H5Sclose");
|
||||
} /* test_h5s_bug1() */
|
||||
|
||||
/****************************************************************
|
||||
**
|
||||
** test_h5s(): Main H5S (dataspace) testing routine.
|
||||
@ -2350,6 +2392,7 @@ test_h5s(void)
|
||||
|
||||
test_h5s_extent_equal(); /* Test extent comparison code */
|
||||
test_h5s_extent_copy(); /* Test extent copy code */
|
||||
test_h5s_bug1(); /* Test bug in offset initialization */
|
||||
} /* test_h5s() */
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user