Create a working directory.
Uncompress the HDF4 CMake source code file into the working directory. It will contain a
CMake-hdf-Ndirectory (where N is the release version).
From the command line, go into the
CMake-hdf-Ndirectory, which contains:
HDF4 Source Code
User modifiable options
External library for JPEG Compression
External library for SZIP Compression
External library for ZLIB Compression
- By default HDF4 will be built:
- Without Fortran
- With SZIP compression enabled
- With ZLIB compression enabled
- With static libraries enabled
Users can change the options that HDF4 is built with by adding options to the build command (see the batch files/test script below) or by modifying the
HDF4options.cmakefile will override any options set in the configuration file. For more information see the How to Change HDF4 CMake Build Options page.
REQUIRED: Visual Studio Express users must change the build options to turn off packaging or the build will fail.
- Execute the batch file or shell script containing the ctest command for your platform. (See Troubleshooting if you do not see your platform).
Example build files are shown below:
Platform Batch File / Shell Script ctest command Windows 64-bit VS 2015 build-VS2015-64.bat ctest -S HDF4config.cmake,BUILD_GENERATOR=VS201564 -C Release -V -O hdf4.log Windows 32-bit VS 2015 build-VS2015-32.bat ctest -S HDF4config.cmake,BUILD_GENERATOR=VS2015 -C Release -V -O hdf4.log Unix build-unix.sh ctest -S HDF4config.cmake,BUILD_GENERATOR=Unix -C Release -V -O hdf4.log
Where the ctest command is using these options:
- The -S option uses the script version of ctest.
- The -C option specifies the build configuration which matches CTEST_BUILD_CONFIGURATION in the configuration file.
- The -V option indicates verbose. -VV option indicates more verbose.
- The -O option saves the output to a log file, hdf4.log.
- Locate the built binary.
The built binary will be placed in the build directory and will have the format:
hdf-4.2.N-<platform.<zip or tar.gz>
On Windows, a .msi or .exe file will also be created, depending on the installer. On Unix, an additional .sh file will be created.
If the built binary is not there, then see Troubleshooting for help.
- Check what is included with your built binaries
You will find the
libhdf4.settingsfile in the build directory. It contains information on how the binaries were built.