CPLEX Installation

From TomWiki
Jump to navigationJump to search

Notice.png

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

Windows Systems

TOMLAB /CPLEX is installed by the general TOMLAB exe installer and can be installed with or without the TOMLAB Base Module. In either case, the folders tomlab\cplex and possibly also a tomlab\shared are created.

The tomlab\shared folder contains the cplex\*.dll and must be installed on machine without an existing ILOG CPLEX installation. The installer automatically adds the location of this folder to the Windows PATH variable.

If installing TOMLAB /CPLEX together with other TOMLAB packages, the tomlab\startup.m file will automat- ically detect TOMLAB /CPLEX and set the MATLAB path accordingly.

You may also set the TOMLAB and TOMLAB /CPLEX 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 /CPLEX is installed together with the rest of TOMLAB when extracting the tomlab-<arch>-setup.tar.gz file. If ILOG CPLEX is not already installed on the computer, 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 /CPLEX together with the TOMLAB Base Module, execute the tomlab/startup script, which automatically recognizes the presence of the cplex subdirectory.

To use TOMLAB /CPLEX by itself, execute only the tomlab/cplex/startup script.

Troubleshooting

Error messages like the following:

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

??? Invalid  MEX-file

or, on Unix systems:

>> cplexmex
Unable to  load  mex  file: /home/user/tomlab/cplex/cplexmex.mexglx. libcplex91.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 cplex\*.dll (libcplex\*.so) file on systems where ILOG CPLEX is already installed.