<?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 Compiler Directives in Code:Blocks in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145771#M138504</link>
    <description>&lt;P&gt;In Windows, I have long used iFort's simple compiler directive facility for conditional compilation.&lt;/P&gt;&lt;P&gt;&lt;A href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-compiler-directives" target="_blank"&gt;https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-compiler-directives&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for example&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;!DIR$ IF(FOO==1)

do something

!DIR$ ELSE

do something else

!DIR$ ENDIF&lt;/PRE&gt;

&lt;P&gt;In Windows Developer Studio the value of FOO can be set globally in the project&amp;nbsp;properties page in&lt;/P&gt;
&lt;P&gt;Configuration Properties &amp;gt; Fortran &amp;gt; Preprocessor &amp;gt; Preprocessor Definitions&lt;/P&gt;
&lt;P&gt;in the form FOO=1;FIE=0;FUM=1 ... etc.&lt;/P&gt;
&lt;P&gt;These definitions are then applied to all files in the project. Note that this does not require the "Preprocess Source File" property to be Yes.&lt;/P&gt;
&lt;P&gt;I am now trying to get this to work in Linux where I am running Code:Blocks for Fortran (CBFortran) as the IDE. CBFortran offers a project build options page with many of the compiler options, but no "Preprocessor Definitions" line.&amp;nbsp; I would appreciate some guidance on how to use Intel's Compiler Directives feature in this context.&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 06:36:28 GMT</pubDate>
    <dc:creator>rorban</dc:creator>
    <dc:date>2019-08-18T06:36:28Z</dc:date>
    <item>
      <title>Compiler Directives in Code:Blocks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145771#M138504</link>
      <description>&lt;P&gt;In Windows, I have long used iFort's simple compiler directive facility for conditional compilation.&lt;/P&gt;&lt;P&gt;&lt;A href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-compiler-directives" target="_blank"&gt;https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-compiler-directives&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for example&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;!DIR$ IF(FOO==1)

do something

!DIR$ ELSE

do something else

!DIR$ ENDIF&lt;/PRE&gt;

&lt;P&gt;In Windows Developer Studio the value of FOO can be set globally in the project&amp;nbsp;properties page in&lt;/P&gt;
&lt;P&gt;Configuration Properties &amp;gt; Fortran &amp;gt; Preprocessor &amp;gt; Preprocessor Definitions&lt;/P&gt;
&lt;P&gt;in the form FOO=1;FIE=0;FUM=1 ... etc.&lt;/P&gt;
&lt;P&gt;These definitions are then applied to all files in the project. Note that this does not require the "Preprocess Source File" property to be Yes.&lt;/P&gt;
&lt;P&gt;I am now trying to get this to work in Linux where I am running Code:Blocks for Fortran (CBFortran) as the IDE. CBFortran offers a project build options page with many of the compiler options, but no "Preprocessor Definitions" line.&amp;nbsp; I would appreciate some guidance on how to use Intel's Compiler Directives feature in this context.&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:36:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145771#M138504</guid>
      <dc:creator>rorban</dc:creator>
      <dc:date>2019-08-18T06:36:28Z</dc:date>
    </item>
    <item>
      <title>Correction: !$DIR should be</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145772#M138505</link>
      <description>&lt;P&gt;Correction: !$DIR (as originally posted) should be !DIR$ is the example. I corrected it.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 07:56:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145772#M138505</guid>
      <dc:creator>rorban</dc:creator>
      <dc:date>2019-08-18T07:56:00Z</dc:date>
    </item>
    <item>
      <title>From the compiler's</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145773#M138506</link>
      <description>&lt;P&gt;From the compiler's perspective, this is the same as using fpp and one uses -D to define preprocessor symbols on the command line. Your question is really directed at Code:Blocks, it's not an Intel issue.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 13:53:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145773#M138506</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-08-18T13:53:53Z</dc:date>
    </item>
    <item>
      <title>!DIR$ are vendor specific</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145774#M138507</link>
      <description>&lt;P&gt;!DIR$ are vendor specific directives, otherwise are comments&lt;/P&gt;&lt;P&gt;You may need to make your !DIR$ directives safe for Code:Blocks&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;!DIR$ IF(FOO==1)
  iFrom = from_something
  iTo = to_something
  iStep = step_something
!DIR$ ELSE
  iFrom = from_something_else
  iTo = to_something_else
  iStep = step_something_else
!DIR$ ENDIF
do i=iFrom, iTo, iStep
  ...&lt;/PRE&gt;

&lt;P&gt;(you will also need to -DFOO... in&amp;nbsp; your compiler option)&lt;/P&gt;
&lt;P&gt;Your code may still be non-portable, at least to those compilers not supporting !DIR$...&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 15:01:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145774#M138507</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2019-08-18T15:01:00Z</dc:date>
    </item>
    <item>
      <title>The question was how to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145775#M138508</link>
      <description>&lt;P&gt;The question was how to specify defined symbols using the Code:Blocks UI. If Code:Blocks allows additional command line options (I don't use it), you can add:&lt;/P&gt;&lt;P&gt;-DFOO=-1 -DFIE=0&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 15:22:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145775#M138508</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-08-18T15:22:26Z</dc:date>
    </item>
    <item>
      <title>I found it and verified that</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145776#M138509</link>
      <description>&lt;P&gt;I found it and verified that it works. It was in Build Options&amp;gt;Compiler Settings&amp;gt;# defines.&lt;/P&gt;&lt;P&gt;This tab is initially hidden in the GUI, but appears if you repeatedly click on the right arrow in the row of tabs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to everyone who replied.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 21:57:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-Directives-in-Code-Blocks/m-p/1145776#M138509</guid>
      <dc:creator>rorban</dc:creator>
      <dc:date>2019-08-18T21:57:28Z</dc:date>
    </item>
  </channel>
</rss>

