HDFGroup / hdf5

Official HDF5® Library Repository
https://www.hdfgroup.org/
Other
601 stars 243 forks source link

CMake build inconsistencies #4526

Open MarDiehl opened 4 months ago

MarDiehl commented 4 months ago

Describe the bug There are differences in the file layout between the CMake build and the autotools build The results obtained from autotools make more sense.

Expected behavior The file layout resulting from both build tools should be the same

Platform (please complete the following information)

Additional context Build instructions are:

    cmake -S hdf5-hdf5_1.14.4.2 \
        -B build \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DBUILD_STATIC_LIBS=OFF \
        -DCMAKE_BUILD_TYPE=Release \
        -DHDF5_BUILD_HL_LIB=ON \
        -DHDF5_BUILD_CPP_LIB=ON \
        -DHDF5_BUILD_FORTRAN=ON \
        -DHDF5_BUILD_JAVA=ON \
        -DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
        -DHDF5_ENABLE_SZIP_SUPPORT=ON \
        -DHDF5_ENABLE_SZIP_ENCODING=ON \
        -DUSE_LIBAEC=ON
    make -C build \
    cmake --install build
    cd  hdf5-hdf5_1.14.4.2
    ./configure \
        --prefix=/usr \
        --docdir=/usr/share/doc/hdf5/ \
        --with-examplesdir=/usr/share/doc/hdf5/examples/ \
        --disable-static \
        --disable-sharedlib-rpath \
        --enable-build-mode=production \
        --enable-hl \
        --enable-cxx \
        --enable-fortran \
        --enable-java \
        --with-pic \
        --with-zlib \
        --with-szlib
    make
    make install

With CMake, there is a folder mod in /usr that contains Fortran module files. Having module files in this folder is uncommon. Also, the example files in /usr/share/doc/hdf5 are missing when using CMake even though HDF5_BUILD_EXAMPLES is set to ON by default.

byrnHDF commented 4 months ago

With CMake, there is a folder mod in /usr that contains Fortran module files. Having module files in this folder is uncommon.

CMake provides more options for customizing then the Autotools builds.

The fortran mod files are binary objects. However the CMake build gives the option to rename the folder with HDF5_INSTALL_MODULE_DIR or copy either the shared or static mods to the include folder with HDF5_INSTALL_MOD_FORTRAN.

CMake default for HDF5_BUILD_EXAMPLES corresponds to default CMake convention.

MarDiehl commented 4 months ago

CMake default for HDF5_BUILD_EXAMPLES corresponds to default CMake convention.

Where can I find the examples? autotools installs them to /usr/share/doc/hdf5/examples/ but I can't find them there when using CMake.

The fortran mod files are binary objects. However the CMake build gives the option to rename the folder with HDF5_INSTALL_MODULE_DIR or copy either the shared or static mods to the include folder with HDF5_INSTALL_MOD_FORTRAN.

But what is the rational to have some in /usr/mod/shared (where I, as a Fortran developer, would never search for them) and others into the more common location /usr/include?

byrnHDF commented 4 months ago

Because with some compilers shared and static mod files are different, we allow you to choose.