<?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 Problem using the mex tool in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-using-the-mex-tool/m-p/759109#M14596</link>
    <description>Hi Fellow developpers,&lt;BR /&gt;

&lt;BR /&gt;

I' m currently trying to use fortran source code in the Matlab software using the mex tool.&lt;BR /&gt;

I'm working on linux, using fedora 15, the 32bits OS.&lt;BR /&gt;

The mex configuration file, mexopts.sh, has the following contents:&lt;BR /&gt;

&lt;BR /&gt;

 FC='ifort'&lt;BR /&gt;

 FFLAGS='-fexceptions'&lt;BR /&gt;

 FFLAGS="$FFLAGS -fPIC"&lt;BR /&gt;

 FLIBS="$RPATH $MLIBS -lm"&lt;BR /&gt;

 FOPTIMFLAGS='-O'&lt;BR /&gt;

 FDEBUGFLAGS='-g'&lt;BR /&gt;

 LD="$COMPILER"&lt;BR /&gt;

 LDEXTENSION='.mexglx'&lt;BR /&gt;

 LDFLAGS="-shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"&lt;BR /&gt;

 LDOPTIMFLAGS='-O'&lt;BR /&gt;

 LDDEBUGFLAGS='-g'&lt;BR /&gt;

 POSTLINK_CMDS=':'&lt;BR /&gt;

&lt;BR /&gt;

I tried to compile the "timestwo.F" example located in "/opt/Matlab/extern/examples/refbook".&lt;BR /&gt;

I successfully manage to create *.mexglx file.&lt;BR /&gt;

The problem occures when I try to use to fortran command in Matlab.&lt;BR /&gt;

I have the following error message:&lt;BR /&gt;

&lt;BR /&gt;

&amp;gt;&amp;gt;timestwo(2)&lt;BR /&gt;

??? Invalid MEX-file '/home/Lopez/CFD/SPARTAN/mex/timestwo.mexglx':&lt;BR /&gt;

/opt/Matlab/bin/glnx86/../../sys/os/glnx86/libifport.so.5: undefined symbol:&lt;BR /&gt;

__FFresetseed.&lt;BR /&gt;

&lt;BR /&gt;

Everything go fine is I use the gfortran compiler instead of ifort in 
the mexopts.sh file (FC='gfortran') and I have the following results:&lt;BR /&gt;

&lt;BR /&gt;&lt;BR /&gt;

&amp;gt;&amp;gt; timestwo(2)&lt;BR /&gt;

ans =&lt;BR /&gt;

 4&lt;BR /&gt;

&lt;BR /&gt;

Did I misted something with the ifort compiler ?&lt;BR /&gt;

Thanks.&lt;BR /&gt;</description>
    <pubDate>Mon, 31 Oct 2011 10:51:06 GMT</pubDate>
    <dc:creator>FlyingHermes</dc:creator>
    <dc:date>2011-10-31T10:51:06Z</dc:date>
    <item>
      <title>Problem using the mex tool</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-using-the-mex-tool/m-p/759109#M14596</link>
      <description>Hi Fellow developpers,&lt;BR /&gt;

&lt;BR /&gt;

I' m currently trying to use fortran source code in the Matlab software using the mex tool.&lt;BR /&gt;

I'm working on linux, using fedora 15, the 32bits OS.&lt;BR /&gt;

The mex configuration file, mexopts.sh, has the following contents:&lt;BR /&gt;

&lt;BR /&gt;

 FC='ifort'&lt;BR /&gt;

 FFLAGS='-fexceptions'&lt;BR /&gt;

 FFLAGS="$FFLAGS -fPIC"&lt;BR /&gt;

 FLIBS="$RPATH $MLIBS -lm"&lt;BR /&gt;

 FOPTIMFLAGS='-O'&lt;BR /&gt;

 FDEBUGFLAGS='-g'&lt;BR /&gt;

 LD="$COMPILER"&lt;BR /&gt;

 LDEXTENSION='.mexglx'&lt;BR /&gt;

 LDFLAGS="-shared -m32 -Wl,--version-script,$TMW_ROOT/extern/lib/$Arch/$MAPFILE -Wl,--no-undefined"&lt;BR /&gt;

 LDOPTIMFLAGS='-O'&lt;BR /&gt;

 LDDEBUGFLAGS='-g'&lt;BR /&gt;

 POSTLINK_CMDS=':'&lt;BR /&gt;

&lt;BR /&gt;

I tried to compile the "timestwo.F" example located in "/opt/Matlab/extern/examples/refbook".&lt;BR /&gt;

I successfully manage to create *.mexglx file.&lt;BR /&gt;

The problem occures when I try to use to fortran command in Matlab.&lt;BR /&gt;

I have the following error message:&lt;BR /&gt;

&lt;BR /&gt;

&amp;gt;&amp;gt;timestwo(2)&lt;BR /&gt;

??? Invalid MEX-file '/home/Lopez/CFD/SPARTAN/mex/timestwo.mexglx':&lt;BR /&gt;

/opt/Matlab/bin/glnx86/../../sys/os/glnx86/libifport.so.5: undefined symbol:&lt;BR /&gt;

__FFresetseed.&lt;BR /&gt;

&lt;BR /&gt;

Everything go fine is I use the gfortran compiler instead of ifort in 
the mexopts.sh file (FC='gfortran') and I have the following results:&lt;BR /&gt;

&lt;BR /&gt;&lt;BR /&gt;

&amp;gt;&amp;gt; timestwo(2)&lt;BR /&gt;

ans =&lt;BR /&gt;

 4&lt;BR /&gt;

&lt;BR /&gt;

Did I misted something with the ifort compiler ?&lt;BR /&gt;

Thanks.&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Oct 2011 10:51:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-using-the-mex-tool/m-p/759109#M14596</guid>
      <dc:creator>FlyingHermes</dc:creator>
      <dc:date>2011-10-31T10:51:06Z</dc:date>
    </item>
    <item>
      <title>Problem using the mex tool</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-using-the-mex-tool/m-p/759110#M14597</link>
      <description>MATLAB only supports specific versions of the Intel compiler (often older versions only). You should check their website and your MATLAB documents for required IFORT version(s). &lt;BR /&gt;&lt;BR /&gt;To get older compilers (often needed for MATLAB), read this: &lt;A href="http://software.intel.com/en-us/articles/older-version-product/"&gt;http://software.intel.com/en-us/articles/older-version-product/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I'm no MATLAB expert, but just looking at the error looks like MATLAB is picking up library ifcore.so.5 from a matlab directory and NOT the Intel compiler library directory. 'libifcore' is the Intel Fortran runtime library. It looks like MATLAB packaged one with their kit. HOWEVER, their version may be from the 11.1 compiler or older. Again, what version of the Intel compiler are you using and is it supported by Mathworks? You cannot mix and match versions. &lt;BR /&gt;&lt;BR /&gt;On thing to try is to make sure the Intel library path to the compiler comes BEFORE the MATLAB path. Try this before running matlab&lt;BR /&gt;&lt;BR /&gt;source /opt/intel/bin/compilervarsh.sh intel64&lt;BR /&gt;&lt;BR /&gt;this is for the 12.x compilers. In the 11.1 compilers you source '&lt;COMPILER path=""&gt;/bin/ifortvars.sh intel64'&lt;BR /&gt;&lt;BR /&gt;Again, the key is to find your version of MATLAB, consult your MATLAB requirements doc(s) or README(s) to find out what version of the Intel compiler is supported, and get that version of the Intel compiler.&lt;BR /&gt;&lt;BR /&gt;ron&lt;BR /&gt;&lt;BR /&gt;&lt;/COMPILER&gt;</description>
      <pubDate>Mon, 31 Oct 2011 20:54:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-using-the-mex-tool/m-p/759110#M14597</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2011-10-31T20:54:03Z</dc:date>
    </item>
    <item>
      <title>Problem using the mex tool</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-using-the-mex-tool/m-p/759111#M14598</link>
      <description>&lt;I&gt;&amp;gt; On thing to try is to make sure the Intel library path to the compiler comes BEFORE the MATLAB path. &lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;Not always. If the user has DLLs that came with Matlab and were compiled with an older version of Intel Fortran, those DLLs will contain references to the runtime DLLs of that old version. Resolving them with identically named entry points in a newer Intel Fortran DLL may cause problems. It is tricky to combine runtime libraries from two different versions of Intel Fortran into the same MEX executable.&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Nov 2011 04:28:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-using-the-mex-tool/m-p/759111#M14598</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-11-01T04:28:31Z</dc:date>
    </item>
  </channel>
</rss>

