lundi 14 mars 2011

how to install cplex on unix-based machine

========================
first of all, you have to get
    - the distribution cplex122.x86linux.tar.gz and
    - an authentication file: access_122.ilm.

then, extract the cplex122.x86linux.tar.gz to any path you wish on your computer's disk.

next, set up an environment variable: ILOG_LICENSE_FILE which point to the access_122.ilm file.

up to now, the compiler is installed, you will have the following file structure:

    - <cplex_installed_path>
        - concert27
        - cplex122

to verify the installation:
    - go to <cplex_installed_path>/cplex122/bin/x86_darwin8_gcc4.0/ in the terminal;
    - run ./cplex to start the interactive optimizer.

if you can see the following screen, it means the cplex is well installed:

ILOG CPLEX 11.210, licensed to "inria-grenoble", options: e m b q use=10 MaintenanceEnd=20110330

Welcome to CPLEX Interactive Optimizer 11.2.1
  with Simplex, Mixed Integer & Barrier Optimizers
Copyright (c) ILOG 1997-2008
CPLEX is a registered trademark of ILOG

Type 'help' for a list of available commands.
Type 'help' followed by a command name for more
information on commands.

CPLEX>


===================

how to use cplex with Java

to compile a Java program which calls the cplex:

  javac -classpath /Users/cwang/Documents/workspace/cplex/cplex112.x86_mac/cplex112/lib/cplex.jar:.(pay attention to include the current directory by using :.)

and to execute:

  java -Djava.library.path=/Users/cwang/Documents/workspace/cplex/cplex112.x86_mac/cplex112/bin/x86_darwin8_gcc4.0/libcplex112.so -classpath /Users/cwang/Documents/workspace/cplex/cplex112.x86_mac/cplex112/lib/cplex.jar:. Diet

where the Diet is the name of the program.

1 commentaire: