GUROBI Installation

From TomWiki
Jump to navigationJump to search

Notice.png

This page is part of the GUROBI Manual. See GUROBI.

Windows Systems

TOMLAB /GUROBI is installed by the general TOMLAB exe installer. The folders tomlab\gurobi and also tomlab\shared are created.

The tomlab\shared folder contains the gurobi*.dll and must be installed. The installer automatically adds the location of this folder to the Windows PATH variable (a computer reboot is recommended).

If installing TOMLAB /GUROBI together with other TOMLAB packages, the tomlab\startup.m file will automatically detect TOMLAB /GUROBI and set the MATLAB path accordingly.

You may also set the TOMLAB and TOMLAB /GUROBI paths permanently in the Matlab system. To find out which paths are used, run the startup commands as described above, then use the path command to see what paths TOMLAB created and set these permanently on your system. See the Matlab documentation on how to set Matlab paths.

Unix/Linux Systems

TOMLAB /GUROBI is installed together with the rest of TOMLAB when extracting the tomlab-<arch>-setup.tar.gz file. The user must set/modify the LD LIBRARY PATH environment variable in order for the runtime linking to work as intended. Assuming that TOMLAB is extracted to $HOME/tomlab/shared, do:

#
# csh/tcsh shells:
#
setenv  LD_LIBRARY_PATH  $HOME/tomlab/shared:$LD_LIBRARY_PATH

#
# bash and compatible shells:
#

export   LD_LIBRARY_PATH=$HOME/tomlab/shared:$LD_LIBRARY_PATH

To use TOMLAB /GUROBI together with the TOMLAB Base Module, execute the tomlab/startup script, which automatically recognizes the presence of the GUROBI subdirectory.

Troubleshooting

Error messages like the following:

>> grbmex

Unable to  load  mex  file: d:\program files\tomlab\gurobi\grbmex.dll. 
The specified module could  not  be found.

??? Invalid  MEX-file

or, on Unix systems:

>> grbmex
Unable to load mex file: /home/user/tomlab/gurobi/grb.mexglx. 
libgurobi*.so: cannot open shared object file:
No such file or directory
??? Invalid MEX-file

indicate a problem with the PATH variable on Windows systems, or equivalently the $LD LIBRARY PATH variable in Unix/Linux.

You can check from within Matlab that the path has been set correctly, by executing

>> getenv('PATH')	        %   Windows

>> getenv('LD_LIBRARY_PATH')	%   Unix/Linux

The location of the tomlab/shared directory must be included in the result, OR, the location of the gurobi\*.dll (gurobi\*.so) file on systems where GUROBI is already installed.