Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
213 views
in Technique[技术] by (71.8m points)

Not able to link HDF5 path in CMake configuration

I'm trying to create make files of C++ code on a server doing

cmake ../

and I get the error

-- Could NOT find HDF5 (missing: HDF5_INCLUDE_DIRS) (found version "1.10.7")
CMake Error at src/CMakeLists.txt:180 (message):
  HDF5 support was requested, but no HDF5 library was found on this system

I have installed HDF5 in /home/directory/ so I have HDF5 include and library files in

/home/directory/include

/home/directory/lib

I've tried to add in CMakeLists.txt the following lines:

 set(HDF5_LIBRARIES "/home/directory/")

 set(HDF5_CXX_LIBRARIES "/home/directory/")

 set(HDF5_INCLUDE_DIRS "/home/directory/")

 set(HDF5_CXX_INCLUDE_DIRS "/home/directory/")

But still getting the error. I've also tried to export HDF5_ROOT=/home/directory/ without success.

The error come from the following lines in the code:

  if (HDF5_FOUND)
            target_include_directories(soft PUBLIC ${HDF5_INCLUDE_DIRS})
            target_link_libraries(soft PUBLIC ${HDF5_LIBRARIES})
    else (HDF5_FOUND)
            message(FATAL_ERROR "HDF5 support was requested, but no HDF5 library was found on this system")
    endif (HDF5_FOUND)

Any help?

Using CMake 3.19.3 and hdf5-1.10.7

question from:https://stackoverflow.com/questions/65938056/not-able-to-link-hdf5-path-in-cmake-configuration

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...