Skip to content

Complining with LOG option produces GNU Compiler/Prepocessor error

When compiling with GNU compilers and LOG stabilization option, the following error is produced:

gfortran -c -cpp -O3 -ffree-line-length-none -ffast-math -fopenmp  -DLOG   random_wrap_mod.F90
random_wrap_mod.F90:153:30:

  153 |        RANMOD = SQRT(-2.D0 * LOG(RANF_Wrap(iq)))
      |                              1
Error: Syntax error in argument list at (1)

in all calls to the LOG function. This is probably a bug with the C++ preprocessor, since changing upper case LOG to lower case log fixes the error.