Camb: Compiling with gfortran
Posted: February 20 2007
I was experimenting the other day with the gfortran compiler, after I installed the latest version, and I noticed that there is no support for it in CAMB! (meaning that CAMB needs some tweaking so as to compile). Wouldn't it be better if CAMB supported it from the beginning?
I searched in CosmoCoffee but this was not answered in any thread, so I thought it deserves to be posted.
To compile with gfortran just edit the file inidriver.f90 and comment out (add a ! at the begging of the line) the "external iargc" part, which is at the beginning of the file. Then, compile as usual.
A more permanent solution ( perhaps for a future version of Camb?) is to replace the "external iargc" part with
#ifndef GFC
external iargc
#endif
The makefile in this case needs the following lines:
#Gfortran compiler
F90C = gfc
FFLAGS = -O2 -DGFC
and compilation goes a usual. I tested this with the September 2006 version of Camb and the latest version of gfortran.
Cheers,
Savas
I searched in CosmoCoffee but this was not answered in any thread, so I thought it deserves to be posted.
To compile with gfortran just edit the file inidriver.f90 and comment out (add a ! at the begging of the line) the "external iargc" part, which is at the beginning of the file. Then, compile as usual.
A more permanent solution ( perhaps for a future version of Camb?) is to replace the "external iargc" part with
#ifndef GFC
external iargc
#endif
The makefile in this case needs the following lines:
#Gfortran compiler
F90C = gfc
FFLAGS = -O2 -DGFC
and compilation goes a usual. I tested this with the September 2006 version of Camb and the latest version of gfortran.
Cheers,
Savas