NWChem 6.6 Compiling on Cray: FTN Recursive Include Error


Just Got Here
I'm trying to compile NWChem 6.6 on a Cray XE6/XK7 system, but I get a "Recursive use of INCLUDE file" error with the ftn compiler during the nwdft/xc portion of the compilation. I first encountered the error in setACmat.F, where ftn printed an the error for two lines that contained "#include setACmat.F" in setACmat.F. I noticed that this recursive use of include occurs in other .F files in the same directory.

This is the end of make.log:

 ftn  -c -s integer64 -Ktrap=fp -DCRAYFORTRAN -DUSE_POSIXF -O2 -O scalar3,thread0,vector2,ipa2  -I. -I../include -I/N/u/bnoffke/BigRed2/nwchem-6.6/src/include -I/N/u/bnoffke/BigRed2/nwchem-6.6/src/tools/install/include -DCRAYXT -DNOIO -DEXT_INT -DLINUX -DLINUX64 -DNOIO -DEAFHACK -DPARALLEL_DIAG   setACmat.F

#include "setACmat.F"
ftn-64 crayftn: ERROR TRANSFORM_CMAT, File = setACmat.F, Line = 296
Recursive use of INCLUDE file "setACmat.F".

#include "setACmat.F"
ftn-64 crayftn: ERROR TRANSFORM_CMAT, File = setACmat.F, Line = 303
Recursive use of INCLUDE file "setACmat.F".

make[3]: *** [/N/u/bnoffke/BigRed2/nwchem-6.6/lib/LINUX64/libnwdft.a(setACmat.o)] Error 1
make[3]: Leaving directory `/gpfs/home/b/n/bnoffke/BigRed2/nwchem-6.6/src/nwdft/xc'
make[2]: *** [optimized] Error 2
make[2]: Leaving directory `/gpfs/home/b/n/bnoffke/BigRed2/nwchem-6.6/src/nwdft/xc'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/gpfs/home/b/n/bnoffke/BigRed2/nwchem-6.6/src/nwdft'
make: *** [libraries] Error 1


Here's a snippet of the code in setACmat.F that contains the violating lines:

 #ifndef SECOND_DERIV
#define SECOND_DERIV
c
c Compile source again for the 2nd derivative case
c
#include "setACmat.F" <------------Problem line
#endif
#ifndef THIRD_DERIV
#define THIRD_DERIV
c
c Compile source again for the 3rd derivative case
c
#include "setACmat.F" <------------Problem line
#endif
C> @}

Any tips on resolving this issue? I would really appreciate it.

Thanks,
Ben

Forum Vet
Ben
From your error log I believe you are using Cray compilers.
I am sorry to tell you that we do not really support Cray compilers.
We do support Intel compilers. You should be able to switch to the Intel Programming Environment by typing

module swap PrgEnv-cray PrgEnv-intel

Instead, if you the only other options are Portland group compilers, you should type

module swap PrgEnv-cray PrgEnv-pgi

More details at http://nwchemgit.github.io/index.php/Compiling_NWChem#Example:_OLCF_Titan

Just Got Here
Ah okay. I'll give the Intel/PGI compilers a shot next. Thanks for the quick reply!

Gets Around
Ben:

A few years ago, I worked around these issues and compiled NWChem with Cray Fortran. The resulting binary gave wrong answers for the DFT code. Thus, supporting Cray Fortran is not as simple as just resolving recursive preprocessing (which, by the way, can be solved the same way NWChem works around limitations in the IBM XLF preprocessor).

I mention this in hopes of saving someone else the trouble of repeating my leap from the frying pan into the fire.


Forum >> NWChem's corner >> Compiling NWChem