Goddard-Fortran-Ecosystem / pFUnit

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

Rebuild issue with Intel fortran and -warn all #373

Open mennodeij opened 1 year ago

mennodeij commented 1 year ago

If I build the attached small test project with Intel Fortran and use the following cmake commandline:

FC=ifort cmake <path/to/smalltest> -DPFUNIT_DIR=<path/to/pFUnit>/cmake -D
CMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_Fortran_FLAGS_RELWITHDEBINFO="-O2 -g -warn all,noexternals"

then issue the following make/rebuild commands:

make && ctest && make clean && make

the second make will fail. I have tracked this to the use of -warn all, and -warn all,nointerfaces solves the problem.

I don't know why -warn all gives problems, while -warn all,nointerfaces does not. Possibly related to the generation of *_genmod.mod files

smalltest.zip

tclune commented 1 year ago

Apologies - things got a but busy with my day job and I'm only now circling back to some of the recent tickets. (I guess thta's what holiday weekends are for! :-)

I'm happy to adjust the flags along the lines you suggest, but will first attempt to read the man pages in the hope of getting a clue why "nointerfaces" is needed.

tclune commented 1 year ago

OK - on my OSX system, your reproducer actually fails on the first make. I'm thinking this is an Intel compiler bug. First, because it gives different behavior on subsequent passes on your system, but also because nointerfaces is the default setting.

I will attempt to submit a reproducer to Intel.

mennodeij commented 1 year ago

Thanks for looking into this and I agree that it is probably a compiler bug. If I can help getting this to the attention of Intel, please let me know.