H5Z-ZFP icon indicating copy to clipboard operation
H5Z-ZFP copied to clipboard

Using H5Z-ZFP static library

Open houjun opened this issue 2 years ago • 10 comments

Hi, I'm trying to include H5Z_ZFP static library to SW4. I'm able to compile ZFP (v1.0.0) and H5Z-ZFP (v1.1.0).

I added the following to SW4's CMakeList:

CMAKE_POLICY(SET CMP0028 NEW)
...
OPTION(USE_ZFP "Use ZFP compression." OFF)
IF(USE_ZFP)
    SET(H5Z_ZFP_USE_STATIC_LIBS ON)
    FIND_PACKAGE(H5Z_ZFP 1.1.0 CONFIG)
    ADD_DEFINITIONS(-DUSE_ZFP)
ENDIF (USE_ZFP)
...
IF(USE_ZFP)
    TARGET_LINK_LIBRARIES(sw4 PRIVATE h5z_zfp::h5z_zfp)
ENDIF (USE_ZFP)

But when I run the cmake command in SW4:

export H5Z_ZFP_DIR=/global/cfs/cdirs/m3354/tang/H5Z-ZFP-1.1.0/build/
cmake -DUSE_HDF5=ON -DUSE_ZFP=ON ..

I got the following error message:

-- Could NOT find H5Z_ZFP: missing: H5Z_ZFP_LIBRARY H5Z_ZFP_INCLUDE_DIR (found /global/cfs/cdirs/m3354/tang/H5Z-ZFP-1.1.0/build/install/lib/cmake/h5z_zfp/h5z_zfp-config.cmake (found suitable version "1.1.0", minimum required is "1.1.0"))
CMake Warning at CMakeLists.txt:78 (FIND_PACKAGE):
  Found package configuration file:

    /global/cfs/cdirs/m3354/tang/H5Z-ZFP-1.1.0/build/install/lib/cmake/h5z_zfp/h5z_zfp-config.cmake

  but it set H5Z_ZFP_FOUND to FALSE so package "H5Z_ZFP" is considered to be
  NOT FOUND.

-- Configuring done
CMake Error at CMakeLists.txt:167 (ADD_EXECUTABLE):
  Target "sw4" links to target "h5z_zfp::h5z_zfp" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

Any idea what is going on?

houjun avatar Sep 28 '22 18:09 houjun