Home My Page Projects MPTK: The Matching Pursuit ToolKit
Summary Activity Forums Tracker Lists Docs News SCM Files

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: Problem matlab install ubuntu [ Reply ]
By: Alejandro Cruz on 2015-09-24 06:31

That worked!

It seems that the problem was with the way i had matlab in the PATH variable. I added the matlab "real" root /usr/local/MATLAB/R2014b/bin and /usr/local/MATLAB/R2014b/bin/glnxa64 (i'm not sure if this one was necessary) to the PATH variable, and everything worked fine (before i only had an alias in usr/local/bin of matlab).
I'm not sure how this worked but it did! :)

Thanks a lot! Sorry for all the trouble!

Seizing this moment, thanks for all the work to make this toolkit posible and available, you guys are making the world whirl!

pd. I had another no so important problem. I used to run matlab as a superuser. To solve that i changed the ownership of the folder ~/.matlab with sudo chown username -R ~/.matlab.
I don't know if that has something to do too.

pd. a more detailed explanation of my actions:

What i did was:
1 - re-install matlab so it'll be in usr/local/ folder has it's suppose to be. After this new installation i had to make an alias of matlab in /usr/local/bin (for some reason the installation didn't do that).

2 - do the steps you mentioned in your email.
With cmake, the temporary message show me the alias root (/usr/local/bin) but still show me the message:
You use a Matlab 32 bits version on a 64 bits OS. MPTK will be compiled in 32 bits to be useble with your Matlab version.
Warning: Matlab MEX compiler is not found, please set the path to Mex compiler or Matlab Mex files will not be compiled
Warning: Matlab scripts implementing 'poor man' versions of MEX-files will be installed, unless you set BUILD_MATLAB_MEX_FILES to ON.

3 - after that I tried with ccmake, but it didn't let me modify MATLAB_ROOT only the paths to mex compiler and several matlab libraries. Which actually were not set.

This make me wonder why it didn't detect all those folders or the version of the matlab (64b) even if it supposedly detected the MATLAB_ROOT, so i went on a little journey through the web and ended up adding the bin root of matlab on the PATH variable, by modifying the .bashrc archive in /home/ and also changed the ownership of the /home/.matlab (I don't remember why I didn't just set the paths. Wasn't very smart, now that i think of it). I also eliminated the alias to matlab in the usr/local/bin folder.

4 - after all this I retried with cmake and it didn't showed me the above message (the MATLAB_ROOT message showed me the root to /usr/local/MATLAB/R2014b/bin). I double check with ccmake and now the paths to the diferent matlab folders and libraries were set, so i used make and everything went well.

Have to add that after this I also tried with the binary way but it didn't work.

RE: Problem matlab install ubuntu [ Reply ]
By: Thomas Gautrais on 2015-09-23 07:25
Hi Alejandro,

Some features have slightly changed for 3 months. With the new version (on Linux), the location of MATLAB_ROOT doesn't matter anymore, because it is automatically found with the "which" command. Therefore, the only restriction is that MATLAB_ROOT/bin must be in the PATH (to check it, just type "which matlab" in an Ubuntu console). Moreover, mex-files should be created directly with the g++ compiler independently of the mex command in Matlab.

After using the "cmake" command, if you use the "ccmake" command, you should be able to modify by yourself the value of MATLAB_ROOT (enter the absolute path of MATLAB_ROOT). Then type "c" to configure. You may need to type "e" to exit help. Then type "g" to generate and exit to return in "normal mode" console.
Type make and mex-file should be generated.


RE: Problem matlab install ubuntu [ Reply ]
By: Alejandro Cruz on 2015-09-21 23:13
Hi Thomas

Thank you for your quick response.

I did what you told me and I'm having the first case you mentioned (no mex files, not even in the build path).

What i understand now is that the matlab root is not detected.
I thought at first that there was a problem with matlab and the c compiler, and yes, it needed an older version of gcc and g++. After i solve that, i also reinstall matlab in the folder mentioned in the user manual (/opt/MATLAB), but in either case matlab is not detected.

I tried to modify a cmake archive (FindMatlab.cmake) to see if i can directly designate the MATLAB_ROOT variable, but that didn't work also (although i don't know if a did it right).

I append by email the archives you ask me for.

Thanks again. Sorry for all the nuisance.

RE: Problem matlab install ubuntu [ Reply ]
By: Thomas Gautrais on 2015-09-21 10:13
Hi Alejandro,

I've tried to reproduce the error you get, but when I compile and install the mptk project, mex-files are correctly generated both in the build and in the install repertories.

Did you check whether the mex-file was generated in the project in typing in an Ubuntu console:
find PATH_TO_MPTK_BUILD -name "getmptkinfo.mexa64" (where PATH_TO_MPTK_BUILD/ is the build directory in which files and directories are created when cmake is running))
If no file has been found, can you build the project in a temporary directory and send the output bu email :
In a linux console :
cd PATH_TO_MPTK_ROOT (PATH_TO_MPTK_ROOT is the dirertory in which the files "mptkTest.cmake", "mp_system.h", "config.h.cmake" are located)
mkdir build_tmp
cd build_tmp
cmake .. &>output_cmake.log && make VERBOSE=1 &> output_make.log
then send by email (to thomas.gautrais@inria.fr) output_cmake.log and output_make.log, generated in build_tmp directory

If the mex-file has been found (with the find command), your error may be because the program cannot find the shared library at runtime. If it is the case, the following error message should be displayed in the Matlab command window when GettingStarted.m is running :
Invalid MEX-file 'PATH_TO_MPTK_BUILD/mptk/matlab/getmptkinfo.mexa64' ?
To correct it, you have to set the environment variable LD_LIBRARY_PATH, whichis used to search for dynamic libraries at runtime :
if Matlab is running, close Matlab. Then open an Ubuntu console and type :
If the problem came from that, add the following line in your ~/.bashrc file :
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:PATH_TO_MPTK_BUILD/lib (in replacing PATH_TO_MPTK_BUILD by the correct absolute path)

If after that, your problem is still not solve, you can send by email the error message displayed in Matlab.


Problem matlab install ubuntu [ Reply ]
By: Alejandro Cruz on 2015-09-19 01:40

I'm having a problem when i try to use mptk in matlab.
When i use the GettingStarted.m script i get an error with the function getmptkinfo.
I'm guessing the problem is that in the folder “path to MPTK/mptk/matlab” there isn't any mex archive (according with the user manual, it should be there).
So, i wonder if anyone have a recommendation or a posible solution that could share.



pd. My OS is ubuntu 14.04LTS, 64bits, with matlab 2014b.