Difference between revisions of "Support:Tech notes"

From COMKAT wiki
Jump to navigation Jump to search
Line 3: Line 3:
 
# Go to http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18508&objectType=file and copy the x64 mex option files under the MATLABROOT\bin\win64\mexopts.
 
# Go to http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18508&objectType=file and copy the x64 mex option files under the MATLABROOT\bin\win64\mexopts.
 
# Do a mex -setup. Let Matlab locate the installed compiler. Select "Microsoft Visual C++ 2008".
 
# Do a mex -setup. Let Matlab locate the installed compiler. Select "Microsoft Visual C++ 2008".
# Use mex command to compile a simple file. You get the following error <pre>  C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL:   
+
# Use mex command to compile a simple file. You get the following error  
  Error: Using options file:  
+
<pre>   
 +
C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL:   
 +
Error: Using options file:  
 
         C:\Users\deancool\AppData\Roaming\MathWorks\MATLAB\R2007b\mexopts.bat  
 
         C:\Users\deancool\AppData\Roaming\MathWorks\MATLAB\R2007b\mexopts.bat  
 
         You cannot use this file with the WIN64 architecture because it enables  
 
         You cannot use this file with the WIN64 architecture because it enables  
 
         a compiler for a different architecture.  
 
         a compiler for a different architecture.  
         Running mex -setup may resolve this problem. </pre>
+
         Running mex -setup may resolve this problem.  
 +
</pre>
 
# Now locate your mexopts.bat file. Edit the following lines:
 
# Now locate your mexopts.bat file. Edit the following lines:
 
## Line 17 (set PATH): add '\amd64' after ''set PATH=%VCINSTALLDIR%\BIN\''
 
## Line 17 (set PATH): add '\amd64' after ''set PATH=%VCINSTALLDIR%\BIN\''

Revision as of 17:40, 27 February 2008

Mex and compiler setting

How to set up mex compiler on a 64-bit Matlab using Visual Studio 2008 Professional

  1. Go to http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18508&objectType=file and copy the x64 mex option files under the MATLABROOT\bin\win64\mexopts.
  2. Do a mex -setup. Let Matlab locate the installed compiler. Select "Microsoft Visual C++ 2008".
  3. Use mex command to compile a simple file. You get the following error
  
C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL:  
Error: Using options file: 
         C:\Users\deancool\AppData\Roaming\MathWorks\MATLAB\R2007b\mexopts.bat 
         You cannot use this file with the WIN64 architecture because it enables 
         a compiler for a different architecture. 
         Running mex -setup may resolve this problem. 
  1. Now locate your mexopts.bat file. Edit the following lines:
    1. Line 17 (set PATH): add '\amd64' after set PATH=%VCINSTALLDIR%\BIN\
    2. Line 19 (set LIB): add '\amd64' after set LIB=%VCINSTALLDIR%\ATLMFC\LIB and %VCINSTALLDIR%\LIB. Add '\x64' after C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib
    3. Line 20: set MW_TARGET_ARCH=win64
    4. Line 34: set LIBLOC=%MATLAB%\extern\lib\win64\microsoft
    5. Line 36: /MACHINE:X64

How to set up mex compiler on a 64-bit Matlab using MinGW

How to set up the C compiler from Visual Studio 2008 on a 64-bit Windows system

  1. Go to control->system->environmental variables. Edit 'path' and add the following dir: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64
  2. Go to control->system->environmental variables. Edit 'LIB' and add the following dir: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\amd64

Or go to C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64 and run vcvarsamd64.bat

How to set up the C compiler from MinGW on a 64-bit Windows system

== How to compile cvOdesGenMod5.c

Windows

1. Enter COMKATROOT\CVODESserial-2.3.0-2005\sundials\cvodes\source. Run:

cl /c /I..\include /I..\..\shared\include *.c
lib /out:cvodes.lib *.obj

Copy cvodes.lib to the COMKATROOT\lib\win64 folder (change win64 according to your system) 2. Enter COMKATROOT\CVODESserial-2.3.0-2005\sundials\shared\source. Run:

cl /c /I..\include  *.c
lib /out:sundials.lib *.obj

Copy sundials.lib to the COMKATROOT\lib\win64 folder (change win64 according to your system) 3. Enter COMKATROOT\CVODESserial-2.3.0-2005\sundials\nvec_ser. Run

cl /c /I..\shared\include  *.c
lib /out:nvec_ser.lib *.obj

Copy nvec_ser.lib to the COMKATROOT\lib\win64 folder (change win64 according to your system) 4.