# Gfortran compiler options?

**URL:** <https://fortran-lang.discourse.group/t/gfortran-compiler-options/6041>\
**Category:** Uncategorized\
**Created:** [June 26, 2023, 10:41am UTC](https://fortran-lang.discourse.group/t/gfortran-compiler-options/6041 "2023-06-26T10:41:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![forum.san](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@forum.san](https://fortran-lang.discourse.group/u/forum.san)\
**Post date:** [June 26, 2023, 10:41am UTC](https://fortran-lang.discourse.group/t/gfortran-compiler-options/6041/1 "2023-06-26T10:41:41Z")

</div>

Hi,

What preprocessing option need to be used for gfortran [on Linux] to do the below operation:

```auto
Perform source preprocessing and compilation on Fortran source files. When specified, source code is included by both #include directives and Fortran INCLUDE lines. Generates file file.i, which contains the source code after the preprocessing has been performed and the effects applied to the source program.

```

Thanks

---

<div class="post-metadata">

**Author:** ![Euler-37](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@Euler-37](https://fortran-lang.discourse.group/u/Euler-37)\
**Post date:** [June 26, 2023, 11:24am UTC](https://fortran-lang.discourse.group/t/gfortran-compiler-options/6041/2 "2023-06-26T11:24:06Z")

</div>

`-cpp` or capital filename extension ,such as `.F90,.FOR`

> **[Preprocessing Options (The GNU Fortran Compiler)](https://gcc.gnu.org/onlinedocs/gfortran/Preprocessing-Options.html)**
>
> Preprocessing Options (The GNU Fortran Compiler)

---

<div class="post-metadata">

**Author:** ![forum.san](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@forum.san](https://fortran-lang.discourse.group/u/forum.san)\
**Post date:** [June 27, 2023, 9:35am UTC](https://fortran-lang.discourse.group/t/gfortran-compiler-options/6041/3 "2023-06-27T09:35:34Z")

</div>

The compilation of Fortran code works fine with cray fortran compiler. The compilation flags used are: “-eZ”. If gnu fortran (i.e. gfortran-12.2) is used, then it throws many errors.

Here is the reference link of cray fortran compiler options.  
[https://support.hpe.com/hpesc/public/docDisplay?docId=a00115296en\_us&page=Fortran\_Command-line\_Options.html](https://support.hpe.com/hpesc/public/docDisplay?docId=a00115296en_us&page=Fortran_Command-line_Options.html)

Can someone let know, what are the equivalent options for gfortran.

---

<div class="post-metadata">

**Author:** ![RonShepard](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@RonShepard](https://fortran-lang.discourse.group/u/RonShepard)\
**Post date:** [June 27, 2023, 3:07pm UTC](https://fortran-lang.discourse.group/t/gfortran-compiler-options/6041/4 "2023-06-27T15:07:58Z")

</div>

> [@forum.san](#):
>
> If gnu fortran (i.e. gfortran-12.2) is used, then it throws many errors.

You probably need to post a few representative error messages to get any meaningful response. Particularly if you are working with legacy codes, there will be several possible options to enable or disable some legacy compiler behavior.

---

<div class="post-metadata">

**Author:** ![forum.san](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@forum.san](https://fortran-lang.discourse.group/u/forum.san)\
**Post date:** [June 27, 2023, 4:56pm UTC](https://fortran-lang.discourse.group/t/gfortran-compiler-options/6041/5 "2023-06-27T16:56:18Z")

</div>

The FFLAGS for cce-16.0 Fortran compiler are “-eZ”. I’m looking for equivalent options for gfortran.

Thanks

---

<div class="post-metadata">

**Author:** ![RonShepard](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@RonShepard](https://fortran-lang.discourse.group/u/RonShepard)\
**Post date:** [June 27, 2023, 7:14pm UTC](https://fortran-lang.discourse.group/t/gfortran-compiler-options/6041/7 "2023-06-27T19:14:30Z")

</div>

> [@forum.san](#):
>
> The FFLAGS for cce-16.0 Fortran compiler are “-eZ”. I’m looking for equivalent options for gfortran.

That question has already been answered, and you apparently still have compiler warnings and errors. I’ll repeat what I said before, you need to post more information to get a meaningful response.

---

<div class="post-metadata">

**Author:** ![urbanjost](https://avatars.discourse-cdn.com/v4/letter/u/0ea827/32.png) [@urbanjost](https://fortran-lang.discourse.group/u/urbanjost)\
**Post date:** [June 28, 2023, 2:48am UTC](https://fortran-lang.discourse.group/t/gfortran-compiler-options/6041/8 "2023-06-28T02:48:33Z")

</div>

-eZ just enables pre-processing, equivalent to gfortran -cpp switch; performing pre-processing regardless of the source file suffix.
