yambo-code / yambo

This is the official GPL repository of the yambo code
http://www.yambo-code.eu/
GNU General Public License v2.0
91 stars 35 forks source link

nvfortran as PGI #35

Closed osbama closed 2 years ago

osbama commented 2 years ago

Dear developers,

I am trying to compile YAMBO with NVIDIA HPC SDK 21.3 in order to benefit from GPUs in our cluster. The Fortran compiler bundled there identifies itself as nvfortran, however acts almost identical to PGI compiler.

PGI compiler has some different ideas on how to interpret sources. I see workarounds for them are already implemented, i.e. in src/modules/mod_stderr.F with a preprocessor option _PGI

Since configure does not recognize nvfortran as a PGI compiler, these workarounds are ignored.

I suggest adding nvfortran to config/m4/acx_get_fc_kind.m4 as a PGI compiler derivative

    *nvfortran*)
      FCKIND="pgi"
      FCVERSION=`$FC --version`
      ;;

Edit: It seems acx_fortran_flags.m4 acts independently from acx_get_fc_kind.m4. nvfortran needs to be added there as well.

sangallidavide commented 2 years ago

Dear Osbma, thanks for reaching out. Indeed we did something similar in the develop (private) branch

  *nvfortran* )
    SYSFLAGS="-O2 -g -fast -Munroll -Mnoframe -Mdalign -Mbackslash"
    FUFLAGS="-O0 -Mbackslash"
    FCMFLAG="-Mnomain"
    OMPFLAGS="-mp"
    NETCDFFLAGS="-DpgiFortran"
    def_compiler="-D_PGI"
    DEBUG_FLAGS="-g -Minform=inform -Mbounds -Mchkptr -Mchkstk -Meh_frame -Mbackslash"

and we are working on something more refined on a dedicated branch. We also fixed acx_get_fc_kind.m4

For release 5.0 I'll let the fix enter in the next patch.