What is the default installation path for Matlab on architecture X?
112 views (last 30 days)
I'm in the process of writing a new FindMatlab.cmake file, as all the versions I've found on the internet have woeful limitations (don't work on Mac, only work for Matlab v7, etc). As part of this, I need a list of install locations for different architectures. As Mathworks doesn't seem to advertise this anywhere, I thought I would try to crowd-source it.
This is where you come in!
Please reply with the full path to the matlab executable on your system. For example, on my Mac this would be: /Applications/MATLAB_R2012b.app/bin/matlab
The architectures I'm looking for are: win32, win64, mac, maci, maci64, glnx, glnx64, sol, sol64, a64. If you have something more exotic, please let me know! The more comprehensive the list, the better FindMatlab.cmake can work :)
Jason Ross on 11 Mar 2013
Edited: Jason Ross on 11 Mar 2013
Install locations have defaults, but these defaults can (and are) changed all the time for various reasons. It's not "advertised", since the OS defaults are used, but then the end-user actually makes the decision where to install the application, like pretty much every other software product -- so there's no way of being 100% accurate in knowing where someone installed it, but that's not going to always be correct.
Also, since installation locations are entirely changeable, be sure to include a "I give up, tell me where your MATLAB is" option. It's also entirely possible to have multiple versions installed, as well -- so discovery of multiple versions and/or an override to specify the one you want is also important.
On Mac, the default is to put it in Applications. But given that OSX is more unix-y, I'd try a command like "which matlab".
On Windows, it goes in Program Files (win32/win64), or Program Files (x86) (32-bit install on 64-bit machine). If I were trying to find an installed anything on Windows, though, I'd use the APIs for Installed Programs and then get the information programmatically, as you don't have to use Program Files or Program Files (x86), and installations may be somewhere else entirely for a multitude of reasons.
(glnx86/glnxa64/sol2/hpux ...), you might look in /opt /usr/bin, /bin, /local, or call "which matlab" and see if you get something -- which you may not, as there may be several MATLABs available to people, and they might need to use an alias or run some sort of script to set their environment before starting MATLAB. This platform gets tricky fast, though, as each vendor/distro might have their own place that's their favorite -- and that favorite might be entirely ignored because the application is installed on a NFS mount with a symlink to /usr/bin.
More Answers (3)
Konrad Malkowski on 12 Mar 2013
One possible approach on linux/mac would be:
> find / -name matlab
This would recursively search the file system for "matlab"
I am sure that similar functionality can be created in PERL or another scripting language.
Shashank Prasanna on 11 Mar 2013