As I’m doing research with VASP on GPU, I’d like to compile it with nvhpc toolkits, however it’s difficult to compile dft-d4 package. It’s website is https://github.com/dftd4/dftd4. I’m using nvhpc 23.1, and I’m a complete newbie to fortran. I found that there maybe some “bugs” in nvfortran that the function move_alloc may cause a string to lose it’s end symbol ‘\0’. I’m not sure about the rule, but just to infer it just like C. Moreover, it can pass all the unit test if I use gfortran but failed much with nvfortran, and for the package compiled by gfortran cannot be linked to a project built by nvfortran, it’s really confusing.
I want to know what FFLAGS should I set that the nvfortran may behaviour just like gfortran? Some uses the parameter below:
gfortran
gfortran -Isubprojects/mctc-lib/libmctc-lib.a.p -Isubprojects/mctc-lib -I../subprojects/mctc-lib -I../subprojects/mctc-lib/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -O2 -g -ffree-line-length-none -fbacktrace -fPIC -fopenmp -DWITH_JSON=0 -Jsubprojects/mctc-lib/libmctc-lib.a.p -o subprojects/mctc-lib/libmctc-lib.a.p/src_mctc_io_read_vasp.f90.o -c ../subprojects/mctc-lib/src/mctc/io/read/vasp.f90
nvfortran
nvfortran -Isubprojects/mctc-lib/libmctc-lib.a.p -Isubprojects/mctc-lib -I../subprojects/mctc-lib -I../subprojects/mctc-lib/include -Minform=inform -O2 -g -Mbackslash -Mallocatable=03 -traceback -fPIC -fopenmp -DWITH_JSON=0 -module subprojects/mctc-lib/libmctc-lib.a.p -o subprojects/mctc-lib/libmctc-lib.a.p/src_mctc_io_read_vasp.f90.o -c ../subprojects/mctc-lib/src/mctc/io/read/vasp.f90
But it just failed in the unit test, so I’m looking for help…