<?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 Re: How to include c-file in Fortran code? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864366#M70173</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;It is possible that they provide two different files named mat.h, one for Fortran and one for C. Would you please attach the mat.h you think is being used? If it mostly looks like Fortran but has lines starting with #, you need to enable the preprocessor in the Fortran project properties, Preprocessor property page.&lt;BR /&gt;</description>
    <pubDate>Wed, 23 Sep 2009 14:11:05 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2009-09-23T14:11:05Z</dc:date>
    <item>
      <title>How to include c-file in Fortran code?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864364#M70171</link>
      <description>Hi,&lt;BR /&gt;I'm a Fortran-newbie and need to include a file 'mat.h' in my Fortran code (ifort with Visual Studio). This file is provided by Mathworks to enable Fortran to commands for generating Matlab data-files (.mat). &lt;BR /&gt;'mat.h' ist expilcitly made to be included in C or Fortran code. I'm sure that in C it won't be to hard to do so. But with Fortran i get "bad precompiler" errors.&lt;BR /&gt;So my question is how to make ifort compile the mixed code properly?&lt;BR /&gt;Thank you very much and best regards,&lt;BR /&gt;Eli</description>
      <pubDate>Wed, 23 Sep 2009 13:20:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864364#M70171</guid>
      <dc:creator>fortran_eli</dc:creator>
      <dc:date>2009-09-23T13:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to include c-file in Fortran code?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864365#M70172</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/444356"&gt;fortran_eli&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hi,&lt;BR /&gt;I'm a Fortran-newbie and need to include a file 'mat.h' in my Fortran code (ifort with Visual Studio). This file is provided by Mathworks to enable Fortran to commands for generating Matlab data-files (.mat). &lt;BR /&gt;'mat.h' ist expilcitly made to be included in C or Fortran code. I'm sure that in C it won't be to hard to do so. But with Fortran i get "bad precompiler" errors.&lt;BR /&gt;So my question is how to make ifort compile the mixed code properly?&lt;BR /&gt;Thank you very much and best regards,&lt;BR /&gt;Eli&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
You'll need to refer to their documentation. The file which is included in Fortran must have Fortran syntax, so it can't be the same one which you include in C.&lt;BR /&gt;By the way, there are 2 common modes of include files in Fortran. There is the Fortran standard INCLUDE which doesn't take effect during pre-processing, and the cpp style #include which is expanded during pre-processing (a de facto standard, not a Fortran standard). So it is doubly important that you follow their examples.&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Sep 2009 13:52:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864365#M70172</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-09-23T13:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to include c-file in Fortran code?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864366#M70173</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;It is possible that they provide two different files named mat.h, one for Fortran and one for C. Would you please attach the mat.h you think is being used? If it mostly looks like Fortran but has lines starting with #, you need to enable the preprocessor in the Fortran project properties, Preprocessor property page.&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Sep 2009 14:11:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864366#M70173</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-09-23T14:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to include c-file in Fortran code?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864367#M70174</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/444356"&gt;fortran_eli&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Hi,&lt;BR /&gt;I'm a Fortran-newbie and need to include a file 'mat.h' in my Fortran code (ifort with Visual Studio). This file is provided by Mathworks to enable Fortran to commands for generating Matlab data-files (.mat). &lt;BR /&gt;'mat.h' ist expilcitly made to be included in C or Fortran code. I'm sure that in C it won't be to hard to do so. But with Fortran i get "bad precompiler" errors.&lt;BR /&gt;So my question is how to make ifort compile the mixed code properly?&lt;BR /&gt;Thank you very much and best regards,&lt;BR /&gt;Eli&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;mat.h is only for C or C++ programs - it contains C source code such as function and type declarations that a Fortran compiler would not understand. &lt;BR /&gt;&lt;BR /&gt;The name of the file you #include for fortran sources is "fintrf.h". This file only contains preprocessor "instruction" lines, such as "#define MWPOINTER INTEGER*4". You will need to enable the preprocessor in Intel Fortran in order to compile source files that have the relevant #include "fintrf.h" line.&lt;BR /&gt;&lt;BR /&gt;Your Matlab installation and documentation includes a number of fortran source code examples. &lt;BR /&gt;&lt;BR /&gt;(Rant about the lack of a modern Fortran interface into Matlab (almost) suppressed).&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Sep 2009 03:21:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864367#M70174</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2009-09-24T03:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to include c-file in Fortran code?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864368#M70175</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/212570"&gt;IanH&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;Thank you all for your quick and very &lt;EM&gt;professional answers to my question.&lt;BR /&gt;The inclusion of the right file for Fortran code fintr.h (instead of mat.h which is for C) and setting up the ifort preprocessor and the linker in MS Visual Studio (switch on preprocessor, add directories of additional MS and Matlab libraries, add addit. dependencies) finally solved it. Mathworks really should improve their Matlab documantation in that topic - it was no help at all but confusing.&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Sep 2009 13:47:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-include-c-file-in-Fortran-code/m-p/864368#M70175</guid>
      <dc:creator>fortran_eli</dc:creator>
      <dc:date>2009-09-24T13:47:23Z</dc:date>
    </item>
  </channel>
</rss>

