In short:
source build.sh
or source pull.sh
../run.sh
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 from echo $GUROBI_HOME
) in MATLAB, then cd matlab
gurobi_setup
savepath
as instructedcd ~/Documents/MATLAB/
mip1
You should see a solution printed out.