MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathlink and Intel C++ compiler

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66609] Re: Mathlink and Intel C++ compiler
  • From: Dmitry Garanin <dgaranin at yahoo.com>
  • Date: Mon, 22 May 2006 18:15:10 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Jens and Ulrik,

Thank you for your responses.

I'm trying to compile addtwo from Mathlink samples both on my 64-bit workstation and on my 32-bit laptop. 

Both does not work, unfortunately.

There are several *.lib files in Mathlink directory,
should I call them all in my compile.bat file? 
To avoid this, I've copied all the library files into the working
directory and just added *.lib to the compile-link command.
The *.lib files are found now but I'm recieving an error:

-out:Addtwo.exe 
addtwo.obj 
addtwo.tm.obj 
ml64i2b.lib 
ml64i2c.lib 
ml64i2m.lib 
ml64i2w.lib 
ml64i2b.lib : fatal error LNK1136: invalid or corrupt file

On my laptop there is a similar error with another lib file.

What is wrong?

Please, explain how I can disable the _UNICODE and UNICODE  definitions.
Where they are? 

Here is my complete compile file for the 64-bit workstation, all put together:

****************************************************
@echo off

REM SDK PATH
SET SDKPATH=C:\Program Files\Microsoft Platform SDK
call "C:\Program Files\Microsoft Platform SDK\SetEnv" /X64 /RETAIL


REM INTEL PATH
SET ICPP_COMPILER90=C:\Program Files (x86)\Intel\Compiler\C++\9.0
SET INTEL_DIR=C:\Program Files (x86)\Common Files\Intel

REM MathLink PATH
SET MathLinkPATH=C:\Program Files (x86)\Wolfram Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows-x86-64

REM -----------------------------------------------------------

REM SDK
Set PATH=%SDKPATH%\bin;%PATH%
Set INCLUDE=%SDKPATH%\include;%INCLUDE%
Set LIB=%SDKPATH%\lib;%LIB%


REM MathLink
Set PATH=%MathLinkPATH%\SystemAdditions;%PATH%
Set INCLUDE=%MathLinkPATH%\CompilerAdditions\mldev64\include;%INCLUDE%
Set LIB=%MathLinkPATH%\CompilerAdditions\mldev64\lib;%LIB%
Set LIB=%MathLinkPATH%\SystemAdditions;%LIB%


REM INTEL 
SET INTEL_LICENSE_FILE=%INTEL_DIR%\Licenses
SET PATH=%ICPP_COMPILER90%\EM64T\Bin;%PATH%
SET LIB=%ICPP_COMPILER90%\EM64T\Lib;%LIB%
SET INCLUDE=%ICPP_COMPILER90%\EM64T\Include;%INCLUDE%

REM -----------------------------------------------------------

@ECHO ON
REM Option debug information dans icl : /debug:full /Qinline-debug-info /Qopt-report /Qopt-report-phase hlo /Zi
REM Option Pentium M : /QxB /Qipo

icl /O3 /EHs /W3 /FeAddtwo.exe *.c *.lib > Compile.log

REM link *.obj  /OUT:Addtwo.exe >> Compile.log

del *.obj 

********************************************



*********************************************************

Jens-Peer Kuska wrote:

(Sorry I haven't recieved this email and I'm taking the post from the web)

Hi,

I assume you have added the ml32i2.lib to the Linker input ? and you 
have disabled the _UNICODE and UNICODE  definitions ??
Your
 >   Set Lib=C:\Program Files (x86)\Wolfram 
Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows-x86-64\CompilerAdditions\mldev64\lib;%LIB%

set the library directory but does not set a library.
And you are sure, that you need the 64 Bit library and not
the 32 Bit one ??

Regards
   Jens

Dmitry Garanin wrote:
> Hi all,
>   
>   I am trying to compile Mathematica's Mathlink samples with Intel C++ 9.0 compiler and it does not work. 
>   
>   mprep.exe  produces .tm.c files that contain a lot of functions  (MLCreateMessageHandler et.c)  that turn out to be unresolved  externals on my system. Assuming that these functions belong to the  Mathlink library, I have added the line
>   
>   Set Lib=C:\Program Files (x86)\Wolfram  Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows-x86-64\CompilerAdditions\mldev64\lib;%LIB%
>   
>   to my Compile.bat file. This does not help, I'm having 39 unresolved externals.
>   
>   Any suggestions would be appreciated.
>   
>   Thank you,
>   
>   Dmitry Garanin
  

http://profiles.yahoo.com/dgaranin
--0-1275562862-1148328198=:21539

<pre>Dear Jens and Ulrik,<br><br>Thank you for your responses.<br><br>I'm trying to compile addtwo from Mathlink samples both on my 64-bit workstation and on my 32-bit laptop. <br><br>Both does not work, unfortunately.<br><br>There are several *.lib files in Mathlink directory,<br>should I call them all in my compile.bat file? <br>To avoid this, I've copied all the library files into the working<br>directory and just added *.lib to the compile-link command.<br>The *.lib files are found now but I'm recieving an error:<br><br>-out:Addtwo.exe <br>addtwo.obj <br>addtwo.tm.obj <br>ml64i2b.lib <br>ml64i2c.lib <br>ml64i2m.lib <br>ml64i2w.lib <br>ml64i2b.lib : fatal error LNK1136: invalid or corrupt file<br><br>On my laptop there is a similar error with another lib file.<br><br>What is wrong?<br><br>Please, explain how I can disable the _UNICODE and UNICODE  definitions.<br>Where they are? <br><br>Here is my complete compile file for the 64-bit workstation, all put
 together:<br><br>****************************************************<br>@echo off<br><br>REM SDK PATH<br>SET SDKPATH=C:\Program Files\Microsoft Platform SDK<br>call "C:\Program Files\Microsoft Platform SDK\SetEnv" /X64 /RETAIL<br><br><br>REM INTEL PATH<br>SET ICPP_COMPILER90=C:\Program Files (x86)\Intel\Compiler\C++\9.0<br>SET INTEL_DIR=C:\Program Files (x86)\Common Files\Intel<br><br>REM MathLink PATH<br>SET MathLinkPATH=C:\Program Files (x86)\Wolfram Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows-x86-64<br><br>REM -----------------------------------------------------------<br><br>REM SDK<br>Set PATH=%SDKPATH%\bin;%PATH%<br>Set INCLUDE=%SDKPATH%\include;%INCLUDE%<br>Set LIB=%SDKPATH%\lib;%LIB%<br><br><br>REM MathLink<br>Set PATH=%MathLinkPATH%\SystemAdditions;%PATH%<br>Set INCLUDE=%MathLinkPATH%\CompilerAdditions\mldev64\include;%INCLUDE%<br>Set LIB=%MathLinkPATH%\CompilerAdditions\mldev64\lib;%LIB%<br>Set
 LIB=%MathLinkPATH%\SystemAdditions;%LIB%<br><br><br>REM INTEL <br>SET INTEL_LICENSE_FILE=%INTEL_DIR%\Licenses<br>SET PATH=%ICPP_COMPILER90%\EM64T\Bin;%PATH%<br>SET LIB=%ICPP_COMPILER90%\EM64T\Lib;%LIB%<br>SET INCLUDE=%ICPP_COMPILER90%\EM64T\Include;%INCLUDE%<br><br>REM -----------------------------------------------------------<br><br>@ECHO ON<br>REM Option debug information dans icl : /debug:full /Qinline-debug-info /Qopt-report /Qopt-report-phase hlo /Zi<br>REM Option Pentium M : /QxB /Qipo<br><br>icl /O3 /EHs /W3 /FeAddtwo.exe *.c *.lib &gt; Compile.log<br><br>REM link *.obj  /OUT:Addtwo.exe &gt;&gt; Compile.log<br><br>del *.obj <br><br>********************************************<br><br><br><br>*********************************************************<br><br>Jens-Peer Kuska wrote:<br><br>(Sorry I haven't recieved this email and I'm taking the post from the web)<br><br>Hi,<br><br>I assume you have added the ml32i2.lib to the Linker input ? and you <br>have disabled the
 _UNICODE and UNICODE  definitions ??<br>Your<br> &gt;   Set Lib=C:\Program Files (x86)\Wolfram <br>Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows-x86-64\CompilerAdditions\mldev64\lib;%LIB%<br><br>set the library directory but does not set a library.<br>And you are sure, that you need the 64 Bit library and not<br>the 32 Bit one ??<br><br>Regards<br>   Jens<br><br>Dmitry Garanin wrote:<br>&gt; Hi all,<br>&gt;   <br>&gt;   I am trying to compile Mathematica's Mathlink samples with Intel C++ 9.0 compiler and it does not work. <br>&gt;   <br>&gt;   mprep.exe  produces .tm.c files that contain a lot of functions  (MLCreateMessageHandler et.c)  that turn out to be unresolved  externals on my system. Assuming that these functions belong to the  Mathlink library, I have added the line<br>&gt;   <br>&gt;   Set Lib=C:\Program Files (x86)\Wolfram  Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows-x86-64\CompilerAdditions\mldev64\lib;%LIB%<br>&gt;   <br>&gt;
   to my Compile.bat file. This does not help, I'm having 39 unresolved externals.<br>&gt;   <br>&gt;   Any suggestions would be appreciated.<br>&gt;   <br>&gt;   Thank you,<br>&gt;   <br>&gt;   Dmitry Garanin</pre>  <BR><BR>http://profiles.yahoo.com/dgaranin
--0-1275562862-1148328198=:21539--


  • Prev by Date: Re: Issue
  • Next by Date: Interval[{a,b}]-Interval[{a,b}] = 0?
  • Previous by thread: Re: Mathlink and Intel C++ compiler
  • Next by thread: stytax error