Difference between revisions of "Support:Tech notes"
Jocurimario (talk | contribs) |
Funnyjokey (talk | contribs) m |
||
Line 1: | Line 1: | ||
== Mex and compiler setting == | == Mex and compiler setting == | ||
==== How to set up mex compiler on a 64-bit Matlab using Visual Studio 2008 | ==== How to set up mex compiler on a 64-bit Matlab using Visual Studio 2008 | ||
− | [http://www.jocurimario.biz <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;position:absolute;top:-999px;">jocuri mario</span>] | + | [http://www.jocurimario.biz <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;position:absolute;top:-999px;">jocuri mario</span>]<span class="plainlinks">[http://itshumour.blogspot.com/2010/06/twenty-hilarious-funny-quotes.html <span style="color:#FEFEFE;font-weight:normal; text-decoration:none!important;background:none!important; text-decoration:none;">funny quotes</span>] |
− | # When you install Visual Studio 2008, | + | # When you install Visual Studio 2008, <span class="plainlinks">[http://itshumour.blogspot.com/2011/08/funny-statuses-quotes-for-facebook.html <span style="color:#000000;font-weight:normal; text-decoration:none!important;background:none!important; text-decoration:none;">funny status for facebook</span>]I recommend install 'Full' so that you aresure the 64-bit compilers and libraries are installed. |
# Go to http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18508&objectType=file. Download, uncompress 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. Download, uncompress and copy the x64 mex option files under the MATLABROOT\bin\win64\mexopts. | ||
− | # Do a mex -setup. Let Matlab locate <span class="plainlinks">[http:// | + | # Do a mex -setup. Let Matlab locate <span class="plainlinks">[http://itshumour.blogspot.com/2011/07/funny-marriage-jokes.html <span style="color:#000000;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">funny jokes</span>] the installed compiler. Select "Microsoft Visual C++ 2008". |
− | # Use | + | # Use mex command to compile a simple file. You get the following error |
<pre> | <pre> | ||
C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL: | C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL: | ||
Line 13: | Line 13: | ||
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 | + | Running mex -setup may resolve this problem. |
− | [http://www.jocurimario.biz <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;position:absolute;top:-999px;">jocuri mario</span>] | + | [http://www.jocurimario.biz <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;position:absolute;top:-999px;">jocuri mario</span>]<span class="plainlinks">[http://itshumour.blogspot.com/2009/09/top-10-hilarious-quotes.html <span style="color:#FEFEFE;font-weight:normal; text-decoration:none!important;background:none!important; text-decoration:none;">hilarious quotes</span>] |
</pre> | </pre> | ||
<p>To fix this error: | <p>To fix this error: | ||
− | # Locate your mexopts.bat file. Edit the following | + | # 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\'' | ||
## 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'' | ## 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'' | ||
Line 24: | Line 24: | ||
## Line 34: set LIBLOC=%MATLAB%\extern\lib\win'''64'''\microsoft | ## Line 34: set LIBLOC=%MATLAB%\extern\lib\win'''64'''\microsoft | ||
## Line 36: /MACHINE:'''X64''' | ## Line 36: /MACHINE:'''X64''' | ||
− | [http:// | + | <span class="plainlinks">[http://dentaldentistsolutions.blogspot.com/2009/10/process-and-pictures-dental-implants.html <span style="color:#FEFEFE;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;">dental implants pictures</span>] |
− | NOTE: Environment - Windows Vista 64-bit, | + | NOTE: Environment - Windows Vista 64-bit, |
− | My mexopts.bat file: [[Image:Mexopts.zip] | + | My mexopts.bat file: [[Image:Mexopts.zip]] |
==== How to set up the C compiler from Visual Studio 2008 on a 64-bit Windows system ==== | ==== How to set up the C compiler from Visual Studio 2008 on a 64-bit Windows system ==== | ||
− | # Go to | + | # 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 <span class="plainlinks">[http://itshumour.blogspot.com/2009/05/crazy-artistic-tattoos.html <span style="color:#fefefe;font-weight:normal; text-decoration:none!important;background:none!important; text-decoration:none;">crazy tattoos</span>] |
# 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 | # 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 <span class="plainlinks">[http:// | + | Or go to <span class="plainlinks">[http://bit.ly/dt3ruz <span style="color:#000000;font-weight:normal; text-decoration:none!important;background:none!important; text-decoration:none;">funny quotes</span>] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64 and run vcvarsamd64.bat |
== How to compile cvOdesGenMod5.c == | == How to compile cvOdesGenMod5.c == | ||
Line 46: | Line 46: | ||
lib /out:sundials.lib *.obj</pre> | lib /out:sundials.lib *.obj</pre> | ||
Copy sundials.lib to the COMKATROOT\lib\win64 folder (change win64 according to your system) | 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 | + | 3. Enter COMKATROOT\CVODESserial-2.3.0-2005\sundials\nvec_ser. Run |
− | <pre>cl /c /I..\shared\include *.c | + | <pre>cl /c /I..\shared\include *.c [http://is.gd/i7jP4M funny facebook status] |
lib /out:nvec_ser.lib *.obj</pre> | lib /out:nvec_ser.lib *.obj</pre> | ||
Copy nvec_ser.lib to the COMKATROOT\lib\win64 folder (change win64 according to your system) | Copy nvec_ser.lib to the COMKATROOT\lib\win64 folder (change win64 according to your system) | ||
− | Also check [http:// | + | Also check [http://goo.gl/PKsQv funny jokes] in order to be relaxed and fresh. |
==== Linux ==== | ==== Linux ==== | ||
− | NOTE: Under 64-bit Ubuntu and 64-bit Matlab, you have to do thefollowing changes to make the mex | + | NOTE: Under 64-bit Ubuntu and 64-bit Matlab, you have to do thefollowing changes to make the mex [http://dentaldentistsolutions.blogspot.com/2009/10/process-and-pictures-dental-implants.html dental implants] |
Line 62: | Line 62: | ||
− | == How to prepare a COMKAT release == | + | == How to prepare a COMKAT release == |
<br> | <br> | ||
<br> | <br> | ||
Line 77: | Line 77: | ||
123.456.78.9 HEADNODE | 123.456.78.9 HEADNODE | ||
− | Contact Dean or Dr. Muzic to get the right information http:// | + | Contact Dean or Dr. Muzic to get the right information http://bit.ly/1AHm7r |
The 'hosts' file can be found at '/etc/' in Macs and '/Windows/System32/drivers/etc/' in Windows-based PCs. | The 'hosts' file can be found at '/etc/' in Macs and '/Windows/System32/drivers/etc/' in Windows-based PCs. | ||
Line 84: | Line 84: | ||
3. Now the findResource command should work without any problem. | 3. Now the findResource command should work without any problem. | ||
− | + | ||
== MATLAB Compiler == | == MATLAB Compiler == | ||
Line 103: | Line 103: | ||
<pre>0</pre> | <pre>0</pre> | ||
You would have to exit this folder in order to call this function. | You would have to exit this folder in order to call this function. | ||
− | <br>Therefore, if you do use which and cd to find files and enter a certain | + | <br>Therefore, if you do use which and cd to find files and enter a certain directory, it is recommended that you do it this way: |
<pre>if ~isdeployed | <pre>if ~isdeployed | ||
cd(fileparts(which('main_GUI'))) | cd(fileparts(which('main_GUI'))) | ||
end</pre> | end</pre> | ||
So that you don't run into errors... | So that you don't run into errors... | ||
− | + | ||
== uitable errors when deployed == | == uitable errors when deployed == | ||
Line 135: | Line 135: | ||
<div class="right" > | <div class="right" > | ||
<ul style="display:none;"> | <ul style="display:none;"> | ||
− |
Revision as of 11:11, 27 November 2011
Mex and compiler setting
==== How to set up mex compiler on a 64-bit Matlab using Visual Studio 2008 jocuri mariofunny quotes
- When you install Visual Studio 2008, funny status for facebookI recommend install 'Full' so that you aresure the 64-bit compilers and libraries are installed.
- Go to http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18508&objectType=file. Download, uncompress and copy the x64 mex option files under the MATLABROOT\bin\win64\mexopts.
- Do a mex -setup. Let Matlab locate funny jokes the installed compiler. Select "Microsoft Visual C++ 2008".
- 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. [http://www.jocurimario.biz <span style="color:black;font-weight:normal; text-decoration:none!important; background:none!important; text-decoration:none;position:absolute;top:-999px;">jocuri mario</span>]<span class="plainlinks">[http://itshumour.blogspot.com/2009/09/top-10-hilarious-quotes.html <span style="color:#FEFEFE;font-weight:normal; text-decoration:none!important;background:none!important; text-decoration:none;">hilarious quotes</span>]
To fix this error:
- Locate your mexopts.bat file. Edit the following lines:
- Line 17 (set PATH): add '\amd64' after set PATH=%VCINSTALLDIR%\BIN\
- 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
- Line 20: set MW_TARGET_ARCH=win64
- Line 34: set LIBLOC=%MATLAB%\extern\lib\win64\microsoft
- Line 36: /MACHINE:X64
How to set up the C compiler from Visual Studio 2008 on a 64-bit Windows system
- 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 crazy tattoos
- 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 funny quotes C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64 and run vcvarsamd64.bat
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 [http://is.gd/i7jP4M funny facebook status] lib /out:nvec_ser.lib *.obj
Copy nvec_ser.lib to the COMKATROOT\lib\win64 folder (change win64 according to your system)
Also check funny jokes in order to be relaxed and fresh.
Linux
NOTE: Under 64-bit Ubuntu and 64-bit Matlab, you have to do thefollowing changes to make the mex dental implants
- Edit the mexopts.sh and remove all -lstdc++
- Edit the cvodesGenmod5.c. Find function 'clear' and remove the 'static' declaration.
- When you use gcc to compile, add a flag '-fPIC'.
How to prepare a COMKAT release
CCIR-specific settings for MATLAB distributed computing server
1. On the client side, edit the file 'hosts' and add a line
<THE SERVER IP ADDRESS> <SERVER NAME>
such as:
123.456.78.9 HEADNODE
Contact Dean or Dr. Muzic to get the right information http://bit.ly/1AHm7r
The 'hosts' file can be found at '/etc/' in Macs and '/Windows/System32/drivers/etc/' in Windows-based PCs.
2. On the server side, edit the 'hosts' file. Do the same thing to add the ip and computer name of the client to this file.
3. Now the findResource command should work without any problem.
MATLAB Compiler
Weird behavior of path settings for compiled MATLAB applications
__ For example, compiled main_GUI.m under c:\comkat\comkat_GUI\ and set the output directory to be c:\compiled_dir\. Before being compiled, the output to which('main_GUI') returns:
c:\comkat\comkat_GUI\
After being compiled, the same command returns:
c:\compiled_dir\main_GUI_mcr\main_GUI\
You have to be careful because if you are calling another function, for example, loadModelTemplate.m from main_GUI. If the directory is not switched, there should not be a problem. But if you switch to the directory of main_GUI.m, different behavior happens.
The commands executed are:
cd(fileparts(which('main_GUI'))) x = loadModelTemplate
Under MATLAB, x will be returned properly; However, under compiled MATLAB application, it returns:
Undefined function or variable 'loadModelTemplate'
The reason is that, under compiled MATLAB applications, fileparts(which('main_GUI')) returns the directory of c:\compiled_dir\main_GUI_mcr\main_GUI\ that contains all the encrypted m-files. Once you switch to this folder, although you will find a file called loadModelTemplate, or function won't be able to be called. The command exist('loadModelTemplate') returns
0
You would have to exit this folder in order to call this function.
Therefore, if you do use which and cd to find files and enter a certain directory, it is recommended that you do it this way:
if ~isdeployed cd(fileparts(which('main_GUI'))) end
So that you don't run into errors...
uitable errors when deployed
For MATLAB 2008a and earlier, uitable errors when it is compiled with Matlab Compiler.
To fix this follow http://www.mathworks.cn/support/bugreports/details.html?rp=449936