NOAA-EMC / NCEPLIBS

Top level repo containing submodules for NCEPLIBS and associated dependencies for superproject builds
Other
43 stars 18 forks source link

Errors building NCEPLIBS using PGI Fortran compiler #194

Closed coderodyhpc closed 1 year ago

coderodyhpc commented 3 years ago

Hello, I'm getting a long list of errors that begin with:

NVFORTRAN-S-0310-Illegal statement in the specification part of a MODULE  (/home/centos/NCEPLIBS/download/nceplibs-bufr/src/modv_MXMSGL.F: 3)
NVFORTRAN-S-0310-Illegal statement in the specification part of a MODULE  (/home/centos/NCEPLIBS/download/nceplibs-bufr/src/modv_MXMSGL.F: 4)
NVFORTRAN-S-0310-Illegal statement in the specification part of a MODULE  (/home/centos/NCEPLIBS/download/nceplibs-bufr/src/modv_MXMSGL.F: 8)
NVFORTRAN-S-0310-Illegal statement in the specification part of a MODULE  (/home/centos/NCEPLIBS/download/nceplibs-bufr/src/modv_MXMSGL.F: 9)
NVFORTRAN-S-0310-Illegal statement in the specification part of a MODULE  (/home/centos/NCEPLIBS/download/nceplibs-bufr/src/modv_MXMSGL.F: 10)
  0 inform,   0 warnings,   5 severes, 0 fatal for modv_mxmsgl
make[5]: *** [src/CMakeFiles/bufr_d_DA_f.dir/build.make:270: src/CMakeFiles/bufr_d_DA_f.dir/modv_MXMSGL.F.o] Error 2
make[4]: *** [CMakeFiles/Makefile2:193: src/CMakeFiles/bufr_d_DA_f.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2

This cascades down and the compilation fails. I'm also getting Compiler not officially supported: NVHP, which I have already bumped into with UPP. It seems that the Fortran compiler is more sensitive than GCC (or whichever compiler the NCEPLIBS Team is using). Is this a dead end, is there any way to push through the compilation or any of the branches trying to find a workaround? Thanks.

climbfuji commented 3 years ago

At this point, we only support gfortran and ifort. If you want to provide us with the necessary code/build changes so that the code works with nvfortran, we will certainly welcome your contribution.

kgerheiser commented 3 years ago

NCEPLIBS will not build with compilers other than GNU/Intel without some work. Many of the libraries rely on specific compiler flags such as -fdefault-real-8 (GNU), -r8 (Intel) to be compiled correctly. So, each library's build would have to be updated for a new compiler and the correct flags added. We do not use the Nvidia compilers.

coderodyhpc commented 3 years ago

Hi @kgerheiser & @climbfuji, It sounds like a very time-consuming task. I have neither the time (nor maybe the skills) to go on this trip. Maybe I'll take a look at it next month (time permitting). Therefore I will close the thread for the time being and will reopen if I make any progress (alternatively push a PR). Thanks.

aerorahul commented 3 years ago

@coderodyhpc If I am not mistaken, CMake recognizes NVIDIA compilers as "PGI". If the NCEPlibs team could port a couple of libraries to PGI, it would open the pathway to building with the NVIDIA toolkit. After that:

FC=pgfortran CC=pgcc CXX=pgc++ cmake -B build
kgerheiser commented 3 years ago

I can look into it. Looks like the Nvidia (PGI) compilers are free to download now.

coderodyhpc commented 3 years ago

They are free to download but (as usual) they ask you to read the SLA carefully. A word of caution is that the Nvidia people don't like when others keep referring to them as the PGI compilers, although they sometimes (have to) refer to them as PGI legacy. Just my two cents.

edwardhartnett commented 3 years ago

The code should build with any standard fortran compiler, and we need to make the cmake build smart enough to do that.

kgerheiser commented 3 years ago

I've started working on this starting with NCEPLIBS-sp (https://github.com/NOAA-EMC/NCEPLIBS-sp/pull/56). I'll work my way through the libraries.