How to build HDF5 with ZLib and SZIP ?

Hello,

How to build HDF5 (1.8.15) with ZLib and SZIP (on Ubuntu-14.04) ?

With this (called within a bash script where $1 is a path to the final install where libz and libszip are already installed) :
export CMAKE_PREFIX_PATH="$1/share/cmake:$CMAKE_PREFIX_PATH"
export CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"
export CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"
export CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"
export CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1 -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON -DHDF_ENABLE_LARGE_FILE:BOOL=ON \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_INCLUDE_DIR:PATH="$1/include" -DZLIB_LIBRARY:PATH="$1/lib/libz.so" \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON -DSZIP_INCLUDE_DIR:PATH="$1/include" -DSZIP_LIBRARY_RELEASE:PATH="$1/lib/libszip.so" -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON ..
I got this :
[ 0%] Linking C shared library ../bin/libhdf5.so
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
collect2: error: ld returned 1 exit status

With this :
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1 -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON -DHDF_ENABLE_LARGE_FILE:BOOL=ON \
       -DHDF5_ALLOW_EXTERNAL_SUPPORT:BOOL=ON -DZLIB_USE_EXTERNAL:BOOL=ON -DSZIP_USE_EXTERNAL:BOOL=ON \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
     -DZLIB_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/src/ZLib.tar.gz" \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON -DSZIP_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/src/SZip.tar.gz" ..
I got this :
CMake Error at CMakeFilters.cmake:66 (message):
    ZLib is Required for ZLib support in HDF5

Franck

Franck,

    HDF5_ALLOW_EXTERNAL_SUPPORT is not a BOOL, it is a STRING "NO, SVN, TGZ".

Allen

···

On Sunday, October 11, 2015 06:23:49 PM houssen wrote:

Hello,

How to build HDF5 (1.8.15) with ZLib and SZIP (on Ubuntu-14.04) ?

With this (called within a bash script where $1 is a path to the final
install where libz and libszip are already installed) :
export CMAKE_PREFIX_PATH="$1/share/cmake:$CMAKE_PREFIX_PATH"
export CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"
export CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"
export CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"
export CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON
                                                     \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON
-DHDF_ENABLE_LARGE_FILE:BOOL=ON
                             \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
-DZLIB_INCLUDE_DIR:PATH="$1/include"
-DZLIB_LIBRARY:PATH="$1/lib/libz.so"
           \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
-DSZIP_INCLUDE_DIR:PATH="$1/include"
-DSZIP_LIBRARY_RELEASE:PATH="$1/lib/libszip.so"
-DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON ..
I got this :
[ 0%] Linking C shared library ../bin/libhdf5.so
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
collect2: error: ld returned 1 exit status

With this :
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON
                                                        \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON
-DHDF_ENABLE_LARGE_FILE:BOOL=ON
                                \
       -DHDF5_ALLOW_EXTERNAL_SUPPORT:BOOL=ON -DZLIB_USE_EXTERNAL:BOOL=ON
-DSZIP_USE_EXTERNAL:BOOL=ON
                     \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON

-DZLIB_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/src/
ZLib.tar.gz" \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
-DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON
-DSZIP_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/src/
SZip.tar.gz" ..
I got this :
CMake Error at CMakeFilters.cmake:66 (message):
    ZLib is Required for ZLib support in HDF5

Franck

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Hello,

My understanding is that HDF5_ALLOW_EXTERNAL_SUPPORT should not be used (and defaults to NO) according to the doc : I tried to set it anyway.
Also, on Ubuntu when I "sudo apt-get install" zlib, it seems I get an autotools install, so CMake does not find the zlib install (missing Find*.cmake): this is why I tried to build from source and install ZLib / SZip (I use ZLIB / SZIP tarballs provided by www.hdfgroup.org/ftp/HDF5/releases/... as they have been patched to create Find*.cmake files at install time).

My last try (called within a bash script where $1 is a path to the final install where libz and libszip are already installed) :
export CMAKE_PREFIX_PATH="$1:$1/share/cmake:$CMAKE_PREFIX_PATH"
export CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"
export CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"
export CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"
export CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1 -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON -DHDF_ENABLE_LARGE_FILE:BOOL=ON \
       -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="NO" \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_INCLUDE_DIR:PATH="$1/include" -DZLIB_LIBRARY:FILEPATH="$1/lib/libz.so" \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON -DSZIP_INCLUDE_DIR:PATH="$1/include" -DSZIP_LIBRARY:FILEPATH="$1/lib/libszip.so" ..

Note : I use now -DZLIB_LIBRARY:FILEPATH / -DSZIP_LIBRARY:FILEPATH according to the doc.

Gives me this :
[ 36%] Linking C shared library ../bin/libhdf5.so
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES

I miss something but can't figure our what ?... I guess options are upsetting each other...

Franck

···

Le 2015-10-12 15:56, Allen Byrne a écrit :

Franck,

    HDF5_ALLOW_EXTERNAL_SUPPORT is not a BOOL, it is a STRING "NO, SVN, TGZ".

Allen

On Sunday, October 11, 2015 06:23:49 PM houssen wrote:

Hello,

How to build HDF5 (1.8.15) with ZLib and SZIP (on Ubuntu-14.04) ?

With this (called within a bash script where $1 is a path to the final
install where libz and libszip are already installed) :
export CMAKE_PREFIX_PATH="$1/share/cmake:$CMAKE_PREFIX_PATH"
export CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"
export CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"
export CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"
export CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON
                                                     \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON
-DHDF_ENABLE_LARGE_FILE:BOOL=ON
                             \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
-DZLIB_INCLUDE_DIR:PATH="$1/include"
-DZLIB_LIBRARY:PATH="$1/lib/libz.so"
           \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
-DSZIP_INCLUDE_DIR:PATH="$1/include"
-DSZIP_LIBRARY_RELEASE:PATH="$1/lib/libszip.so"
-DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON ..
I got this :
[ 0%] Linking C shared library ../bin/libhdf5.so
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
collect2: error: ld returned 1 exit status

With this :
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON
                                                        \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON
-DHDF_ENABLE_LARGE_FILE:BOOL=ON
                                \
       -DHDF5_ALLOW_EXTERNAL_SUPPORT:BOOL=ON -DZLIB_USE_EXTERNAL:BOOL=ON
-DSZIP_USE_EXTERNAL:BOOL=ON
                     \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON

-DZLIB_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/src/
ZLib.tar.gz" \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
-DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON

-DSZIP_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/src/
SZip.tar.gz" ..
I got this :
CMake Error at CMakeFilters.cmake:66 (message):
    ZLib is Required for ZLib support in HDF5

Franck

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org

http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Franck,

You are correct that the standard zlib does not provide cmake compiled
binaries. We created the tarballs so that we could build the szip/zlib
libararies with the same options as the library.

We do test with the "point to the system installed libs" option - AFAIK, there
are no reported problems.

Well, the options look correct. The ZSIP/ZLIB_EXPORT_LIBRARIES in the link
line is very strange. Where could that be coming from instead of the actual
name you supplied.
It is possible that something got confused in the cmake files - because those
are names of variables used within our cmake-ified szip/zlib tarballs.

Allen

···

On Monday, October 12, 2015 06:22:26 PM houssen wrote:

Hello,

My understanding is that HDF5_ALLOW_EXTERNAL_SUPPORT should not be used
(and defaults to NO) according to the doc : I tried to set it anyway.
Also, on Ubuntu when I "sudo apt-get install" zlib, it seems I get an
autotools install, so CMake does not find the zlib install (missing
Find*.cmake): this is why I tried to build from source and install ZLib
/ SZip (I use ZLIB / SZIP tarballs provided by
www.hdfgroup.org/ftp/HDF5/releases/... as they have been patched to
create Find*.cmake files at install time).

My last try (called within a bash script where $1 is a path to the
final install where libz and libszip are already installed) :
export CMAKE_PREFIX_PATH="$1:$1/share/cmake:$CMAKE_PREFIX_PATH"
export CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"
export CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"
export CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"
export CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON
              \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON
-DHDF_ENABLE_LARGE_FILE:BOOL=ON \
       -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="NO"
                                                    \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
-DZLIB_INCLUDE_DIR:PATH="$1/include"
-DZLIB_LIBRARY:FILEPATH="$1/lib/libz.so" \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
-DSZIP_INCLUDE_DIR:PATH="$1/include"
-DSZIP_LIBRARY:FILEPATH="$1/lib/libszip.so" ..

Note : I use now -DZLIB_LIBRARY:FILEPATH / -DSZIP_LIBRARY:FILEPATH
according to the doc.

Gives me this :
[ 36%] Linking C shared library ../bin/libhdf5.so
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES

I miss something but can't figure our what ?... I guess options are
upsetting each other...

Franck

Le 2015-10-12 15:56, Allen Byrne a écrit :
> Franck,
>
> HDF5_ALLOW_EXTERNAL_SUPPORT is not a BOOL, it is a STRING "NO,
>
> SVN, TGZ".
>
> Allen
>
> On Sunday, October 11, 2015 06:23:49 PM houssen wrote:
>> Hello,
>>
>> How to build HDF5 (1.8.15) with ZLib and SZIP (on Ubuntu-14.04) ?
>>
>> With this (called within a bash script where $1 is a path to the
>> final
>> install where libz and libszip are already installed) :
>> export CMAKE_PREFIX_PATH="$1/share/cmake:$CMAKE_PREFIX_PATH"
>> export CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"
>> export CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"
>> export CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"
>> export CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"
>> cmake -DCMAKE_INSTALL_PREFIX:PATH=$1
>> -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON
>>
>> \
>>
>> -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON
>>
>> -DHDF_ENABLE_LARGE_FILE:BOOL=ON
>>
>> \
>>
>> -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
>>
>> -DZLIB_INCLUDE_DIR:PATH="$1/include"
>> -DZLIB_LIBRARY:PATH="$1/lib/libz.so"
>>
>> \
>>
>> -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
>>
>> -DSZIP_INCLUDE_DIR:PATH="$1/include"
>> -DSZIP_LIBRARY_RELEASE:PATH="$1/lib/libszip.so"
>> -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON ..
>> I got this :
>> [ 0%] Linking C shared library ../bin/libhdf5.so
>> /usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
>> /usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
>> /usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
>> /usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
>> collect2: error: ld returned 1 exit status
>>
>> With this :
>> cmake -DCMAKE_INSTALL_PREFIX:PATH=$1
>> -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON
>>
>> \
>>
>> -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON
>>
>> -DHDF_ENABLE_LARGE_FILE:BOOL=ON
>>
>> \
>>
>> -DHDF5_ALLOW_EXTERNAL_SUPPORT:BOOL=ON
>>
>> -DZLIB_USE_EXTERNAL:BOOL=ON
>> -DSZIP_USE_EXTERNAL:BOOL=ON
>>
>> \
>>
>> -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
>>
>> -DZLIB_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/s
>> rc/ ZLib.tar.gz" \
>>
>> -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON
>>
>> -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON
>>
>> -DSZIP_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/s
>> rc/ SZip.tar.gz" ..
>> I got this :
>>
>> CMake Error at CMakeFilters.cmake:66 (message):
>> ZLib is Required for ZLib support in HDF5
>>
>> Franck
>>
>>
>> _______________________________________________
>> Hdf-forum is for HDF software users discussion.
>> Hdf-forum@lists.hdfgroup.org
>>
>> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
>> Twitter: https://twitter.com/hdf5

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Hi Franck,

Also, on Ubuntu when I "sudo apt-get install" zlib, it seems I get an
autotools install, so CMake does not find the zlib install (missing
Find*.cmake): this is why I tried to build from source and install ZLib /
SZip (I use ZLIB / SZIP tarballs provided by
www.hdfgroup.org/ftp/HDF5/releases/... as they have been patched to create
Find*.cmake files at install time).

Firstly, you should follow Richard's updated correction to my message
in terms of the library that you need to get zlib.

IMHO, if CMake cannot find zlib, trying to install zlib from source is
perhaps the wrong way to go. You're adding one more thing that you'll
need to compile. You should instead be trying to figure out (a) if
you've installed zlib correctly and (b) why CMake cannot find it. I
suspect the Find*.cmake for zlib is well-used and well-tested, so I
think it should be ok.

Of course, I don't know why there are HDF5 patched versions of
Find*.cmake for zlib...

Ray

···

On Tue, Oct 13, 2015 at 12:22 AM, houssen <houssen@ipgp.fr> wrote:

I had no time to test all possible configurations (maybe tomorrow)
but I have some (weird) news !

When I do that :
export
CMAKE_PREFIX_PATH="$1:$1/SHARE/CMAKE:$CMAKE_PREFIX_PATH"
export
CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"
export
CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"
export
CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"
export
CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"
cmake
-DCMAKE_INSTALL_PREFIX:PATH=$1 -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DBUILD_SHARED_LIBS:BOOL=ON
-DHDF5_BUILD_HL_LIB:BOOL=ON
-DHDF5_BUILD_TOOLS:BOOL=ON -DHDF_ENABLE_LARGE_FILE:BOOL=ON

-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_INCLUDE_DIR:PATH="$1/include"
-DZLIB_LIBRARY:FILEPATH="$1/lib/libz.so"

-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON -DSZIP_INCLUDE_DIR:PATH="$1/include"
-DSZIP_LIBRARY:FILEPATH="$1/lib/libszip.so" ..
if [ $? -ne 0 ]; then
exit 1; fi

I get that in the configure log message (NO error message)
:
-- Filter ZLIB is ON
-- Filter SZIP is ON
-- Configuring done

···

--
Generating done
CMake Warning:
Manually-specified variables were not
used by the project:
SZIP_LIBRARY
ZLIB_LIBRARY

And finally that at
build time :
[ 36%] Linking C shared library
../bin/libhdf5.so
/USR/BIN/LD.BFD.REAL: CAN'T FIND
-LZLIB_EXPORT_LIBRARIES
/USR/BIN/LD.BFD.REAL: CAN'T FIND
-LSZIP_EXPORT_LIBRARIES

Now when I do that :
export
CMAKE_PREFIX_PATH="$1:$CMAKE_PREFIX_PATH" # SUPPRESS
$1/SHARE/CMAKE
export
CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"
export
CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"
export
CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"
export
CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"
cmake
-DCMAKE_INSTALL_PREFIX:PATH=$1 -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DBUILD_SHARED_LIBS:BOOL=ON
-DHDF5_BUILD_HL_LIB:BOOL=ON
-DHDF5_BUILD_TOOLS:BOOL=ON -DHDF_ENABLE_LARGE_FILE:BOOL=ON

-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_INCLUDE_DIR:PATH="$1/include"
-DZLIB_LIBRARY:FILEPATH="$1/lib/libz.so"

-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON -DSZIP_INCLUDE_DIR:PATH="$1/include"
-DSZIP_LIBRARY:FILEPATH="$1/lib/libszip.so" ..
if [ $? -ne 0 ]; then
exit 1; fi

I get that in configure log message :
CMake Warning at
CMakeFilters.cmake:43 (find_package):
Could NOT find a package
configuration file provided by "ZLIB" with any of
the following names:

ZLIBConfig.cmake
zlib-config.cmake
ADD THE INSTALLATION PREFIX OF
"ZLIB" TO CMAKE_PREFIX_PATH OR SET
"ZLIB_DIR" to a directory containing
one of the above files. If "ZLIB"
provides a separate development
package or SDK, be sure it has been
installed.
-- Filter ZLIB is
ON
CMake Warning at CMakeFilters.cmake:90 (find_package):
Could NOT
find a package configuration file provided by "SZIP" with any of
the
following names:
SZIPConfig.cmake
szip-config.cmake
ADD THE
INSTALLATION PREFIX OF "SZIP" TO CMAKE_PREFIX_PATH OR SET
"SZIP_DIR" to
a directory containing one of the above files. If "SZIP"
provides a
separate development package or SDK, be sure it has been
installed.
--
Filter SZIP is ON

But HDF5 COMPILES FINALLY ?!
[ 0%] Built target
H5detect
[ 0%] Built target H5make_libsettings
[ 36%] Built target
hdf5
...
[ 99%] Built target perf_meta
[100%] Built target
zip_perf

Note : this is because of the error messages (configure) that
I added $1/share/cmake to CMAKE_PREFIX_PATH

Can somebody explain me
that ?!... This looks like black magic to me...

Franck

Note : my
understanding is that $1/share/cmake should NOT be added to
CMAKE_PREFIX_PATH.
~> man cmake
CMAKE_PREFIX_PATH
Path used for
searching by FIND_XXX(), with appropriate suffixes added.
Specifies a
path which will be used by the FIND_XXX() commands. IT CONTAINS THE
"BASE" DIRECTORIES, the FIND_XXX() commands append appropriate
subdirectories
to the base directories. So FIND_PROGRAM() ADDS /BIN to
each of the directories in the path, FIND_LIBRARY() APPENDS /LIB to each
of the directories, and
FIND_PATH() and FIND_FILE() append /include .
By default it is empty, it is intended to be set by the project. See
also CMAKE_SYSTEM_PREFIX_PATH,
CMAKE_INCLUDE_PATH, CMAKE_LIBRARY_PATH,
CMAKE_PROGRAM_PATH.

Le 2015-10-12 18:57, Allen Byrne a écrit :

Franck,

You are correct that the standard zlib does not provide

cmake compiled

binaries. We created the tarballs so that we could

build the szip/zlib

libararies with the same options as the

library.

We do test with the "point to the system installed libs"

option -

AFAIK, there
are no reported problems.

Well, the

options look correct. The ZSIP/ZLIB_EXPORT_LIBRARIES in the link

line

is very strange. Where could that be coming from instead of the actual

name you supplied.
It is possible that something got confused in

the cmake files -

because those
are names of variables used within

our cmake-ified szip/zlib tarballs.

Allen

On Monday, October 12, 2015 06:22:26 PM houssen wrote:

Hello,

My understanding is

that HDF5_ALLOW_EXTERNAL_SUPPORT should not be used

(and defaults to

NO) according to the doc : I tried to set it anyway.

Also, on Ubuntu

when I "sudo apt-get install" zlib, it seems I get an

autotools

install, so CMake does not find the zlib install (missing

Find*.cmake): this is why I tried to build from source and install
ZLib

/ SZip (I use ZLIB / SZIP tarballs provided by

www.hdfgroup.org/ftp/HDF5/releases/... as they have been patched to

create Find*.cmake files at install time).

My last try (called

within a bash script where $1 is a path to the

final install where

libz and libszip are already installed) :

export

CMAKE_PREFIX_PATH="$1:$1/share/cmake:$CMAKE_PREFIX_PATH"

export

CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"

export

CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"

export

CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"

export

CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"

cmake

-DCMAKE_INSTALL_PREFIX:PATH=$1

-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON

-DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON

-DHDF_ENABLE_LARGE_FILE:BOOL=ON

-DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="NO"

-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON

-DZLIB_INCLUDE_DIR:PATH="$1/include"

-DZLIB_LIBRARY:FILEPATH="$1/lib/libz.so"

-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON

-DSZIP_INCLUDE_DIR:PATH="$1/include"

-DSZIP_LIBRARY:FILEPATH="$1/lib/libszip.so" ..

Note : I use now

-DZLIB_LIBRARY:FILEPATH / -DSZIP_LIBRARY:FILEPATH

according to the

doc.

Gives me this :
[ 36%] Linking C shared library

../bin/libhdf5.so

/usr/bin/ld.bfd.real: can't find

-lZLIB_EXPORT_LIBRARIES

/usr/bin/ld.bfd.real: can't find

-lSZIP_EXPORT_LIBRARIES

/usr/bin/ld.bfd.real: can't find

-lZLIB_EXPORT_LIBRARIES

/usr/bin/ld.bfd.real: can't find

-lSZIP_EXPORT_LIBRARIES

I miss something but can't figure our what

?... I guess options are

upsetting each other...

Franck

Le 2015-10-12 15:56, Allen Byrne a écrit :

> Franck,
>
>

HDF5_ALLOW_EXTERNAL_SUPPORT is not a BOOL, it is a STRING "NO,

>
>

SVN, TGZ".

>
> Allen
>
> On Sunday, October 11, 2015 06:23:49 PM houssen wrote:
>> Hello,
>>
>> How to build HDF5

(1.8.15) with ZLib and SZIP (on Ubuntu-14.04) ?

>>
>> With this

(called within a bash script where $1 is a path to the

>> final
>>

install where libz and libszip are already installed) :

>> export

CMAKE_PREFIX_PATH="$1/share/cmake:$CMAKE_PREFIX_PATH"

>> export

CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"

>> export

CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"

>> export

CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"

>> export

CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"

>> cmake

-DCMAKE_INSTALL_PREFIX:PATH=$1

>>

-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON

>>
>>
>> -DHDF5_BUILD_HL_LIB:BOOL=ON

-DHDF5_BUILD_TOOLS:BOOL=ON

>>
>>

-DHDF_ENABLE_LARGE_FILE:BOOL=ON

>>
>>
>>
>>

-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON

>>
>>

-DZLIB_INCLUDE_DIR:PATH="$1/include"

>>

-DZLIB_LIBRARY:PATH="$1/lib/libz.so"

>>
>>
>>
>>

-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON

>>
>>

-DSZIP_INCLUDE_DIR:PATH="$1/include"

>>

-DSZIP_LIBRARY_RELEASE:PATH="$1/lib/libszip.so"

>>

-DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON ..

>> I got this :
>> [ 0%]

Linking C shared library ../bin/libhdf5.so

>> /usr/bin/ld.bfd.real:

can't find -lZLIB_EXPORT_LIBRARIES

>> /usr/bin/ld.bfd.real: can't

find -lSZIP_EXPORT_LIBRARIES

>> /usr/bin/ld.bfd.real: can't find

-lZLIB_EXPORT_LIBRARIES

>> /usr/bin/ld.bfd.real: can't find

-lSZIP_EXPORT_LIBRARIES

>> collect2: error: ld returned 1 exit

status

>>
>> With this :
>> cmake

-DCMAKE_INSTALL_PREFIX:PATH=$1

>>

-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON

>>
>>
>> -DHDF5_BUILD_HL_LIB:BOOL=ON

-DHDF5_BUILD_TOOLS:BOOL=ON

>>
>>

-DHDF_ENABLE_LARGE_FILE:BOOL=ON

>>
>>
>>
>>

-DHDF5_ALLOW_EXTERNAL_SUPPORT:BOOL=ON

>>
>>

-DZLIB_USE_EXTERNAL:BOOL=ON

>> -DSZIP_USE_EXTERNAL:BOOL=ON
>>

>>
>> -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
>>
>>

-DZLIB_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/s

rc/ ZLib.tar.gz"
>>
>> -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON

>> -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON
>>
>>

-DSZIP_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/s

rc/ SZip.tar.gz" ..
>> I got this :
>>
>> CMake Error at

CMakeFilters.cmake:66 (message):

>> ZLib is Required for ZLib support

in HDF5

>>
>> Franck
>>
>>
>>

_______________________________________________

>> Hdf-forum is for

HDF software users discussion.

>> Hdf-forum@lists.hdfgroup.org

>>

http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Twitter: https://twitter.com/hdf5

_______________________________________________

Hdf-forum is for HDF

software users discussion.

Hdf-forum@lists.hdfgroup.org

http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org

Twitter: https://twitter.com/hdf5

Hello,

How to build HDF5 (1.8.15) with ZLib and SZIP (on Ubuntu-14.04) ?

With this (called within a bash script where $1 is a path to the final install where libz and libszip are already installed) :
export CMAKE_PREFIX_PATH="$1/share/cmake:$CMAKE_PREFIX_PATH"
export CMAKE_MODULE_PATH="$1/share/cmake:$CMAKE_MODULE_PATH"
export CMAKE_INCLUDE_PATH="$1/include:$CMAKE_INCLUDE_PATH"
export CMAKE_LIBRARY_PATH="$1/lib:$CMAKE_LIBRARY_PATH"
export CMAKE_PROGRAM_PATH="$1/bin:$CMAKE_PROGRAM_PATH"
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1 -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON -DHDF_ENABLE_LARGE_FILE:BOOL=ON \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_INCLUDE_DIR:PATH="$1/include" -DZLIB_LIBRARY:PATH="$1/lib/libz.so" \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON -DSZIP_INCLUDE_DIR:PATH="$1/include" -DSZIP_LIBRARY_RELEASE:PATH="$1/lib/libszip.so" -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON ..
I got this :
[ 0%] Linking C shared library ../bin/libhdf5.so
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lZLIB_EXPORT_LIBRARIES
/usr/bin/ld.bfd.real: can't find -lSZIP_EXPORT_LIBRARIES
collect2: error: ld returned 1 exit status

With this :
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1 -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DBUILD_SHARED_LIBS:BOOL=ON \
       -DHDF5_BUILD_HL_LIB:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON -DHDF_ENABLE_LARGE_FILE:BOOL=ON \
       -DHDF5_ALLOW_EXTERNAL_SUPPORT:BOOL=ON -DZLIB_USE_EXTERNAL:BOOL=ON -DSZIP_USE_EXTERNAL:BOOL=ON \
       -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
      -DZLIB_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/src/ZLib.tar.gz" \
       -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=ON -DHDF5_ENABLE_SZIP_ENCODING:BOOL=ON -DSZIP_URL:PATH="https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/src/SZip.tar.gz" ..
I got this :
CMake Error at CMakeFilters.cmake:66 (message):
    ZLib is Required for ZLib support in HDF5

Franck

Hi Franck,

···

On Sun, Oct 11, 2015 at 12:14 AM, houssen <houssen@ipgp.fr> wrote:

I got this :
CMake Error at CMakeFilters.cmake:66 (message):
   ZLib is Required for ZLib support in HDF5

I've never done what you're doing but this error message seems to
indicate that you need to install the zlib library. I *think* under
Ubuntu (for example), you would need the zlib1g library
[http://packages.ubuntu.com/search?keywords=zlib1g]. You will need to
check for whatever distribution you're using.

Ray

Just a minor correction, under Ubuntu you need: zlib1g-dev

Greetings, Richard

···

On 12/10/15 16:24, Raymond Wan wrote:

Hi Franck,

On Sun, Oct 11, 2015 at 12:14 AM, houssen <houssen@ipgp.fr> wrote:

I got this :
CMake Error at CMakeFilters.cmake:66 (message):
    ZLib is Required for ZLib support in HDF5

I've never done what you're doing but this error message seems to
indicate that you need to install the zlib library. I *think* under
Ubuntu (for example), you would need the zlib1g library
[http://packages.ubuntu.com/search?keywords=zlib1g]. You will need to
check for whatever distribution you're using.

Ray

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5