hdf images hdf images

HDF5 CMake Build Options


Changing Options in the Configuration File

Please view the comments at the top of the configuration file (HDF518config.cmake) for how to specify different options with it.


Common CMake and configure Options

There are numerous CMake options available to users, many of which correspond directly to configure options. Below are a few important options and how to change them in the configuration file. The corresponding configure option is also shown:

Option Configure CMake
Build shared/static libraries --enable-shared or
--enable-static (--disable-shared)
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON") or set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
Build static executables
(Linux ONLY, -static)
--enable-static-exec set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_STATIC_EXECS:BOOL=ON")
Build HDF5 C++ library --enable-cxx set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON")
Build Fortran HDF5 library --enable-fortran set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
Enable Fortran 2003 --enable-fortran2003 set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
Enable/Disable ZLIB filter --with-zlib set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON") or
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF")
Enable/Disable SZIP filter --with-szlib set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON")
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON") or
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF")
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF")
Enable parallel build --enable-parallel set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=4")
Compile in Release Mode --enable-production -C Release (in build script) and set(CTEST_BUILD_CONFIGURATION "Release")
Compile in Debug Mode --enable-debug -C Debug (in build script) and set(CTEST_BUILD_CONFIGURATION "Debug")
Build HDF5 Java library (for HDF5-1.10 ONLY) --enable-java set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON")

- - Last modified: 05 April 2016