geospace-code / h5fortran

Lightweight HDF5 polymorphic Fortran: h5write() h5read()
https://geospace-code.github.io/h5fortran
BSD 3-Clause "New" or "Revised" License
99 stars 23 forks source link

Compile error: MingW #8

Closed nyckmaia closed 3 years ago

nyckmaia commented 3 years ago

I'm trying to build this library using CMake and MingW Makefiles.

cmake -G "MinGW Makefiles" ..
-- The C compiler identification is GNU 8.1.0
-- The Fortran compiler identification is GNU 8.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Qt/Tools/mingw810_64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Qt/Tools/mingw810_64/bin/gfortran.exe - skipped
-- Checking whether C:/Qt/Tools/mingw810_64/bin/gfortran.exe supports Fortran 90
-- Checking whether C:/Qt/Tools/mingw810_64/bin/gfortran.exe supports Fortran 90 - yes
-- Performing Test f18flag
-- Performing Test f18flag - Success
-- Performing Test f2018impnone
-- Performing Test f2018impnone - Success
-- Found HDF5: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib (found version "") found components: Fortran HL
-- Found SZIP: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libszip.lib
-- Found ZLIB: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libzlib.lib (found version "1.2.11")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- HDF5 include: C:/Program Files/HDF_Group/HDF5/1.12.0/include/static
-- HDF5 library: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_hl_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_hl.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;SZIP::SZIP;ZLIB::ZLIB;Threads::Threads
-- Performing Test HDF5_compiles_ok
-- Performing Test HDF5_compiles_ok - Failed
-- Performing Test HDF5_runs_ok
-- Performing Test HDF5_runs_ok - Failed
-- h5fortran: HDF5 not working
CMake Error at CMakeLists.txt:25 (message):

-- Configuring incomplete, errors occurred!
See also "C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeError.log".

How can I fix it?

My system:

Here below is my CMakeError log:

Performing Fortran SOURCE FILE Test HDF5_compiles_ok failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_4c5bb/fast && C:/msys64/mingw64/bin/mingw32-make.exe  -f CMakeFiles/cmTC_4c5bb.dir/build.make CMakeFiles/cmTC_4c5bb.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_4c5bb.dir/src.f90.obj
/C/msys64/mingw64/bin/gfortran.exe -DHDF5_compiles_ok @CMakeFiles/cmTC_4c5bb.dir/includes_Fortran.rsp -fimplicit-none -std=f2018  -c /C/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp/src.f90 -o CMakeFiles/cmTC_4c5bb.dir/src.f90.obj
f951.exe: Fatal Error: Reading module 'C:/Program Files/HDF_Group/HDF5/1.12.0/include/static/hdf5.mod' at line 1 column 2: Unexpected EOF
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_4c5bb.dir/build.make:86: CMakeFiles/cmTC_4c5bb.dir/src.f90.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_4c5bb/fast] Error 2

Source file was:
program test_minimal

use hdf5, only : HID_T, HSIZE_T, H5_INTEGER_KIND, h5kind_to_type, h5open_f, h5close_f, h5fclose_f, h5fcreate_f, H5F_ACC_TRUNC_F
use h5lt, only : h5ltmake_dataset_f

implicit none (type, external)

integer :: ierr, p
integer(HID_T) :: lid
character(:), allocatable :: filename
character(256) :: argv
integer :: i, l

call get_command_argument(1, argv, status=i)
if (i /= 0) call get_environment_variable("BINDIR", argv, length=l, status=i)
if (i /= 0 .or. l==0) argv = '.'

filename = trim(argv) // '/test_minimal.h5'
print *, 'test path: ', filename

p = 42

call h5open_f(ierr)
if (ierr /= 0) error stop 'minimal: could not open hdf5 library'

call h5fcreate_f(filename, H5F_ACC_TRUNC_F, lid, ierr)
if (ierr/=0) error stop 'minimal: could not create file'
print *, 'minimal: created '//filename

call h5ltmake_dataset_f(lid, "foo", rank(p), shape(p, kind=HSIZE_T), h5kind_to_type(kind(p),H5_INTEGER_KIND), p, ierr)
if (ierr/=0) error stop 'minimal: could not create dataset foo'
print *, 'minimal: created variable'

call h5fclose_f(lid, ierr)
if (ierr/=0) error stop 'minimal: could not close file'
print *, 'minimal: closed '//filename

call h5close_f(ierr)
if (ierr /= 0) error stop 'could not close hdf5 library'

end program

Performing Fortran SOURCE FILE Test HDF5_runs_ok failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_97b9c/fast && C:/msys64/mingw64/bin/mingw32-make.exe  -f CMakeFiles/cmTC_97b9c.dir/build.make CMakeFiles/cmTC_97b9c.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_97b9c.dir/src.f90.obj
/C/msys64/mingw64/bin/gfortran.exe -DHDF5_runs_ok @CMakeFiles/cmTC_97b9c.dir/includes_Fortran.rsp -fimplicit-none -std=f2018  -c /C/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp/src.f90 -o CMakeFiles/cmTC_97b9c.dir/src.f90.obj
f951.exe: Fatal Error: Reading module 'C:/Program Files/HDF_Group/HDF5/1.12.0/include/static/hdf5.mod' at line 1 column 2: Unexpected EOF
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_97b9c.dir/build.make:86: CMakeFiles/cmTC_97b9c.dir/src.f90.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_97b9c/fast] Error 2

...and run output:

Return value: 1
Source file was:
program test_minimal

use hdf5, only : HID_T, HSIZE_T, H5_INTEGER_KIND, h5kind_to_type, h5open_f, h5close_f, h5fclose_f, h5fcreate_f, H5F_ACC_TRUNC_F
use h5lt, only : h5ltmake_dataset_f

implicit none (type, external)

integer :: ierr, p
integer(HID_T) :: lid
character(:), allocatable :: filename
character(256) :: argv
integer :: i, l

call get_command_argument(1, argv, status=i)
if (i /= 0) call get_environment_variable("BINDIR", argv, length=l, status=i)
if (i /= 0 .or. l==0) argv = '.'

filename = trim(argv) // '/test_minimal.h5'
print *, 'test path: ', filename

p = 42

call h5open_f(ierr)
if (ierr /= 0) error stop 'minimal: could not open hdf5 library'

call h5fcreate_f(filename, H5F_ACC_TRUNC_F, lid, ierr)
if (ierr/=0) error stop 'minimal: could not create file'
print *, 'minimal: created '//filename

call h5ltmake_dataset_f(lid, "foo", rank(p), shape(p, kind=HSIZE_T), h5kind_to_type(kind(p),H5_INTEGER_KIND), p, ierr)
if (ierr/=0) error stop 'minimal: could not create dataset foo'
print *, 'minimal: created variable'

call h5fclose_f(lid, ierr)
if (ierr/=0) error stop 'minimal: could not close file'
print *, 'minimal: closed '//filename

call h5close_f(ierr)
if (ierr /= 0) error stop 'could not close hdf5 library'

end program
scivision commented 3 years ago

It looks like there's two issues:

  1. please git pull in your "h5fortran/" directory--h5fortran will now autobuild the HDF5 library if not found or incompatible
  2. It appears you're using a Visual Studio HDF5 download from HDF Group. This is incompatible with MinGW. However, doing git pull will autobuild HDF5 when this issue is detected.
scivision commented 3 years ago

Side note: Since you have CMake >= 3.15, you can optionally set Windows environment variable CMAKE_GENERATOR with value MinGW Makefiles. If that is done, you won't have to type -G "MinGW Makefiles" for your projects.

scivision commented 3 years ago

The CMakeError.log you posted includes a clue- the .mod file is incompatible with Gfortran. The end result is the same as in my prior comments--git pull and you'll get the autobuild HDF5 updates.

nyckmaia commented 3 years ago

Thank you @scivision !!

scivision commented 3 years ago

Yes depending on your computer, HDF5 will take an extra minute or two to build, but that's easier than users having to fix HDF5 linkage issues manually. In our work, we regularly switch between multiple compilers on the same system, so rather than tracking umpteen compiler-HDF5 directories, we just autobuild HDF5.

nyckmaia commented 3 years ago

Almost there... could you help me again?

cmake -G "MSYS Makefiles" .. -DCMAKE_MAKE_PROGRAM=C:\msys64\mingw64\bin\mingw32-make.exe
-- The C compiler identification is GNU 10.1.0
-- The Fortran compiler identification is GNU 10.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/msys64/mingw64/bin/gfortran.exe - skipped
-- Checking whether C:/msys64/mingw64/bin/gfortran.exe supports Fortran 90
-- Checking whether C:/msys64/mingw64/bin/gfortran.exe supports Fortran 90 - yes
-- Performing Test f18flag
-- Performing Test f18flag - Success
-- Performing Test f2018impnone
-- Performing Test f2018impnone - Success
-- Found HDF5: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib (found version "") found components: Fortran HL
-- HDF5 include: C:/Program Files/HDF_Group/HDF5/1.12.0/include/static
-- HDF5 library: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_hl_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_hl.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib
-- Looking for H5_HAVE_FILTER_SZIP
-- Looking for H5_HAVE_FILTER_SZIP - not found
-- Looking for H5_HAVE_FILTER_DEFLATE
-- Looking for H5_HAVE_FILTER_DEFLATE - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HDF5_compiles_ok
-- Performing Test HDF5_compiles_ok - Failed
CMake Error at cmake/zlib_setup.cmake:26 (file):
  file failed to create symbolic link
  'C:/Users/VM/Desktop/h5fortran/build/ZLIBproj-prefix/src/ZLIBproj-build/zlib.h':
  operation not permitted
Call Stack (most recent call first):
  cmake/build_hdf5.cmake:26 (include)
  cmake/hdf5.cmake:151 (include)
  CMakeLists.txt:32 (include)

-- h5fortran: HDF5 autobuild
-- Found Python3: C:/Python38/python.exe (found version "3.8.5") found components: Interpreter
-- The following features have been enabled:

 * AutoHDF5, auto-build HDF5

-- The following OPTIONAL packages have been found:

 * Threads, the system threads library
 * Python3

-- The following REQUIRED packages have been found:

 * HDF5, fast, versatile file I/O format, <https://hdfgroup.org/>

-- Configuring incomplete, errors occurred!
See also "C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeError.log".

@scivision UPDATE 1

Here is my Error log:

Determining if the H5_HAVE_FILTER_SZIP exist failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_ec49d/fast && C:/msys64/mingw64/bin/mingw32-make.exe  -f CMakeFiles/cmTC_ec49d.dir/build.make CMakeFiles/cmTC_ec49d.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_ec49d.dir/CheckSymbolExists.c.obj
/C/msys64/mingw64/bin/gcc.exe  @CMakeFiles/cmTC_ec49d.dir/includes_C.rsp  -o CMakeFiles/cmTC_ec49d.dir/CheckSymbolExists.c.obj -c /C/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: H5pubconf.h: No such file or directory
    2 | #include <H5pubconf.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_ec49d.dir/build.make:86: CMakeFiles/cmTC_ec49d.dir/CheckSymbolExists.c.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_ec49d/fast] Error 2

File C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <H5pubconf.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef H5_HAVE_FILTER_SZIP
  return ((int*)(&H5_HAVE_FILTER_SZIP))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Determining if the H5_HAVE_FILTER_DEFLATE exist failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_7fa2f/fast && C:/msys64/mingw64/bin/mingw32-make.exe  -f CMakeFiles/cmTC_7fa2f.dir/build.make CMakeFiles/cmTC_7fa2f.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_7fa2f.dir/CheckSymbolExists.c.obj
/C/msys64/mingw64/bin/gcc.exe  @CMakeFiles/cmTC_7fa2f.dir/includes_C.rsp  -o CMakeFiles/cmTC_7fa2f.dir/CheckSymbolExists.c.obj -c /C/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: H5pubconf.h: No such file or directory
    2 | #include <H5pubconf.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_7fa2f.dir/build.make:86: CMakeFiles/cmTC_7fa2f.dir/CheckSymbolExists.c.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_7fa2f/fast] Error 2

File C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <H5pubconf.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef H5_HAVE_FILTER_DEFLATE
  return ((int*)(&H5_HAVE_FILTER_DEFLATE))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Performing Fortran SOURCE FILE Test HDF5_compiles_ok failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_e3ea2/fast && C:/msys64/mingw64/bin/mingw32-make.exe  -f CMakeFiles/cmTC_e3ea2.dir/build.make CMakeFiles/cmTC_e3ea2.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_e3ea2.dir/src.f90.obj
/C/msys64/mingw64/bin/gfortran.exe -DHDF5_compiles_ok @CMakeFiles/cmTC_e3ea2.dir/includes_Fortran.rsp -fimplicit-none -std=f2018  -c /C/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/src.f90 -o CMakeFiles/cmTC_e3ea2.dir/src.f90.obj
f951.exe: Fatal Error: Reading module 'C:/Program Files/HDF_Group/HDF5/1.12.0/include/static/hdf5.mod' at line 1 column 2: Unexpected EOF
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_e3ea2.dir/build.make:86: CMakeFiles/cmTC_e3ea2.dir/src.f90.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_e3ea2/fast] Error 2

Source file was:
program test_minimal
use hdf5, only : h5open_f, h5close_f
use h5lt, only : h5ltmake_dataset_f
implicit none (type, external)
integer :: i
call h5open_f(i)
if (i /= 0) error stop 'could not open hdf5 library'
call h5close_f(i)
if (i /= 0) error stop
end
scivision commented 3 years ago

This is an issue where Windows by default does not allow symbolic links--this is an operating system issue. However, zlib.h is small enough, we can just copy it on windows. I will make this change soon.

nyckmaia commented 3 years ago

Ok! Please let me know when this feature is already done in the H5Fortran library!

Thank you!

scivision commented 3 years ago

Thanks I tried to fix this in 924ecc7 so just git pull and try again. Thanks

nyckmaia commented 3 years ago

I got the update...here is the new result:

 cmake -G "MSYS Makefiles" .. -DCMAKE_MAKE_PROGRAM=C:\msys64\mingw64\bin\mingw32-make.exe
-- The C compiler identification is GNU 10.1.0
-- The Fortran compiler identification is GNU 10.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/msys64/mingw64/bin/gfortran.exe - skipped
-- Checking whether C:/msys64/mingw64/bin/gfortran.exe supports Fortran 90
-- Checking whether C:/msys64/mingw64/bin/gfortran.exe supports Fortran 90 - yes
-- Performing Test f18flag
-- Performing Test f18flag - Success
-- Performing Test f2018impnone
-- Performing Test f2018impnone - Success
-- Found HDF5: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib (found version "") found components: Fortran HL
-- HDF5 include: C:/Program Files/HDF_Group/HDF5/1.12.0/include/static
-- HDF5 library: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_hl_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_hl.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib
-- Looking for H5_HAVE_FILTER_SZIP
-- Looking for H5_HAVE_FILTER_SZIP - not found
-- Looking for H5_HAVE_FILTER_DEFLATE
-- Looking for H5_HAVE_FILTER_DEFLATE - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HDF5_compiles_ok
-- Performing Test HDF5_compiles_ok - Failed
CMake Error at cmake/zlib_setup.cmake:29 (file):
  file COPY given no DESTINATION
Call Stack (most recent call first):
  cmake/build_hdf5.cmake:26 (include)
  cmake/hdf5.cmake:151 (include)
  CMakeLists.txt:32 (include)

-- h5fortran: HDF5 autobuild
-- Found Python3: C:/Python38/python.exe (found version "3.8.5") found components: Interpreter
-- The following features have been enabled:

 * AutoHDF5, auto-build HDF5

-- The following OPTIONAL packages have been found:

 * Threads, the system threads library
 * Python3

-- The following REQUIRED packages have been found:

 * HDF5, fast, versatile file I/O format, <https://hdfgroup.org/>

-- Configuring incomplete, errors occurred!
See also "C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeError.log".

Here is the Error log:

Determining if the H5_HAVE_FILTER_SZIP exist failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_b2d1c/fast && C:/msys64/mingw64/bin/mingw32-make.exe  -f CMakeFiles/cmTC_b2d1c.dir/build.make CMakeFiles/cmTC_b2d1c.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b2d1c.dir/CheckSymbolExists.c.obj
/C/msys64/mingw64/bin/gcc.exe  @CMakeFiles/cmTC_b2d1c.dir/includes_C.rsp  -o CMakeFiles/cmTC_b2d1c.dir/CheckSymbolExists.c.obj -c /C/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: H5pubconf.h: No such file or directory
    2 | #include <H5pubconf.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_b2d1c.dir/build.make:86: CMakeFiles/cmTC_b2d1c.dir/CheckSymbolExists.c.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_b2d1c/fast] Error 2

File C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <H5pubconf.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef H5_HAVE_FILTER_SZIP
  return ((int*)(&H5_HAVE_FILTER_SZIP))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Determining if the H5_HAVE_FILTER_DEFLATE exist failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_f1985/fast && C:/msys64/mingw64/bin/mingw32-make.exe  -f CMakeFiles/cmTC_f1985.dir/build.make CMakeFiles/cmTC_f1985.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f1985.dir/CheckSymbolExists.c.obj
/C/msys64/mingw64/bin/gcc.exe  @CMakeFiles/cmTC_f1985.dir/includes_C.rsp  -o CMakeFiles/cmTC_f1985.dir/CheckSymbolExists.c.obj -c /C/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:2:10: fatal error: H5pubconf.h: No such file or directory
    2 | #include <H5pubconf.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_f1985.dir/build.make:86: CMakeFiles/cmTC_f1985.dir/CheckSymbolExists.c.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_f1985/fast] Error 2

File C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <H5pubconf.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef H5_HAVE_FILTER_DEFLATE
  return ((int*)(&H5_HAVE_FILTER_DEFLATE))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Performing Fortran SOURCE FILE Test HDF5_compiles_ok failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp

Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_0d772/fast && C:/msys64/mingw64/bin/mingw32-make.exe  -f CMakeFiles/cmTC_0d772.dir/build.make CMakeFiles/cmTC_0d772.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_0d772.dir/src.f90.obj
/C/msys64/mingw64/bin/gfortran.exe -DHDF5_compiles_ok @CMakeFiles/cmTC_0d772.dir/includes_Fortran.rsp -fimplicit-none -std=f2018  -c /C/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp/src.f90 -o CMakeFiles/cmTC_0d772.dir/src.f90.obj
f951.exe: Fatal Error: Reading module 'C:/Program Files/HDF_Group/HDF5/1.12.0/include/static/hdf5.mod' at line 1 column 2: Unexpected EOF
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_0d772.dir/build.make:86: CMakeFiles/cmTC_0d772.dir/src.f90.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_0d772/fast] Error 2

Source file was:
program test_minimal
use hdf5, only : h5open_f, h5close_f
use h5lt, only : h5ltmake_dataset_f
implicit none (type, external)
integer :: i
call h5open_f(i)
if (i /= 0) error stop 'could not open hdf5 library'
call h5close_f(i)
if (i /= 0) error stop
end
scivision commented 3 years ago

yes that was a mistake on my part. 4111cfe fixes this actually this time the command from h5fortran/ directory is:

git fetch
git reset origin/master --hard
scivision commented 3 years ago

alright another mistake. i need to try it on my PC here.

nyckmaia commented 3 years ago

@scivision thank you for your quick response... I will be waiting your command..

Thank you again!

scivision commented 3 years ago

It turns out I was using a hack instead of built-in CMake capabilities. I think it's actually fixed in 3fc0e25d47e41. It worked on my PC, waiting for CI to pass...

scivision commented 3 years ago

Thank for this helpful feedback, now I won't use hacks like this anymore. A good lesson learned.