ubuntucompiler-errorsfortranhdf5wsl-2

Cannot open module file 'hdf5.mod' for reading at (1): No such file or directory


I'm trying to install DAMASK on WSL2 (Ubuntu20.04)https://damask.mpie.de/bin/view/Installation/SpectralSolver, however, when I want to make spectral solver.

(base) admin@DESKTOP-FQ1FRPR:~/damask-2.0.3$ make spectral 

I met an error as follows,

Building Spectral Solver

Fortran Compiler Flags:
 -fopenmp -std=f2008ts -pedantic-errors -O2  -xf95-cpp-input -ffree-line-length-132 -
 fimplicit-none -fmodule-private -Wall -Wextra -Wcharacter-truncation -Wunderflow - 
 Wsuggest-attribute=pure -Wsuggest-attribute=noreturn -Wconversion-extra -Wimplicit- 
 procedure -Wno-unused-parameter -ffpe-summary=all  -fdefault-real-8 -fdefault-double-8   
 -I/home/fengyx/petsc/include -I/home/fengyx/petsc/arch-linux-c-opt/include

C Compiler Flags:
-O3 -DNDEBUG

Fortran Linker Command:
 /home/admin/petsc/arch-linux-c-opt/bin/mpif90 -Wall -ffree-line-length-0 -Wno-unused- 
 dummy-argument -g -O -fopenmp   -O2  -Wl,-undefined,dynamic_lookup <OBJECTS> -o 
 <TARGET> <LINK_LIBRARIES>  -L/home/admin/petsc/arch-linux-c-opt/lib -Wl,- 
 rpath,/home/admin/petsc/arch-linux-c-opt/lib -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/9 
 -L/usr/lib/gcc/x86_64-linux-gnu/9 -lpetsc -lHYPRE -lcmumps -ldmumps -lsmumps -lzmumps - 
 lmumps_common -lpord -lpthread -lscalapack -lspqr -lumfpack -lklu -lcholmod -lbtf - 
 lccolamd -lcolamd -lcamd -lamd -lsuitesparseconfig -lsuperlu -lsuperlu_dist -lml - 
 lfftw3_mpi -lfftw3 -lflapack -lfblas -lhdf5_hl -lhdf5 -lchaco -lparmetis -lmetis - 
 ltriangle -lm -lz -lstdc++ -ldl -lmpifort -lmpi -lgfortran -lgcc_s -lquadmath
-- Configuring done
-- Generating done
-- Build files have been written to: /home/admin/damask-2.0.3/build/spectral
[  1%] Built target PREC
[  3%] Built target C_ROUTINES
[  7%] Building Fortran object src/CMakeFiles/QUIT.dir/quit.f90.o
[  7%] Built target SYSTEM_ROUTINES
/home/admin/damask-2.0.3/src/quit.f90:29:5:

   29 |  use hdf5
      |     1
Fatal Error: Cannot open module file ‘hdf5.mod’ for reading at (1): No such file or directory
compilation terminated.
make[3]: *** [src/CMakeFiles/QUIT.dir/build.make:63: src/CMakeFiles/QUIT.dir/quit.f90.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:709: src/CMakeFiles/QUIT.dir/all] Error 2
make[1]: *** [Makefile:130: all] Error 2
make: *** [Makefile:10: spectral] Error 2

Could anyone provide some advices? I will owe my gratitude.


Solution

  • I am trying to install DAMASK and encountered the same issue. You need to manually install hdf5 from the source code on their page, with the correct compiler, as described in the damask instructions page and "install" text file supplied with hdf5, and correct options. Then reconfigure and remake PETSC with hdf5 folder pointed in configuration instead of --download-hdf5. Then at least this issue will be gone. (I am now struggling with the others).