Hellwalker / randomforest-matlab

Automatically exported from code.google.com/p/randomforest-matlab
0 stars 0 forks source link

Compiling RF on Ubuntu #27

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.MatLab + Ubuntu
2.Run compile_linux.m

What is the expected output? What do you see instead?
A wonderful mex file

What version of the product are you using? On what operating system?
Ubuntu, gcc 4.4, matlab 2011

Two problems in my case:
1. mex calls the LateX mex instead of the Matlab one => change the makefile to 
the one attached that calls the Matlab Mex in the Matlab bin directory (the 
path will be different on other plateforms)
2. Matlab complains about the gcc version 4.4 so you need to follow the 
instructions [http://ubuntuforums.org/showthread.php?t=1413330 here]:
Code:
> sudo mv /usr/bin/gcc /usr/bin/gcc_mybackup
> sudo ln -s /usr/bin/gcc-'_what ever compliant version of gcc_' /usr/bin/gcc
*Compile your mex here*
and retore the gcc
> sudo mv /usr/bin/gcc_mybackup /usr/bin/gcc

Original issue reported on code.google.com by Louis.MA...@gmail.com on 5 Mar 2012 at 4:49

Attachments:

GoogleCodeExporter commented 8 years ago
thanks for the information

matlab is usually kind to not cause issues if the compiler version dont match. 
i currently run all my code on gcc-4.6 when the max supported is gcc-4.3. maybe 
mex -setup has to be run to generate compiler specific option file. you can 
even hack the mex file if you dont want to change the system path all the time. 
the mexopts.sh file that contains what options+gcc to use is 
~/.matlab/R<>/mexopts.sh and search for gcc, g++. R<> is R2010b for the 2010b 
release of matlab

about the mex file, i guess matlab is not in the system path or in the path 
after the mex from latex. i'll note down this info within the wiki.

thanks!

Original comment by abhirana on 7 Mar 2012 at 4:23