Dolfin python interface cannot find -lhdf5-shared
Hi there,
I am in the process of installing the latest “master” branch (ec57db53f2b13f1768214829e8b4f80fc32205cf) which seems to compile and install fine, and reports the message:
-- Found HDF5: hdf5-shared (found version "1.11.6") found components: C
When I try to install the python interface, I get the error:
[100%] Linking CXX shared library ../lib.linux-x86_64-3.7-pydebug/dolfin/cpp.cpython-37dm-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lhdf5-shared
I have HDF5 installed in a non-standard location, and the pkgconfig file dolfin/lib/pkgconfig/dolfin.pc
contains the correct hdf5 directory, but -lhdf5-shared
is not listed in the Libs:
section.
I am no CMake expert, but if I add the line find_package(HDF5 COMPONENTS C)
before the pybind_add_module
command and target_link_libraries(cpp PUBLIC ${HDF5_C_LIBRARIES})
afterwards, hdf5 is linked properly and I can import the package.
Thanks,
Evan
Comments (1)
-
reporter - Log in to comment
UPDATE:
Running cmake with the flag
-D DOLFIN_ENABLE_HDF5=true
after completely removing my build of HDF5 and installinglibhdf5-mpich-dev
as suggested by the dev-env dockerfile will produce the error:if the environment variable
$HDF5_DIR
is set. Removing this environment variable and running cmake again produces:and dolfin compiles correctly.
I am not sure exactly what the deal is with HDF5, perhaps this is an issue for their working group, but I believe it would be preferable to not check for environment variables and instead rely on the user supplying
-DHDF5_ROOT
flags to cmake.-E