make error NVfortran

Questions regarding the compilation of VASP on various platforms: hardware, compilers and libraries, etc.


Moderators: Global Moderator, Moderator

Locked
Message
Author
cristiana_ciobanu1
Newbie
Newbie
Posts: 5
Joined: Sat Dec 05, 2020 10:55 pm

make error NVfortran

#1 Post by cristiana_ciobanu1 » Tue May 10, 2022 6:29 am

Hi
I have an error when trying to install.
nvfortran -O1 -Mfixed -Mfree -c -o diolib.o diolib.f90
NVFORTRAN-F-0004-Unable to open MODULE file preclib.mod (diolib.F: 12)
NVFORTRAN/x86-64 Linux 22.3-0: compilation aborted


make.include and output here.
makefile.zip
You do not have the required permissions to view the files attached to this post.

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: make error NVfortran

#2 Post by andreas.singraber » Wed May 11, 2022 1:57 pm

Hello!

First, your makefile.include seems fine, I was able to compile the code correctly with your file and NVHPC 22.3.

Have you tried whether this is a reproducible error? If you clean up and compile again with

Code: Select all

make veryclean
make DEPS=1 -j
does the error persist? Maybe there is an issue with the makefile in src/lib in combination with your make executable, can you post the output of

Code: Select all

make --version
Thank you!

All the best,

Andreas Singraber

cristiana_ciobanu1
Newbie
Newbie
Posts: 5
Joined: Sat Dec 05, 2020 10:55 pm

Re: make error NVfortran

#3 Post by cristiana_ciobanu1 » Fri May 13, 2022 12:34 am

Hi Andreas,
Thanks for that, doing the very clean make and then rerunning it seemed to work.
But, when running

Code: Select all

make test
there seems to be a lot of error.
I have attached the testsuite log file.
Also make version is GNU Make 4.2.1
testsuite (2).zip
You do not have the required permissions to view the files attached to this post.

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: make error NVfortran

#4 Post by andreas.singraber » Fri May 13, 2022 5:32 am

Hello!

Good, I am glad that the build works now! However, I still wonder why this happened in the first place.. can you still post the output of make --version please? Maybe we can improve the makefile further. Thank you!

The testsuite log file shows that the mpirun command does not start because you tried to run it as root user. As the error message says this is strongly discouraged, so it is much more safe to run the testsuite as a normal user. I would suggest to copy the VASP directory to some user's home directory and execute the testsuite there while being logged in as the user. Do not forget to clean up the testsuite before you run it again: change to the testsuite directory and execute

Code: Select all

make cleantest
After that you should be able to run the testsuite normally.

All the best,
Andreas Singraber

cristiana_ciobanu1
Newbie
Newbie
Posts: 5
Joined: Sat Dec 05, 2020 10:55 pm

Re: make error NVfortran

#5 Post by cristiana_ciobanu1 » Mon May 16, 2022 5:33 am

Ok it is all working now, had some permission issues, that is why it was running as root.
Change the permissions on directories and can run make test successfully as user.

The make output is as follows:
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


Thanks for you help!

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: make error NVfortran

#6 Post by andreas.singraber » Mon May 16, 2022 7:28 am

Hello!

Ok great, thanks for the update and the make version information!

Best,
Andreas Singraber

cristiana_ciobanu1
Newbie
Newbie
Posts: 5
Joined: Sat Dec 05, 2020 10:55 pm

Re: make error NVfortran

#7 Post by cristiana_ciobanu1 » Wed May 18, 2022 5:13 am

Hi,
I have run into a hitch again. I wanted to add HDF5.
I edited to makefile.include file to add the path.
Again I ran

Code: Select all

make veryclean
make DEPS=1 =j
It compiled and seemed to run into an error when trying to do something with HDF5, again erroring on NVFORTRAN unable to open files.
I have attached the full output and makefile.include

Code: Select all

NVFORTRAN-F-0004-Unable to open MODULE file hdf5.mod (vhdf5_base.F: 6)
NVFORTRAN/x86-64 Linux 22.3-0: compilation aborted
make[2]: *** [makefile:166: vhdf5_base.o] Error 2
make[2]: *** Waiting for unfinished jobs....
NVFORTRAN-F-0004-Unable to open MODULE file hdf5.mod (vhdf5_base.F: 6)
NVFORTRAN/x86-64 Linux 22.3-0: compilation aborted
make[2]: *** [makefile:166: vhdf5_base.o] Error 2
make[2]: *** Waiting for unfinished jobs....
NVFORTRAN-F-0004-Unable to open MODULE file hdf5.mod (vhdf5_base.F: 6)
NVFORTRAN/x86-64 Linux 22.3-0: compilation aborted
make[2]: *** [makefile:166: vhdf5_base.o] Error 2
make[2]: *** Waiting for unfinished jobs....
cp: cannot stat 'vasp': No such file or directory
make[1]: *** [makefile:129: all] Error 1
make: *** [makefile:17: std] Error 2
make: *** Waiting for unfinished jobs....
cp: cannot stat 'vasp': No such file or directory
make[1]: *** [makefile:129: all] Error 1
make: *** [makefile:17: ncl] Error 2
You do not have the required permissions to view the files attached to this post.

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: make error NVfortran

#8 Post by andreas.singraber » Wed May 18, 2022 2:20 pm

Hello again!

The NVIDIA compiler complains because it cannot find the hdf5.mod file which is required to compile the VASP source file vhdf5_base.F. The hdf5.mod is part of the HDF5 library and it seems it is not in the place you provided in the corresponding makefile.include section:

Code: Select all

# HDF5-support (optional but strongly recommended)
CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT  ?= /usr/local/hdf/HDF5-1.12.2-Linux/HDF_Group/HDF5/1.12.2
LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS       += -I$(HDF5_ROOT)/include
Given these lines in your makefile.include you asked the compiler to search in the path /usr/local/hdf/HDF5-1.12.2-Linux/HDF_Group/HDF5/1.12.2/include for the hdf5.mod file. Can you please manually search the /usr/local/hdf/HDF5-1.12.2-Linux directory whether you can find it in some subdirectory there? Then put the correct path in the last line of the HDF5 block like this:

Code: Select all

INCS       += -I/path/to/the/hdf5/include/directory
It is probably best to repeat the entire compilation process then, it should not stop any more searching for the hdf5.mod file.

If you build process then completes without errors, you are fine. However, since the HDF5 mod file was not found with the given settings, there could be additional problems at the linking stage (at the very end of the build process). Then, the linker will search for the HDF5 library called libhdf5_fortran.so (or alternatively libhdf5_fortran.a). If you get an error at the very end saying something like "Could not find file libhdf5_fortran.so" then you need to search also for the correct HDF5 library path where libhdf5_fortran.so is located. As before, change also the library path in your makefile.include:

Code: Select all

LLIBS      += -L/path/to/the/hdf5/library/directory -lhdf5_fortran
The HDF5_ROOT variable is then not used any more, you can comment it out.

All the best,
Andreas Singraber

cristiana_ciobanu1
Newbie
Newbie
Posts: 5
Joined: Sat Dec 05, 2020 10:55 pm

Re: make error NVfortran

#9 Post by cristiana_ciobanu1 » Thu May 19, 2022 4:55 am

Hi Andreas,
Thanks for the reply.
It did seem that the Hdf5/include did not contain hdf5.mod, and it was actually in /usr/local/hdf/HDF5-1.12.2-Linux/HDF_Group/HDF5/1.12.2/include/share
After changing the makefile.include to this path, it complained the hdf5.mod was corrupt.
Seeing that there was a newer version of HDF5 released I reinstalled using the new version (1.13.1)
This time checking the include dir for hdf5.mod, and it in there.

Code: Select all

ls /usr/local/hdf5/include/
H5ACpublic.h  h5ds.mod       H5f90i.h       H5FDmpi.h       H5FDwindows.h        H5Gpublic.h   h5lib.mod       h5o.mod       H5pubconf.h     H5TBpublic.h              h5vl.mod        hdf5_hl.h
h5a.mod       H5DSpublic.h   H5FDcore.h     H5FDmpio.h      h5f.mod              H5Idevelop.h  h5l.mod         H5Opublic.h   H5public.h      H5Tdevelop.h              H5VLnative.h    hdf5.mod
H5api_adpt.h  h5e.mod        H5FDdevelop.h  H5FDmulti.h     h5fortkit.mod        h5im.mod      H5Lpublic.h     H5overflow.h  h5r.mod         h5t.mod                   H5VLpassthru.h
H5Apublic.h   H5Epubgen.h    H5FDdirect.h   H5FDpublic.h    h5fortran_types.mod  h5i.mod       h5lt_const.mod  H5PLextern.h  H5Rpublic.h     H5Tpublic.h               H5VLpublic.h
H5Cpublic.h   H5Epublic.h    H5FDfamily.h   H5FDros3.h      H5Fpublic.h          H5IMpublic.h  h5lt.mod        H5PLpublic.h  h5s.mod         H5TSdevelop.h             H5Zdevelop.h
h5d.mod       H5ESdevelop.h  H5FDhdfs.h     H5FDsec2.h      h5_gen.mod           H5Ipublic.h   H5LTpublic.h    h5p.mod       H5Spublic.h     H5version.h               h5z.mod
H5DOpublic.h  H5ESpublic.h   H5FDlog.h      H5FDsplitter.h  h5global.mod         H5Ldevelop.h  H5MMpublic.h    H5Ppublic.h   h5tb_const.mod  H5VLconnector.h           H5Zpublic.h
H5Dpublic.h   H5f90i_gen.h   H5FDmirror.h   H5FDstdio.h     h5g.mod              H5LDpublic.h  H5Mpublic.h     H5PTpublic.h  h5tb.mod        H5VLconnector_passthru.h  hdf5.h
I edited the makefile.include to point to this new installation.

Again when running it complains it can't open hdf5.mod

Code: Select all

NVFORTRAN-F-0004-Unable to open MODULE file hdf5.mod (vhdf5_base.F: 6)
NVFORTRAN/x86-64 Linux 22.3-0: compilation aborted
make[2]: *** [makefile:166: vhdf5_base.o] Error 2
make[2]: *** Waiting for unfinished jobs....
NVFORTRAN-F-0004-Unable to open MODULE file hdf5.mod (vhdf5_base.F: 6)
NVFORTRAN/x86-64 Linux 22.3-0: compilation aborted
mpif90 -acc -gpu=cc60,cc70,cc80,cuda11.6 -Mfree -Mbackslash -Mlarge_arrays -fast -I/opt/nvidia/hpc_sdk/Linux_x86_64/22.3/compilers/extras/qd/include/qd -I/usr/local//include -II/usr/local/hdf5/include  -c Lebedev-Laikov.f90
make[2]: *** [makefile:166: vhdf5_base.o] Error 2
You do not have the required permissions to view the files attached to this post.

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: make error NVfortran

#10 Post by andreas.singraber » Thu May 19, 2022 7:56 am

Hello!

You have a little mistake in the makefile.include because the include statement

Code: Select all

-II/usr/local/hdf5/include
has two I 's in front where there should be only one. This comes from the line

Code: Select all

INCS       += -I$ I$(HDF5_ROOT)/include
Change it to

Code: Select all

INCS       += -I$(HDF5_ROOT)/include
and it should find the file.

If it fails again with a "file corrupt" message you probably need to compile HDF5 yourself with the NVIDIA compiler. The reason is that Fortran's *.mod files are usually not compatible between different compilers. Hence, if a library needs you to include a *.mod file you may need to build it with the same compiler as the one you use for your own program.

Best,
Andreas Singraber

Locked