Compilation of HDF5 1.10.1 with MSYS and MiNGW

Hello Hdf5 community

I want to report a successful compilation of HDF5 1.10.1 with MSYS and MiNGW
I already have compiled HDF5 with MSYS and MiNGW without any trouble.
This time I had to update some files during compilation and installation.
These troubles occur with the use of Fortran.
These fixes could be integrated in CMakeLists.txt

Here is the command I have used, where I activate almost everything

tar -xzf hdf5-1.10.1.tar.gz
mkdir hdf5_build
cd hdf5_build
cmake \
    -Wno-dev \
    -DBUILD_SHARED_LIBS:BOOL=OFF \
    -DCMAKE_BUILD_TYPE:STRING=Release \
    -DHDF5_BUILD_HL_LIB:BOOL=ON \
    -DHDF5_BUILD_FORTRAN:BOOL=ON \
    -DHDF5_ENABLE_F2003:BOOL=ON \
    -DHDF5_BUILD_CPP_LIB:BOOL=ON \
    -DHDF5_BUILD_TOOLS:BOOL=ON \
    -DCMAKE_Fortran_FLAGS="-cpp" \
    -G"MSYS Makefiles" \
    -DCMAKE_INSTALL_PREFIX:PATH="C:/Program Files/HDF5_1_10_1__4_9_2" \
    ../hdf5-1.10.1
make install

I have some compilation problems with generated files that are reported in
points 1 and 2.
The 3rd point fixes an installation issue

1)
In file hdf5_build\H5config_f.inc, I had to remove line feeds in the
definition of H5_H5CONFIG_F_RKIND_SIZEOF

#define H5_H5CONFIG_F_RKIND_SIZEOF INTEGER, DIMENSION(1:num_rkinds) ::
rkind_sizeof = (/4
,8
,16
,16
/)

->

#define H5_H5CONFIG_F_RKIND_SIZEOF INTEGER, DIMENSION(1:num_rkinds) ::
rkind_sizeof = (/4,8,16,16/)

2)
In file hdf5_build\fortran\H5fort_type_defines.h, I had to remove line
feeds in the definition of H5_FORTRAN_INTEGER_KINDS_SIZEOF
C:\Users\jacquenot\Desktop\Config\

#define H5_FORTRAN_INTEGER_KINDS_SIZEOF {1
,2
,4
,8
,16
}

->

#define H5_FORTRAN_INTEGER_KINDS_SIZEOF {1,2,4,8,16}

3) Then while installing fortran files, CMake complained about not finding
some mod files. This is because they are generated in the wrong directory.

-- Installing: C:/Program
Files/HDF5_1_10_1__4_9_2/include/H5fortran_types.F90
CMake Error at fortran/src/cmake_install.cmake:41 (file):
  file INSTALL cannot find
"hdf5_build/bin/static/Release/h5fortran_types.mod".
Call Stack (most recent call first):
  fortran/cmake_install.cmake:32 (include)
  cmake_install.cmake:86 (include)

  CMake is searching for hdf5_build/bin/static/h5fortran_types.mod while it
is generated in hdf5_build/bin/static/Release/h5fortran_types.mod

I had to move all mod from hdf5_build/bin/static/Release to
hdf5_build/bin/static

I then run make install again, and everything could be installed.

Hi,

Thank you for the feedback. Saved me a lot of time. It does work for me too.

Pascal

···

Le 23/05/2017 à 19:54, Guillaume Jacquenot a écrit :

Hello Hdf5 community

I want to report a successful compilation of HDF5 1.10.1 with MSYS and MiNGW
I already have compiled HDF5 with MSYS and MiNGW without any trouble.
This time I had to update some files during compilation and installation.
These troubles occur with the use of Fortran.
These fixes could be integrated in CMakeLists.txt

Here is the command I have used, where I activate almost everything

tar -xzf hdf5-1.10.1.tar.gz
mkdir hdf5_build
cd hdf5_build
cmake \
    -Wno-dev \
    -DBUILD_SHARED_LIBS:BOOL=OFF \
    -DCMAKE_BUILD_TYPE:STRING=Release \
    -DHDF5_BUILD_HL_LIB:BOOL=ON \
    -DHDF5_BUILD_FORTRAN:BOOL=ON \
    -DHDF5_ENABLE_F2003:BOOL=ON \
    -DHDF5_BUILD_CPP_LIB:BOOL=ON \
    -DHDF5_BUILD_TOOLS:BOOL=ON \
    -DCMAKE_Fortran_FLAGS="-cpp" \
    -G"MSYS Makefiles" \
    -DCMAKE_INSTALL_PREFIX:PATH="C:/Program Files/HDF5_1_10_1__4_9_2" \
    ../hdf5-1.10.1
make install

I have some compilation problems with generated files that are reported in points 1 and 2.
The 3rd point fixes an installation issue

1)
In file hdf5_build\H5config_f.inc, I had to remove line feeds in the definition of H5_H5CONFIG_F_RKIND_SIZEOF

#define H5_H5CONFIG_F_RKIND_SIZEOF INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/4
,8
,16
/)

->

#define H5_H5CONFIG_F_RKIND_SIZEOF INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/4,8,16,16/)

2)
In file hdf5_build\fortran\H5fort_type_defines.h, I had to remove line feeds in the definition of H5_FORTRAN_INTEGER_KINDS_SIZEOF
C:\Users\jacquenot\Desktop\Config\

#define H5_FORTRAN_INTEGER_KINDS_SIZEOF {1
,2
,4
,8
,16
}

->

#define H5_FORTRAN_INTEGER_KINDS_SIZEOF {1,2,4,8,16}

3) Then while installing fortran files, CMake complained about not finding some mod files. This is because they are generated in the wrong directory.

-- Installing: C:/Program Files/HDF5_1_10_1__4_9_2/include/H5fortran_types.F90
CMake Error at fortran/src/cmake_install.cmake:41 (file):
  file INSTALL cannot find
"hdf5_build/bin/static/Release/h5fortran_types.mod".
Call Stack (most recent call first):
  fortran/cmake_install.cmake:32 (include)
  cmake_install.cmake:86 (include)
  CMake is searching for hdf5_build/bin/static/h5fortran_types.mod while it is generated in hdf5_build/bin/static/Release/h5fortran_types.mod

I had to move all mod from hdf5_build/bin/static/Release to hdf5_build/bin/static

I then run make install again, and everything could be installed.

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5