Closed nyckmaia closed 3 years ago
It looks like there's two issues:
git pull
in your "h5fortran/" directory--h5fortran will now autobuild the HDF5 library if not found or incompatiblegit pull
will autobuild HDF5 when this issue is detected.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.
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.
Thank you @scivision !!
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.
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".
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
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.
Ok! Please let me know when this feature is already done in the H5Fortran library!
Thank you!
Thanks I tried to fix this in 924ecc7
so just git pull
and try again. Thanks
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
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
alright another mistake. i need to try it on my PC here.
@scivision thank you for your quick response... I will be waiting your command..
Thank you again!
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...
Thank for this helpful feedback, now I won't use hacks like this anymore. A good lesson learned.
I'm trying to build this library using CMake and MingW Makefiles.
How can I fix it?
My system:
Here below is my CMakeError log: