Incompatibility with GCC 6.x

Submitted by yunhailiseu on Thu, 05/18/2017 - 19:50



Dear Developers,

Recently I tried to build BGW-1.2.0 on Fedora 25 with GCC 6.x. However, gfortran kept complaining about source code format error and the compilation never succeed. After some investigation and tests I found that it was due to a possible incompatibility of GCC 6.x, which I will describe briefly below.

When using cpp for FORTRAN source code, the '-C' option is required to retain the all comments. For GCC 6.x, using 'cpp -C' inserts additional copyright notice of Glibc in the processed source code. The copyright notice is in C-style comment (/**/) and causes gfortran to abort. However, no such copyright notice is included for GCC 4.x.

As a workaround, I wrote a python program to remove the C-style comments in the processed source file (*.p.f) and modified Common/ accordingly. Although this workaround works, I think expert advice is needed.

Yunhai Li