Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preventing the addition of C-style comments in gfortran compilation 1

Status
Not open for further replies.

Vahid9

Technical User
Jul 28, 2016
23
CA
Hi,

I am compiling a code (VASP) using gfortran/openmpi. The codes includes about 50 files. When I issue "make", the compilation crashes because somehow the following lines get added to .f files.

Code:
/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   <[URL unfurl="true"]http://www.gnu.org/licenses/>.[/URL]  */

And many more lines triggering all kinds of error. If I delete these C-style comments in the first file, the compilation moves to the next file and another crash.

Is there a way to stop the addition of these C-style comments to the process of compilation?

I do use the following flags for CPP

Code:
CPP_ = ./preprocess <$*.F | /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/gcc-4.8.5/bin/cpp  -P -C -traditional >$*$(SUFFIX)

CPP   = $(CPP_) -DHOST=\"gfortran\"          -DMPI -DMPI_BLOCK=8000         -Duse_collective -DCACHE_SIZE=12000 -Davoidalloc -DNGZhalf         -DVASP2WANNIER90v2

Thank you,
Vahid
 
Thanks for the link. In addition, I also added the tag "-nostdinc" to CPP. Now the code compiles.

Cheers,
Vahid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top