Goddard-Fortran-Ecosystem / pFUnit

Parallel Fortran Unit Testing Framework
Other
172 stars 45 forks source link

Need a file cmake/NVHPC.cmake #337

Open cponder opened 2 years ago

cponder commented 2 years ago

Building the 4.2.2 version with the NVHPC 22.2 (pre-release) compiler gives me this error:

CMake Error at CMakeLists.txt:70 (include):
  include could not find requested file:

    cmake/NVHPC.cmake

CMake Error at CMakeLists.txt:72 (message):
  Unrecognized Fortran compiler.  Please use ifort, gfortran, NAG, PGI, or XL.

For now I'm going to run the command

cp cmake/PGI.cmake cmake/NVHPC.cmake

which worked for the gFTL-shared library, as reported here

https://github.com/Goddard-Fortran-Ecosystem/gFTL-shared/issues/51
cponder commented 2 years ago

That being said, I'm still working through build issues so I don't know if other fixes are needed.

I do suggest, though, just copying the PGI file verbatim to serve as a "version 0" starting-point, after which we would make further edits as required.

tclune commented 2 years ago

@cponder - sorry about that. Forgot to commit the NVHPC.cmake file. Will do so shortly.

tclune commented 2 years ago

Sorry - did not notice that this was in the pFUnit repo. I think a number of changes are needed here and in fArgParse to use the kludged gFTL. But none of these are in the critical path for running GEOS. For that we only absolutely need gFTL, gFTL-shared (and ESMF).

tclune commented 2 years ago

I have created a branch feature/NVIDIA-workarounds in both fArgParse and pFUnit. (Not quite the same name as in gFTL-shared, sorry about that.)

Note that there are also existing branches called something like feature/pgi-workarounds that might be worth looking at. Those had changes that I was unwilling to merge onto main. (Never got a full build anyway.)

Am closing this ticket.

cponder commented 2 years ago

You'll get the cmake/NVHPC.cmake into the next official release, won't you?

tclune commented 2 years ago

Yes. In fact, I'll merge into develop immediately in both. Unfortunately can't quite do the same thing in gFTL-shared as there are other things already mixed in.

cponder commented 2 years ago

Carl,

No – you have all of the dependencies. The “proxy” object is of type RemoteProxyTestCase, which extends TestCase which extends Test, which extends StringTestAnnotationMap (in file TestAnnotation.F90). The Map is a gFTL container which brings in the insert method.

My OO experience is a bit stronger now then when I developed that layer, and I would no longer use such a deep hierarchy. I believe the code is correct, and as such is a good reproducer for your compiler, but I suspect a good workaround would be to use “has-a” for the annotation map. Unfortunately, that will be a number of changes, so not trivial.

Cheers,

From: Carl Ponder @.> Reply-To: Carl Ponder @.> Date: Wednesday, February 2, 2022 at 6:29 PM To: "Clune, Thomas L. (GSFC-6101)" @.> Cc: Goddard-Fortran-Ecosystem/pFUnit @.> Subject: [EXTERNAL] Problem building pFUnit 4.2.2 with NVHPC compilers

Some of the PGI bugs have gotten fixed, so I'm revisiting the libraries that I'd had trouble building. Here's the problem I have with pFUnit right now: [ 24%] Building Fortran object src/funit/core/CMakeFiles/funit-core.dir/RemoteProxyTestCase.F90.o nvfortran-Warning-Unknown switch: -Mchkfpstk NVFORTRAN-S-0142-insert is not a component of this OBJECT (/usr/local/src/pFUnit-4.2.2/src/funit/core/RemoteProxyTestCase.F90: 80) 0 inform, 0 warnings, 1 severes, 0 fatal for newremoteproxytestcase make[2]: [src/funit/core/CMakeFiles/funit-core.dir/build.make:817: src/funit/core/CMakeFiles/funit-core.dir/RemoteProxyTestCase.F90.o] Error 2 make[1]: [CMakeFiles/Makefile2:524: src/funit/core/CMakeFiles/funit-core.dir/all] Error 2 make: [Makefile:166: all] Error 2 @.: The -Mchkfpstk is not a problem because the compiler is ignoring it. This problem at line 80, though: 79 if(a_test%is_disabled()) then 80 call proxy%insert(Disable%type_name(),Disable) 81 end if Is it dependent on some other library that I didn't install? Here's the command-line that I used: mkdir build cd build cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_PREFIX_PATH=/usr/local -D CMAKE_MODULE_PATH=/usr/local -D SKIP_OPENMP=YES .. make Setting this to the top of the source-tree didn't change anything: CMAKE_PREFIX_PATH=/usr/local/src/pFUnit-4.2.2 Are there other settings I need to make?

cponder commented 2 years ago

I'll go ahead and file the error here, then. Can you give me any more info, like showing where "nsert" is declared to be a component of the object?


Subject: Re: [EXTERNAL] Problem building pFUnit 4.2.2 with NVHPC compilers Date: Thu, 3 Feb 2022 13:53:38 +0000 From: Clune, Thomas L. (GSFC-6101) @.> To: Carl Ponder @.> CC: Goddard-Fortran-Ecosystem/pFUnit @.***>

External email: Use caution opening links or attachments

Carl,

No – you have all of the dependencies. The “proxy” object is of type  RemoteProxyTestCase, which extends TestCase which extends Test, which extends StringTestAnnotationMap (in file TestAnnotation.F90).  The Map is a gFTL container which brings in the insert method.

My OO experience is a bit stronger now then when I developed that layer, and I would no longer use such a deep hierarchy.   I believe the code is correct, and as such is a good reproducer for your compiler, but I suspect  a good workaround would be to use “has-a” for the annotation map. Unfortunately, that will be a number of changes, so not trivial.

Cheers,

From: Carl Ponder @.> Reply-To: Carl Ponder @.> Date: Wednesday, February 2, 2022 at 6:29 PM To: "Clune, Thomas L. (GSFC-6101)" @.> Cc: Goddard-Fortran-Ecosystem/pFUnit @.> Subject: [EXTERNAL] Problem building pFUnit 4.2.2 with NVHPC compilers

Some of the PGI bugs have gotten fixed, so I'm revisiting the libraries that I'd had trouble building. Here's the problem I have with pFUnit right now:

[ 24%] Building Fortran object
src/funit/core/CMakeFiles/funit-core.dir/RemoteProxyTestCase.F90.o
nvfortran-Warning-Unknown switch: -Mchkfpstk
*NVFORTRAN-S-0142-insert is not a component of this OBJECT
(/usr/local/src/pFUnit-4.2.2/src/funit/core/RemoteProxyTestCase.F90:
80)*
   0 inform,   0 warnings,   1 severes, 0 fatal for
newremoteproxytestcase
make[2]: ***
[src/funit/core/CMakeFiles/funit-core.dir/build.make:817:
src/funit/core/CMakeFiles/funit-core.dir/RemoteProxyTestCase.F90.o]
Error 2
make[1]: *** [CMakeFiles/Makefile2:524:
src/funit/core/CMakeFiles/funit-core.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
***@***.***:

The -Mchkfpstk is not a problem because the compiler is ignoring it. This problem at line 80, though:

79 if(a_test%is_disabled()) then
*80 call proxy%insert(Disable%type_name(),Disable)*
81 end if

Is it dependent on some other library that I didn't install? Here's the command-line that I used:

mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D
CMAKE_PREFIX_PATH=/usr/local -D CMAKE_MODULE_PATH=/usr/local -D
SKIP_OPENMP=YES ..
make

Setting this to the top of the source-tree didn't change anything:

CMAKE_PREFIX_PATH=/usr/local/src/pFUnit-4.2.2

Are there other settings I need to make?

cponder commented 2 years ago

Carl,

I’ll produce the generated code for StringTestAnnotationMap when I get a break in a bit.

Cheers,

From: Carl Ponder @.> Reply-To: Carl Ponder @.> Date: Thursday, February 3, 2022 at 9:13 AM To: "Clune, Thomas L. (GSFC-6101)" @.> Cc: Goddard-Fortran-Ecosystem/pFUnit @.> Subject: Re: [EXTERNAL] Problem building pFUnit 4.2.2 with NVHPC compilers

I'll go ahead and file the error here, then. Can you give me any more info, like showing where "nsert" is declared to be a component of the object?


Subject: Re: [EXTERNAL] Problem building pFUnit 4.2.2 with NVHPC compilers Date: Thu, 3 Feb 2022 13:53:38 +0000 From: Clune, Thomas L. (GSFC-6101) @.**@.> To: Carl Ponder @.**@.> CC: Goddard-Fortran-Ecosystem/pFUnit @.**@.>

External email: Use caution opening links or attachments

Carl,

No – you have all of the dependencies. The “proxy” object is of type RemoteProxyTestCase, which extends TestCase which extends Test, which extends StringTestAnnotationMap (in file TestAnnotation.F90). The Map is a gFTL container which brings in the insert method.

My OO experience is a bit stronger now then when I developed that layer, and I would no longer use such a deep hierarchy. I believe the code is correct, and as such is a good reproducer for your compiler, but I suspect a good workaround would be to use “has-a” for the annotation map. Unfortunately, that will be a number of changes, so not trivial.

Cheers,

  1. Tom

From: Carl Ponder @.**@.> Reply-To: Carl Ponder @.**@.> Date: Wednesday, February 2, 2022 at 6:29 PM To: "Clune, Thomas L. (GSFC-6101)" @.**@.> Cc: Goddard-Fortran-Ecosystem/pFUnit @.**@.> Subject: [EXTERNAL] Problem building pFUnit 4.2.2 with NVHPC compilers

Some of the PGI bugs have gotten fixed, so I'm revisiting the libraries that I'd had trouble building. Here's the problem I have with pFUnit right now: [ 24%] Building Fortran object src/funit/core/CMakeFiles/funit-core.dir/RemoteProxyTestCase.F90.o nvfortran-Warning-Unknown switch: -Mchkfpstk NVFORTRAN-S-0142-insert is not a component of this OBJECT (/usr/local/src/pFUnit-4.2.2/src/funit/core/RemoteProxyTestCase.F90: 80) 0 inform, 0 warnings, 1 severes, 0 fatal for newremoteproxytestcase make[2]: [src/funit/core/CMakeFiles/funit-core.dir/build.make:817: src/funit/core/CMakeFiles/funit-core.dir/RemoteProxyTestCase.F90.o] Error 2 make[1]: [CMakeFiles/Makefile2:524: src/funit/core/CMakeFiles/funit-core.dir/all] Error 2 make: [Makefile:166: all] Error 2 @.: The -Mchkfpstk is not a problem because the compiler is ignoring it. This problem at line 80, though: 79 if(a_test%is_disabled()) then 80 call proxy%insert(Disable%type_name(),Disable) 81 end if Is it dependent on some other library that I didn't install? Here's the command-line that I used: mkdir build cd build cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_PREFIX_PATH=/usr/local -D CMAKE_MODULE_PATH=/usr/local -D SKIP_OPENMP=YES .. make Setting this to the top of the source-tree didn't change anything: CMAKE_PREFIX_PATH=/usr/local/src/pFUnit-4.2.2 Are there other settings I need to make?

tclune commented 2 years ago

Annotation.gz

Attached gzip'd expansion of TestAnnotation.F90.

cponder commented 2 years ago

@tclune What's the state of this, now? The latest release is still from awhile ago.

tclune commented 2 years ago

@cponder - The last action was to provide you with the Annotation.gz file that was a reproducer. Did you mean to post your question in a different issue?

Apologies if I've lost track and there was a change that you wanted released.

cponder commented 2 years ago

Sorry, I got a duplicate in there. You said you had the cmake/NVHPC.cmake in the develop branch, but the 4.2.2 tag is from sometime before that. Also there's still the compilation failure I mentioned above

NVFORTRAN-S-0142-insert is not a component of this OBJECT (/usr/local/src/pFUnit-4.2.2/src/funit/core/RemoteProxyTestCase.F90: 80)
cponder commented 2 years ago

Actually, re-building now with the PGI nightly compiler, I get this different error:

NVFORTRAN-S-0081-Illegal selector - KIND value must be non-negative  (/usr/local/src/pFUnit-4.2.2/src/funit/fhamcrest/BaseDescription.F90: 311)
  0 inform,   0 warnings,   1 severes, 0 fatal for description_of_real128
NVFORTRAN-S-0081-Illegal selector - KIND value must be non-negative  (/usr/local/src/pFUnit-4.2.2/src/funit/fhamcrest/BaseDescription.F90: 338)
  0 inform,   0 warnings,   1 severes, 0 fatal for description_of_complex128
make[2]: *** [src/funit/fhamcrest/CMakeFiles/fhamcrest.dir/build.make:191: src/funit/fhamcrest/CMakeFiles/fhamcrest.dir/BaseDescription.F90.o] Error 2
make[1]: *** [CMakeFiles/Makefile2:576: src/funit/fhamcrest/CMakeFiles/fhamcrest.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

I think the problem here could be that the NVHPC compilers don't support 128-bit numbers. Is there a flag that suppresses the usage here?

tclune commented 2 years ago

Mark LeAir indicated he had a workaround and would supply it back to me at some point. I'm sure I can replicate this weekend if his version is not accessible.

cponder commented 2 years ago

This is what Mark had said a moth ago:

Update on the source code patch:  I don't have access to make the pull request. I sent the patches to Tom Clune and he is going to try to integrate them this weekend.

Did he get the fixes to you?

tclune commented 2 years ago

Ah - yes. I do remember that now. I'll try to get these merged asap. Won't be before tomorrow, and won't be after Sunday.