- MATLAB 2017a+ (tested; but must already be installed by another Linux Distribution)
- Docker, if not using NixOS
In short:
source build.sh
orsource pull.sh
../run.sh
- Proceed to the Nix instructions below
nix-shell default.nix
matlab -glnxa64
IMPORTANT Caveat: If it is necessary to specify the -glnxa64
option,
the matlab
shell script should instead be modified to hardcode ARCH
as
glnxa64
. Aside from convenience, certain APIs like the MATLAB Engine API
will not always work otherwise.
Alternatively, append -nodesktop -nodisplay
to the `matlab** command
when running in the terminal.
Important: You must execute the nix-shell default.nix
command
from the same directory specified above, as that directory
contains another script that must be run.
If you are wanting a single script to do all this for you, do e.g.:
#!/usr/bin/env bash
cd /home/bebarker/workspace/COBRAContainers && \
nix-shell default.nix --run "matlab -glnxa64"
You can omit using the script if you have other ways to change the working directory, in e.g. desktop icon-based launchers.
In the nix-shell enviroment:
mkdir -p ~/Documents/MATLAB
cp $GUROBI_HOME/examples/matlab/mip1.m ~/Documents/MATLAB/
echo $GUROBI_HOME
In matlab (started from the nix-shell environment)
cd
to that directory (obtained fromecho $GUROBI_HOME
) in MATLAB, thencd matlab
gurobi_setup
- Type
savepath
as instructed cd ~/Documents/MATLAB/
mip1
You should see a solution printed out.