LLNL / Silo

Mesh and Field I/O Library and Scientific Database
https://silo.llnl.gov
Other
25 stars 22 forks source link

Silo's autogen script cannot find the hdf5 library when hdf5 is built in Debug mode using CMake #369

Open Algiane opened 8 months ago

Algiane commented 8 months ago

Hello,

Thank you for providing the Silo library.

I have issue to build the release 4.11 of Silo with hdf5 capabilities when hdf5 is built in Debug mode using CMake: in this case, CMake appends the _debug postfix to the library name (so the produced library is named libhdf5_debug.[ so | dylib | a ...].

As the configure script of Silo searches for the hdf5 library, hdf5 is not founded and the build fails.

Additional informations:

Questions

markcmiller86 commented 8 months ago

I believe our transition to full CMake builds is not quite complete.

Is there any chance you can use the AutoTools build instead?

Regarding libhdf5.so vs libhdf5_debug.so (or whatever extension you have), that seems like an issue either in HDF5's CMake logic or in the way the HDF5 library was configured using CMake (or Autotools) as there is no reason it should be changing the name of the built/installed library.

If you have installed HDF5 yourself, can you create symlinks in the HDF5 install point to make a libhdf5.so that points to the libhdf5_debug.so?

Silo's Autotools build allows for hdf5.h and libhdf5.so to be in totally unrelated dirs but it does not allow for an HDF5 library file to be named anything other than libhdf5.so (or whatever extension you are using).

Algiane commented 8 months ago

Hello,

Thanks for your feedback.

I think that the use of a debug postfix in the library name is pretty standard with CMake because it allow to build both Release and Debug versions of a library into the same install directory and to package both versions using CPack (see the CMake documentation here or here or this discussion that is related to the use of a debug postfix into library names).

I have seen lot of projects that are using this convention (for example VTK, curl or vcpkg) so I have no hope that the hdf5 developpers will change this feature for me ;-).

The idea of a symbolic link isn't really feasible because it may break up the user's hdf5 installations (Release builds have already the libhdf5.so name and the debug postfix is here to allow to have both versions of libhdf5.so and libhdf5_debug.so in the same directory).

Best

markcmiller86 commented 8 months ago

see the CMake documentation here or here or this discussion that is related to the use of a debug postfix into library names

Well, there are other approaches to handling that including installing a debug version of the library at a different path as in /usr/local/lib/debug/libhdf5.so. The fact that VTK follows the same practice is not too surprising as both CMake and VTK are developed by KitWare.

And, one reference you mention is aimed at trying to install the same library in the same install point but with different features....in this case debugging enabled or not. But, why stop at debugging though? Why not install the same library but different versions or for different CPU architectures or with MPI enabled or how about combinations (MPI without debugging and MPI with debugging) etc. In all cases I have experience with, these are all handled by installing the same libxxx.so to a different install point, not changing the name of the installed library.

I believe this is how Spack operates when it installs different variants of the same library...different install points not differently named installed packages.

Now, as it turns out, the Silo library kinda sorta does install differently named packages. But, its install logic has always done this. From the first time HDF5 was introduced, Silo installs libsilo.so (without HDF5) and libsiloh5.so (with HDF5) to the same install point. But that is because we made a choice at the time HDF5 was introduced to Silo to name the installed Silo library with HDF5 siloh5 and not silo. This has in fact lead to issues for users maintaining make files that build with either silo installation. That is a different situation IMHO because, as I mention, Silo with HDF5 was chosen to be named siloh5, a differently named installed package.

markcmiller86 commented 8 months ago

Also, quoting from the first ref you offer,...

By default, CMake's model is that a build directory only contains a single configuration, be it Debug, Release, MinSizeRel, or RelWithDebInfo.

Algiane commented 8 months ago

I understand: honnestly I have no opinion on the library naming convention (I am not expert in compilation, installation or packaging), I just wanted to point out that the postifx inside the hdf5 library name is not an error from the hdf5 developpers but a conscious choice. In consequence, it's unlikely that they'll rename their library if I open an issue.

On the other hand, current Silo's Autotools fail to find hdf5 library if it is build in Debug mode with CMake: hdf5 is unlikely to change their library name so if you are interested to maintain a full compatibility between hdf5 and Silo (it may not be the case), I think that it has to be done from the Silo side.

On another note, I agree that:

Anyways, from my side, it's a sticking point for compiling the TPLs for one of the projects I'm working on:

I hope to convince you that fixing this compatibility issue is in the interests of your user community (;-)). Do not hesitate to close this ticket if you think that it is useless to fix this.

Thanks again for you answers, Best