Matlab: Difference between revisions
imported>Mazurel No edit summary |
imported>Nix m add Software/Applications subcategory |
||
Line 53: | Line 53: | ||
If you are using Window Manager and Matlab does not display anything, you will need to use <code>wmname</code> command (preferably when starting your session). Just run <code>wmname LG3D</code>, run Matlab again and the issue should be fixed. | If you are using Window Manager and Matlab does not display anything, you will need to use <code>wmname</code> command (preferably when starting your session). Just run <code>wmname LG3D</code>, run Matlab again and the issue should be fixed. | ||
[[Category:Applications]] |
Revision as of 06:07, 20 September 2021
MATLAB (an abbreviation of "matrix laboratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks.[1]
Installation
Matlab due to it's installation method and licensing is really problematic to package into nixpkgs[2], that is why the only way to install it is to use some imperative way (to install it outside the nix store).
(Recommended) Based on Doronbehar [3] repo (with or without flakes)
You may prefer to use this method by doronbehar. It is based on the one described below, but requires less work.
Based on tviiti[4] repo or custom work (without flakes)
Firstly you need to download zipped Matlab archive for Linux from the official webpage. Then create a folder for the installation files and unzip the archive into that folder via unzip -X -K
command.
Then you will need shell.nix
file that will create proper FHS environment. This shell should use buildFHSUserEnv
function and should contain all the relevant packages. Personally I have used tviti[5] imperative Matlab shell.
Get into the proper environment via nix-shell
. Then you can safely start Matlab installer by running ./install
script in the Matlab installation folder. It is strongly preferred to install Matlab somewhere in the user home folder.
After successful installation, you should add Matlab do your configuration.nix
file. Personally I have used modified tvitii[7] files. I have simply switched runPath
to the path of freshly installed Matlab folder. Then in my configuration.nix I have used his matlab folder like so:
... let tviti-matlab = pkgs.callPackage ./matlab { }; ... in { ... environment.systemPackages = [ ... tviti-matlab.matlab ... ]; ...
Now you should have matlab
in your path and be able to run it via matlab
command.
Weird java errors
In case you have java errors, and you are using tvitii[8] derivation, you may need to modify matlab.nix
to something like this:
{ common, buildFHSUserEnv }: buildFHSUserEnv { name = "matlab"; targetPkgs = pkgs: with pkgs; common.targetPkgs pkgs; runScript = "${common.runPath}/bin/matlab"; }
I can't see anything
If you are using Window Manager and Matlab does not display anything, you will need to use wmname
command (preferably when starting your session). Just run wmname LG3D
, run Matlab again and the issue should be fixed.