Stella compilation with intel
I can't compile the latest version of stella with make/cmake using an intel compiler. I could compile this version though d42b08b58a09fe36c12f4ac834f00b80cc798607
I get a range of different issue for each one.
Make:
- There is a
-Jthat is not recognised by intel. ChatGPT tells me we should used -module` instead. Not sure though
ifort: command line warning #10006: ignoring unknown option '-J/home/ir-pate3/stella/COMPILATION/build_make/utils/modules'
- If we replace the
-Jthen the valuefatal_errorwas declared twice
/home/ir-pate3/stella/EXTERNALS/mini_libstell/read_wout_mod.F(229): error #6401: The attributes of this name conflict with those made accessible by a USE statement. [FATAL_ERROR]
INTEGER, PARAMETER :: fatal_error = 666
- When using netcdf
inquireI get this error, Shouldierbeierr?
----------------------------^
/home/ir-pate3/stella/EXTERNALS/mini_libstell/read_wout_mod.F(974): error #6632: Keyword arguments are invalid without an explicit interface. [IER]
CALL cdf_inquire(nwout, vn_pparmnc, dimlens, ier=ierror)
---------------------------------------------------^
CMake:
j0(and others) inspfunc.fppdoesn't have a type?
/home/ir-pate3/stella/EXTERNALS/utils/spfunc.fpp(31): error #6404: This name does not have a type, and must have an explicit type. [J0]
public :: j0, j1
-------------^
/home/ir-pate3/stella/EXTERNALS/utils/spfunc.fpp(31): error #6404: This name does not have a type, and must have an explicit type. [J1]
public :: j0, j1
-----------------^
/home/ir-pate3/stella/EXTERNALS/utils/spfunc.fpp(32): error #6404: This name does not have a type, and must have an explicit type. [ERF_EXT]
public :: erf_ext
-------------^
Hey, I am not sure if you're still struggling with the same issues. The first issue has been fixed last week, the -module flag can now be set in the system dependent make file (see e.g. Makefile.marenostrum): MODULE_FLAG = -module
The netcdf error (which pops up at cdf_inquire) is typically fixed by setting the following line in the system dependent make file (see e.g. Makefile.marenostrum): F90FLAGS = -DNETCDF
The 'j0' error in 'spunc.fpp' when using CMake is something I've seen before but I do not remember exactly what the issue was. I did fix a library issue regarding hdf5 in the CMake compilation last week, perhaps this fixed it.
I've pulled the latest version of stella and using make with the adjustments you suggest seems to have fixed it! I can make a PR with this changes
However I'm still have the same issue with j0. Did you need to change something in your version of CMake?
I don't have permission to push here. Would you prefer a fork and merge or can I be added into the repo here?
I've just added you to the repo, Bhavin.
Regarding the issue of "j0", it might have to do with the specific compiler you're using. In the spfunc.fpp file there is a note:
! RN 2008/07/01: Compilers not having intrinsic those special functions must choose one of the following ! 1: local [USE_LOCAL_SPFUNC=on] ! 2: NAG Library [USE_NAGLIB=spfunc]
So I would suggest adding "USE_LOCAL_SPFUNC=on" to the local makefile. For CMake you probably want to turn on the option STELLA_ENABLE_LOCAL_SPFUNC. I never had to touch CMake to fix the error when I had it, so I think I simply changed the compiler to a compiler which had those functions installed.
I've added the USE_LOCAL_SPFUNC=on to the makefile.
I got the following error with CMake
STELLA_ENABLE_F200X is incompatible with STELLA_ENABLE_LOCAL_SPFUNC
But doing the following did work
cmake . -B COMPILATION/build_cmake -DSTELLA_ENABLE_LOCAL_SPFUNC=ON -DSTELLA_ENABLE_F200X=OFF