Hi everyone,
I’m having trouble creating static libraries for FORTRAN to compile programs with HDF5 on Windows (using either the terminal or VS2022). While I had success on Linux, Windows has been quite challenging for me.
Here’s what I’ve done so far, following the instructions in the “INSTALL_CMake.txt” file:
- Created a directory for HDF5.
- Downloaded the necessary files:
CTestScript.cmake
,HDF5config.cmake
,HDF5options.cmake
,zlib-1.3.tar.gz
,libaec-1.0.6.tar.gz
, andhdf5-1.14.4-3.zip
. - Modified
HDF5options.cmake
to enable FORTRAN. - Opened the “Intel oneAPI command prompt for Intel 64 for Visual Studio 2022”.
- Executed the following command:
ctest -S HDF5config.cmake,BUILD_GENERATOR=VS202264 -C Release -VV -O hdf5.log
The configuration went smoothly, generating a BUILD
folder containing a zip file. After unzipping, I found the FORTRAN includes in the mod
folder and the static libraries in the lib\static
folder.
In VS2022, I created a new project and provided the paths for the includes and static libraries as instructed in the “USING_HDF5_VS.txt” file. However, when I tried to compile (in both release and debug modes), I encountered errors during the linking stage.
I also tried manually compiling the code in the terminal without success. The object files are generated (for both debug and release options), but linking the static libraries results in several errors.
I’m completely lost at this point. I’ve searched many sources and forums, found similar issues, but no solutions that work for me.
Here are some of my attempts and the errors:
Compiling stage:
Using ifx:
For the compiling stage, I was able to create the object file without any problems…
Now for the linking stage:
Using ifx:
here are the error…
linkingError.txt (66.6 KB)
Using ifort, same error from ifx… I tried both compilers because I was worried that I build with the wrong compiler… And I did not find any options to set the preferable compiler.
Also tried to combine all the static libraries provided… No success…
Any help or suggestions would be greatly appreciated!
Ivan