<?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 You need to set a value in in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921094#M85500</link>
    <description>&lt;P&gt;You need to set a value in&lt;/P&gt;

&lt;P&gt;Project Properties - Fortran - General - Preprocessor Definitions&lt;/P&gt;

&lt;P&gt;For example I have set these two:&lt;/P&gt;

&lt;P&gt;ONLINE; DEBUG&lt;/P&gt;

&lt;P&gt;In my code I can now check:&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;P&gt;!DEC$ IF DEFINED (ONLINE)&lt;/P&gt;

&lt;P&gt;i = 1&lt;/P&gt;

&lt;P&gt;!DEC$ ELSE&lt;/P&gt;

&lt;P&gt;i = 2&lt;/P&gt;

&lt;P&gt;!DEC$ END IF&lt;/P&gt;

&lt;P&gt;!DEC$ IF .NOT. DEFINED (ONLINE)&lt;/P&gt;

&lt;P&gt;i = 2&lt;/P&gt;

&lt;P&gt;!DEC$ END IF&lt;/P&gt;

&lt;P&gt;!DEC$ IF DEFINED (DEBUG)&lt;/P&gt;

&lt;P&gt;nz = nz * 4&lt;/P&gt;

&lt;P&gt;!DEC$ END IF&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;[/fortran]&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I don´t think that this is case senstive.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Markus&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Feb 2014 05:42:40 GMT</pubDate>
    <dc:creator>onkelhotte</dc:creator>
    <dc:date>2014-02-21T05:42:40Z</dc:date>
    <item>
      <title>Debug and Release compiler directives</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921093#M85499</link>
      <description>&lt;P&gt;In building code by debug mode, PRINT or WRITE of variables on screen are needed but not in release mode.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;If possible, I want to make this PRINT routine control by compiler directives such as&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;!DEC$ ()...&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;SOME PRINT STATEMENT ONLY ACTIVATE IN DEBUG MODE, NOT IN RELEASE MODE&lt;/P&gt;

&lt;P&gt;!DEC$ ()&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;HK&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2014 02:00:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921093#M85499</guid>
      <dc:creator>elquin</dc:creator>
      <dc:date>2014-02-21T02:00:36Z</dc:date>
    </item>
    <item>
      <title>You need to set a value in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921094#M85500</link>
      <description>&lt;P&gt;You need to set a value in&lt;/P&gt;

&lt;P&gt;Project Properties - Fortran - General - Preprocessor Definitions&lt;/P&gt;

&lt;P&gt;For example I have set these two:&lt;/P&gt;

&lt;P&gt;ONLINE; DEBUG&lt;/P&gt;

&lt;P&gt;In my code I can now check:&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;P&gt;!DEC$ IF DEFINED (ONLINE)&lt;/P&gt;

&lt;P&gt;i = 1&lt;/P&gt;

&lt;P&gt;!DEC$ ELSE&lt;/P&gt;

&lt;P&gt;i = 2&lt;/P&gt;

&lt;P&gt;!DEC$ END IF&lt;/P&gt;

&lt;P&gt;!DEC$ IF .NOT. DEFINED (ONLINE)&lt;/P&gt;

&lt;P&gt;i = 2&lt;/P&gt;

&lt;P&gt;!DEC$ END IF&lt;/P&gt;

&lt;P&gt;!DEC$ IF DEFINED (DEBUG)&lt;/P&gt;

&lt;P&gt;nz = nz * 4&lt;/P&gt;

&lt;P&gt;!DEC$ END IF&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;[/fortran]&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I don´t think that this is case senstive.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Markus&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2014 05:42:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921094#M85500</guid>
      <dc:creator>onkelhotte</dc:creator>
      <dc:date>2014-02-21T05:42:40Z</dc:date>
    </item>
    <item>
      <title>Id there any way to use !DEC$</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921095#M85501</link>
      <description>&lt;P&gt;Id there any way to use !DEC$ IF &amp;nbsp;for debug without having to actual set a&amp;nbsp;&lt;FONT face="Arial, Helvetica, sans-serif"&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Pre-processor&amp;nbsp;Definitions. It would be good to have some code that is only for debug but without some auto detection there is more risk of &amp;nbsp;getting it wrong....&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 18:36:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921095#M85501</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-03-24T18:36:17Z</dc:date>
    </item>
    <item>
      <title>Quote:app4619 wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921096#M85502</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;app4619 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Id there any way to use !DEC$ IF &amp;nbsp;for debug without having to actual set a&amp;nbsp;Pre-processor&amp;nbsp;Definitions. It would be good to have some code that is only for debug but without some auto detection there is more risk of &amp;nbsp;getting it wrong....&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I believe&amp;nbsp;_DEBUG gets defined by default in Visual Studio if the configuration is DEBUG.&amp;nbsp; But you would still need !DEC$ IF DEFINED (_DEBUG) in your code to make use of it.&amp;nbsp; But then&amp;nbsp;another problem is one can undefine this definition in a Visual Studio setting and if that's&amp;nbsp;done,&amp;nbsp;the code will not process as intended.&amp;nbsp; Also, a thing to note is at the command-line level, everything is based on selected options whether by Visual Studio or by the user directly.&amp;nbsp; As far as I know, there is no built-in setting if -g (debug compile) option is specified at the command level.&amp;nbsp; So I'm not sure there is any way to ensure reliable "auto detection".&amp;nbsp; It is probably better for code developers to be conscious about it and do things correctly.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 21:10:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921096#M85502</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-03-24T21:10:00Z</dc:date>
    </item>
    <item>
      <title>Thanks for the thoughts I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921097#M85503</link>
      <description>&lt;P&gt;Thanks for the thoughts I will check that out and have a play with this area to find the compromise that works best for me.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;FortranFan wrote:&lt;BR /&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;!DEC$ IF &amp;nbsp; It is probably better for code developers to be conscious about it and do things correctly.&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;This is clearly true, however, many things can and do go wrong so reducing the list of things that can go wrong stands a good chance reducing the number of things that do go wrong.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Perhaps setting defining mydebug=0 or 1 in the release and debug settings and in the case that mydebug is undefined have a line of dependant code the causes the compiler to cough and throw its teddy out of the pram. That is pure theorising as I have not yet investigated what is possible....&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 22:39:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921097#M85503</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-03-24T22:39:33Z</dc:date>
    </item>
    <item>
      <title>I tested (DEBUG) is not</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921098#M85504</link>
      <description>&lt;P&gt;&lt;CODE class="plain"&gt;I tested (DEBUG)&lt;/CODE&gt; is not working. It is true that _DEBUG gets defined by default in Visual Studio if the configuration is DEBUG.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2014 12:33:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921098#M85504</guid>
      <dc:creator>Xj_Kong</dc:creator>
      <dc:date>2014-11-14T12:33:44Z</dc:date>
    </item>
    <item>
      <title>You would test for _DEBUG,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921099#M85505</link>
      <description>&lt;P&gt;_DEBUG is defined if you link to the debug libraries - it is not a sufficient test for a debug configuration. You would probably want to add your own preprocessor symbol to test for configurations.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2014 15:10:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Debug-and-Release-compiler-directives/m-p/921099#M85505</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-11-14T15:10:00Z</dc:date>
    </item>
  </channel>
</rss>

