<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic compile with #ifdef in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compile-with-ifdef/m-p/1031490#M110720</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;

&lt;P&gt;I would like to create a program with&amp;nbsp;#ifdef and&amp;nbsp;#endif compilation options &amp;nbsp;but I do not know how could i compile even tis simple hello program:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;PROGRAM HELLO
IMPLICIT NONE

#ifdef PARALLEL
  WRITE(*,*) 'OPTION A'
#endif

 WRITE(*,*) 'OPTION A+B'

END PROGRAM&lt;/PRE&gt;

&lt;P&gt;When I compile, I get this error:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;hello.f90(4): warning #5117: Bad # preprocessor line
#ifdef PARALLEL
-^
hello.f90(6): warning #5117: Bad # preprocessor line
#endif
&lt;/PRE&gt;

&lt;P&gt;Can someone explain me how to compile and activate or not activate options A and B.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Really Really thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2015 16:55:12 GMT</pubDate>
    <dc:creator>diedro</dc:creator>
    <dc:date>2015-07-29T16:55:12Z</dc:date>
    <item>
      <title>compile with #ifdef</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compile-with-ifdef/m-p/1031490#M110720</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;

&lt;P&gt;I would like to create a program with&amp;nbsp;#ifdef and&amp;nbsp;#endif compilation options &amp;nbsp;but I do not know how could i compile even tis simple hello program:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;PROGRAM HELLO
IMPLICIT NONE

#ifdef PARALLEL
  WRITE(*,*) 'OPTION A'
#endif

 WRITE(*,*) 'OPTION A+B'

END PROGRAM&lt;/PRE&gt;

&lt;P&gt;When I compile, I get this error:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;hello.f90(4): warning #5117: Bad # preprocessor line
#ifdef PARALLEL
-^
hello.f90(6): warning #5117: Bad # preprocessor line
#endif
&lt;/PRE&gt;

&lt;P&gt;Can someone explain me how to compile and activate or not activate options A and B.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Really Really thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 16:55:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/compile-with-ifdef/m-p/1031490#M110720</guid>
      <dc:creator>diedro</dc:creator>
      <dc:date>2015-07-29T16:55:12Z</dc:date>
    </item>
    <item>
      <title>Unlike C/C++, standard</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compile-with-ifdef/m-p/1031491#M110721</link>
      <description>Unlike C/C++, standard Fortran doesn't have a built-in preprocessor.

On your compilation line, add the command line switch "-fpp", as:

          ifort -fpp myfile.f

and then you should get option "A+B".
or
    ifort -fpp -DPARALLEL myfile.f
and you should get option A

                  --Lorri</description>
      <pubDate>Wed, 29 Jul 2015 17:25:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/compile-with-ifdef/m-p/1031491#M110721</guid>
      <dc:creator>Lorri_M_Intel</dc:creator>
      <dc:date>2015-07-29T17:25:20Z</dc:date>
    </item>
    <item>
      <title>In addition to what Lorri</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compile-with-ifdef/m-p/1031492#M110722</link>
      <description>&lt;P&gt;In addition to what Lorri said, changing the file extension to .F90 will set -fpp.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 17:48:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/compile-with-ifdef/m-p/1031492#M110722</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-07-29T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Dear all,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/compile-with-ifdef/m-p/1031493#M110723</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;

&lt;P&gt;thanks a lot for your suggestions, It saves to me a lot of time.&lt;/P&gt;

&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 09:19:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/compile-with-ifdef/m-p/1031493#M110723</guid>
      <dc:creator>diedro</dc:creator>
      <dc:date>2015-08-03T09:19:49Z</dc:date>
    </item>
  </channel>
</rss>

