×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Preventing the addition of C-style comments in gfortran compilation

Preventing the addition of C-style comments in gfortran compilation

Preventing the addition of C-style comments in gfortran compilation

(OP)
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
   <http://www.gnu.org/licenses/>.  */ 


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

RE: Preventing the addition of C-style comments in gfortran compilation

(OP)
Thanks for the link. In addition, I also added the tag "-nostdinc" to CPP. Now the code compiles.

Cheers,
Vahid

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close