# Problems building HDF5 with plugin support

**URL:** <https://forum.hdfgroup.org/t/problems-building-hdf5-with-plugin-support/13037>\
**Category:** HDF5 Library\
**Created:** [February 7, 2025, 10:03pm UTC](https://forum.hdfgroup.org/t/problems-building-hdf5-with-plugin-support/13037 "2025-02-07T22:03:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric.kemp](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@eric.kemp](https://forum.hdfgroup.org/u/eric.kemp)\
**Post date:** [February 7, 2025, 10:03pm UTC](https://forum.hdfgroup.org/t/problems-building-hdf5-with-plugin-support/13037/1 "2025-02-07T22:03:43Z")

</div>

Some preliminaries:

- Compiling from source for hdf5-1.14.6 (also tried hdf5-1.14.5)
- Compiling on Linux with Intel compilers 2023.2.1 (icx and ifort)
- Using CMake, as Autotools option doesn’t seem to support hdf5\_plugins
- Using “Unix Makefiles”

Between INSTALL\_CMake.txt and discussion in [Compiling HDF5 with Plugins (LZF)](https://forum.hdfgroup.org/t/compiling-hdf5-with-plugins-lzf/11223), it appears HDF5 and hdf5\_filters can be build simultaneously using the HDF5 cmake invocation. However, cmake fails in the first step. My invocation:

cmake -G “Unix Makefiles”   
-DCMAKE\_BUILD\_TYPE:STRING=Release   
-DBUILD\_SHARED\_LIBS:BOOL=OFF   
-DBUILD\_TESTING:BOOL=ON   
-DHDF5\_BUILD\_FORTRAN:BOOL=ON   
-DHDF5\_INSTALL\_MOD\_FORTRAN:BOOL=ON   
-DHDF5\_BUILD\_TOOLS:BOOL=ON   
-DCMAKE\_C\_FLAGS:STRING=“-fpic”   
-DHDF5\_ENABLE\_PLUGIN\_SUPPORT:BOOL=ON   
-DHDF5\_ALLOW\_EXTERNAL\_SUPPORT:STRING=“TGZ”   
-DPLUGIN\_TGZ\_NAME:STRING=“hdf5\_plugins-1.14.tar.gz”   
-DTGZPATH:PATH=“/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/tarballs”   
-DHDF5\_ENABLE\_SZIP\_SUPPORT:BOOL=OFF   
…/hdf5-1.14.6 \>& config.log

The error message is:  
[22%] Performing download step (DIR copy) for ‘hdf5\_zlib-populate’  
Error copying directory from “/” to “/discover/nobackup/projects/usaf\_lis/emkemp  
/ZSTD/intel-2023.2.1/myhdfstuff/build/\_deps/hdf5\_zlib-src”.  
gmake[2]: \*\*\* [CMakeFiles/hdf5\_zlib-populate.dir/build.make:100: hdf5\_zlib-popul  
ate-prefix/src/hdf5\_zlib-populate-stamp/hdf5\_zlib-populate-download] Error 1  
gmake[1]: \*\*\* [CMakeFiles/Makefile2:83: CMakeFiles/hdf5\_zlib-populate.dir/all] Error 2  
gmake: \*\*\* [Makefile:91: all] Error 2

Modifying the -DTGZPATH flag to replace :PATH with :STRING does not change this behavior.

I assume an additional flag is required to specify the source directory (instead of "/'), but I don’t know what this is.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![hyoklee](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/hyoklee/32/1528_2.png) [@hyoklee](https://forum.hdfgroup.org/u/hyoklee)\
**Post date:** [February 8, 2025, 4:43pm UTC](https://forum.hdfgroup.org/t/problems-building-hdf5-with-plugin-support/13037/2 "2025-02-08T16:43:18Z")

</div>

Hi, @eric.kemp !

You may try something like these:  
[hdf5\_plugins/.github/workflows/cmake-ctest.yml at master · HDFGroup/hdf5\_plugins](https://github.com/HDFGroup/hdf5_plugins/blob/master/.github/workflows/cmake-ctest.yml#L336)  
[hdf5\_plugins/.github/workflows/cmake-script.yml at master · HDFGroup/hdf5\_plugins](https://github.com/HDFGroup/hdf5_plugins/blob/master/.github/workflows/cmake-script.yml#L280)

However, I cannot guarantee that it will work based on the current CI results:  
[Workflow runs · HDFGroup/hdf5\_plugins](https://github.com/HDFGroup/hdf5_plugins/actions)

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [February 10, 2025, 4:00pm UTC](https://forum.hdfgroup.org/t/problems-building-hdf5-with-plugin-support/13037/3 "2025-02-10T16:00:30Z")

</div>

> [@eric.kemp](#):
>
> hdf5\_zlib

This is the library compression zlib, not a plugin. Because you are using TGZ option the zlib tgz file must also be at that location.

---

<div class="post-metadata">

**Author:** ![eric.kemp](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@eric.kemp](https://forum.hdfgroup.org/u/eric.kemp)\
**Post date:** [February 10, 2025, 7:38pm UTC](https://forum.hdfgroup.org/t/problems-building-hdf5-with-plugin-support/13037/4 "2025-02-10T19:38:46Z")

</div>

Thanks @byrn. I made several attempts to modify the cmake command line and got different errors. For simplicity, the below examples don’t try to build the hdf5\_plugins.

Attempt 1, mimicking INSTALL\_CMake.txt IV-2-C:

cmake -G “Unix Makefiles”   
-DCMAKE\_BUILD\_TYPE:STRING=Release   
-DBUILD\_SHARED\_LIBS:BOOL=OFF   
-DBUILD\_TESTING:BOOL=ON   
-DHDF5\_BUILD\_FORTRAN:BOOL=ON   
-DHDF5\_INSTALL\_MOD\_FORTRAN:BOOL=ON   
-DHDF5\_BUILD\_TOOLS:BOOL=ON   
-DCMAKE\_C\_FLAGS:STRING=“-fpic”   
-DHDF5\_ALLOW\_EXTERNAL\_SUPPORT:STRING=“TGZ”   
-DZLIB\_TGZ\_NAME:STRING=“zlib-1.3.1.tar.gz”   
-DTGZPATH:STRING=“/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/tarballs/”   
-DHDF5\_ENABLE\_SZIP\_SUPPORT:BOOL=OFF   
…/hdf5-1.14.6 \>& config.log

Error message:  
[11%] Creating directories for ‘hdf5\_zlib-populate’  
[22%] Performing download step (verify and extract) for ‘hdf5\_zlib-populate’  
CMake Error at hdf5\_zlib-subbuild/hdf5\_zlib-populate-prefix/src/hdf5\_zlib-populate-stamp/verify-hdf5\_zlib-populate.cmake:11 (message):  
File not found: /zlib-1.3.1.tar.gz

gmake[2]: \*\*\* [CMakeFiles/hdf5\_zlib-populate.dir/build.make:99: hdf5\_zlib-populate-prefix/src/hdf5\_zlib-populate-stamp/hdf5\_zlib-populate-download] Error 1  
gmake[1]: \*\*\* [CMakeFiles/Makefile2:83: CMakeFiles/hdf5\_zlib-populate.dir/all] Error 2  
gmake: \*\*\* [Makefile:91: all] Error 2

CMake Error at /usr/share/cmake/Modules/FetchContent.cmake:1012 (message):  
Build step for hdf5\_zlib failed: 2  
Call Stack (most recent call first):  
/usr/share/cmake/Modules/FetchContent.cmake:1141:EVAL:2 (\_\_FetchContent\_directPopulate)  
/usr/share/cmake/Modules/FetchContent.cmake:1141 (cmake\_language)  
/usr/share/cmake/Modules/FetchContent.cmake:1184 (FetchContent\_Populate)  
config/cmake/HDFLibMacros.cmake:38 (FetchContent\_MakeAvailable)  
CMakeFilters.cmake:140 (EXTERNAL\_ZLIB\_LIBRARY)  
CMakeLists.txt:921 (include)

Attempt 2, mimicking INSTALL\_CMake.txt IV-2-D:  
cmake -G “Unix Makefiles”   
-DCMAKE\_BUILD\_TYPE:STRING=Release   
-DBUILD\_SHARED\_LIBS:BOOL=OFF   
-DBUILD\_TESTING:BOOL=ON   
-DHDF5\_BUILD\_FORTRAN:BOOL=ON   
-DHDF5\_INSTALL\_MOD\_FORTRAN:BOOL=ON   
-DHDF5\_BUILD\_TOOLS:BOOL=ON   
-DCMAKE\_C\_FLAGS:STRING=“-fpic”   
-DZLIB\_TGZ\_NAME:STRING=“zlib-1.3.1.tar.gz”   
-DZLIB\_TGZ\_ORIGPATH:STRING=“/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/tarballs/”   
-DHDF5\_ALLOW\_EXTERNAL\_SUPPORT:STRING=“TGZ”   
-DZLIB\_USE\_LOCALCONTENT:BOOL=OFF   
-DHDF5\_ENABLE\_SZIP\_SUPPORT:BOOL=OFF   
…/hdf5-1.14.6 \>& config.log

Error message:  
– Renaming  
– /discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/myhdfstuff/build/\_deps/hdf5\_zlib-src/zconf.h  
– to ‘zconf.h.included’ because this file is included with zlib  
– but CMake generates it automatically in the build directory.  
CMake Error at config/cmake/HDFLibMacros.cmake:40 (add\_library):  
add\_library cannot create ALIAS target “zlib-static” because another target  
with the same name already exists.  
Call Stack (most recent call first):  
CMakeFilters.cmake:140 (EXTERNAL\_ZLIB\_LIBRARY)  
CMakeLists.txt:921 (include)

CMake Warning at CMakeFilters.cmake:163 (message):  
ZLib support in HDF5 was enabled but not found  
Call Stack (most recent call first):  
CMakeLists.txt:921 (include)

[…snip…]

– HDF5 H5\_LIBVER\_DIR: 114 HDF5\_VERSION\_MAJOR: 1.14  
– Configuring incomplete, errors occurred!

Attempt 3 follows the very end of mimicking INSTALL\_CMake.txt IV-2-D, from “The files can also be retrieved from a local path if necessary”

cmake -G “Unix Makefiles”   
-DCMAKE\_BUILD\_TYPE:STRING=Release   
-DBUILD\_SHARED\_LIBS:BOOL=OFF   
-DBUILD\_TESTING:BOOL=ON   
-DHDF5\_BUILD\_FORTRAN:BOOL=ON   
-DHDF5\_INSTALL\_MOD\_FORTRAN:BOOL=ON   
-DHDF5\_BUILD\_TOOLS:BOOL=ON   
-DCMAKE\_C\_FLAGS:STRING=“-fpic”   
-DZLIB\_TGZ\_NAME:STRING=“zlib-1.3.1.tar.gz”   
-DTGZPATH:STRING=“/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2  
023.2.1/tarballs/”   
-DHDF5\_ALLOW\_EXTERNAL\_SUPPORT:STRING=“TGZ”   
-DZLIB\_USE\_LOCALCONTENT:BOOL=ON   
-DHDF5\_ENABLE\_SZIP\_SUPPORT:BOOL=OFF   
…/hdf5-1.14.6 \>& config.log

But I get the same error.

---

<div class="post-metadata">

**Author:** ![eric.kemp](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@eric.kemp](https://forum.hdfgroup.org/u/eric.kemp)\
**Post date:** [February 11, 2025, 10:04pm UTC](https://forum.hdfgroup.org/t/problems-building-hdf5-with-plugin-support/13037/5 "2025-02-11T22:04:17Z")

</div>

Update: I reviewed available CMake files and found a combination that builds HDF5 with ZLIB (and SZIP, for simplicity in running the automated tests). The selected arguments are:

cmake -G “Unix Makefiles”   
-C …/hdf5-1.14.6/config/cmake/cacheinit.cmake   
-DCMAKE\_BUILD\_TYPE:STRING=Release   
-DBUILD\_SHARED\_LIBS:BOOL=OFF   
-DCMAKE\_C\_FLAGS:STRING=“-fpic”   
-DHDF5\_BUILD\_FORTRAN:BOOL=ON   
-DHDF5\_INSTALL\_MOD\_FORTRAN:BOOL=ON   
-DHDF5\_BUILD\_JAVA:BOOL=OFF   
-DCMAKE\_INSTALL\_PREFIX:PATH=/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/installs/hdf5-1.14.6   
-DHDF5\_ALLOW\_EXTERNAL\_SUPPORT:STRING=TGZ   
-DTGZPATH:PATH=/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/myhdfstuff   
-DHDF5\_ENABLE\_Z\_LIB\_SUPPORT:BOOL=ON   
-DHDF5\_ENABLE\_SZIP\_SUPPORT:BOOL=ON   
-DHDF5\_ENABLE\_SZIP\_ENCODING:BOOL=ON   
-DHDF5\_BUILD\_CPP\_LIB:BOOL=OFF   
-DHDF5\_BUILD\_FORTRAN:BOOL=ON   
-DHDF5\_BUILD\_HL\_LIB:BOOL=OFF   
-DBUILD\_TESTING:BOOL=ON   
-DHDF5\_PACKAGE\_EXTLIBS:BOOL=ON   
/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/myhdfstuff/hdf5-1.14.6 \>& config.log

So I’m over that hurdle. Will tackle hdf5\_plugins tomorrow.

---

<div class="post-metadata">

**Author:** ![eric.kemp](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@eric.kemp](https://forum.hdfgroup.org/u/eric.kemp)\
**Post date:** [February 18, 2025, 8:26pm UTC](https://forum.hdfgroup.org/t/problems-building-hdf5-with-plugin-support/13037/6 "2025-02-18T20:26:29Z")

</div>

Last (?) post. I can get HDF5 to compile with ZSTD support with the following:

cmake -G “Unix Makefiles”   
-C …/hdf5-1.14.6/config/cmake/cacheinit.cmake   
-DCMAKE\_BUILD\_TYPE:STRING=Release   
-DBUILD\_SHARED\_LIBS:BOOL=ON   
-DBUILD\_STATIC\_LIBS:BOOL=OFF   
-DHDF5\_BUILD\_FORTRAN:BOOL=ON   
-DHDF5\_BUILD\_CPP\_LIB:BOOL=OFF   
-DHDF5\_BUILD\_HL\_LIB:BOOL=OFF   
-DHDF5\_INSTALL\_MOD\_FORTRAN:STRING=SHARED   
-DHDF5\_BUILD\_JAVA:BOOL=OFF   
-DCMAKE\_INSTALL\_PREFIX:PATH=/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/installs/hdf5-1.14.6   
-DHDF5\_ALLOW\_EXTERNAL\_SUPPORT:STRING=TGZ   
-DTGZPATH:PATH=/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/myhdfstuff   
-DHDF5\_ENABLE\_Z\_LIB\_SUPPORT:BOOL=ON   
-DZLIB\_TGZ\_NAME:STRING=zlib-1.3.1.tar.gz   
-DZLIB\_USE\_LOCALCONTENT:BOOL=ON   
-DHDF5\_USE\_ZLIB\_NG:BOOL=OFF   
-DLIBAEC\_TGZ\_NAME:STRING=libaec-1.1.3.tar.gz   
-DLIBAEC\_USE\_LOCALCONTENT:BOOL=ON   
-DHDF5\_ENABLE\_SZIP\_SUPPORT:BOOL=ON   
-DHDF5\_ENABLE\_SZIP\_ENCODING:BOOL=ON   
-DBUILD\_TESTING:BOOL=ON   
-DHDF5\_PACKAGE\_EXTLIBS:BOOL=ON   
-DHDF5\_ENABLE\_ALL\_WARNINGS:BOOL=ON   
-DHDF5\_ENABLE\_PLUGIN\_SUPPORT:BOOL=ON   
-DPLUGIN\_USE\_EXTERNAL:BOOL=ON   
-DPLUGIN\_TGZ\_NAME:STRING=hdf5\_plugins-1.14.tar.gz   
-DPLUGIN\_USE\_LOCALCONTENT:BOOL=ON   
-DZSTD\_TGZ\_NAME=zstd-1.5.6.tar.gz   
-DH5PL\_TGZPATH:PATH=/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/myhdfstuff   
-DENABLE\_BLOSC:BOOL=OFF   
-DENABLE\_BLOSC2:BOOL=OFF   
-DENABLE\_BSHUF:BOOL=OFF   
-DENABLE\_BZIP2:BOOL=OFF   
-DENABLE\_FPZIP:BOOL=OFF   
-DENABLE\_JPEG:BOOL=OFF   
-DENABLE\_LZ4:BOOL=OFF   
-DENABLE\_LZF:BOOL=OFF   
-DENABLE\_SZ:BOOL=OFF   
-DENABLE\_ZFP:BOOL=OFF   
-DHDF\_ZSTD\_USE\_EXTERNAL:BOOL=ON   
-DH5PL\_BUILD\_TESTING:BOOL=ON   
-DH5PL\_COMP\_TGZPATH:PATH=/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/myhdfstuff   
/discover/nobackup/projects/usaf\_lis/emkemp/ZSTD/intel-2023.2.1/myhdfstuff/hdf5-1.14.6

Build, test, and install steps work, _but_ it was necessary to update my LD\_LIBRARY\_PATH before running ctest.

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [March 21, 2025, 1:22pm UTC](https://forum.hdfgroup.org/t/problems-building-hdf5-with-plugin-support/13037/7 "2025-03-21T13:22:34Z")

</div>

Yes, we have discovered the same, and a little investigation and discussion provides a too obvious solution when building plugins inline: we know where we are going to install the plugins and we should just set the default path. We will be fixing this in develop but all you need to do is to add the path to the plugins on the command line:  
A new configuration option can be used to change the default plugin path:

- Autotools configure option `–with-default-plugindir=location`
- CMake option -DH5\_DEFAULT\_PLUGINDIR:PATH=location
