Linking issue with HDF5

Issue #90 new
Michael Greenburg created an issue

When I compile mshr without HDF5, everything goes buttery smooth, but when I use HDF5 (version 1.10.4) I get the following when I run CMake:

cmake -DCMAKE_INSTALL_PREFIX=$PFX -DMPFR_LIBRARIES=$MPFRLIB -DMPFR_INCLUDE_DIR=$MPFRINC -DEIGEN3_INCLUDE_DIR=$EIGENINC ..
...
[ Omitted for brevity ]
...
-- Configuring done
CMake Error at CMakeLists.txt:117 (add_library):
  Target "mshr" links to target "hdf5::hdf5-shared" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

This is using the latest stable branch (2018.1.0).

Something like '-lhdf5::hdf5-shared' as a linker argument seems odd, but I may be misunderstanding. Should I be using an older or newer HDF5, or giving CMake an argument that I'm not?

Comments (1)

  1. Michael Greenburg reporter

    I was able to work around the CMake error by building dolfin then mshr without HDF5, then building dolfin again with HDF5; when I do so, however, running python3 -c "import dolfin" results in:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "[PREFIX]/lib/python3.6/site-packages/dolfin/__init__.py", line 46, in <module>
        from .cpp.adaptivity import TimeSeries
    ImportError: cannot import name 'TimeSeries'
    

    When I comment out these three lines in dolfin's __init__.py:

    if has_hdf5():
        from .cpp.adaptivity import TimeSeries
        from .cpp.io import HDF5File
    

    ...import dolfin gives no errors. I followed the compilation instructions here, installing dolfin a second time with HDF5; are there any of those steps that I should be modifying, or is there anything I should do in addition?

  2. Log in to comment