Using CPLEX

Here are the steps to compile and run CPLEX 10.0 and 10.1 jobs at the CAC.

  1. Login to the login-node (e.g. nyx-login)
  2. Use the Unix command :
    module load cplex
    or
    module load cplex/version
    ( this sets up your CPLEX environment for compiling .)
  3. Compile your code.
  4. Compiling 64-bit CPLEX
    gcc -fPIC -I${CPLEXHOME}/include -o executable source.c -L${CPLEXHOME}/lib64 -lcplex -lm -lpthread
    Compiling 32-bit CPLEX
    gcc -m32 -fPIC -I${CPLEXHOME}/include -o executable source.c -L${CPLEXHOME}/lib -lcplex -lm -lpthread
    Compiling 64-bit Concert/CPLEX
    g++ -O -fPIC -fexceptions -DNDEBUG -DIL_STD -I${CPLEXHOME}/include source.cpp -o executable -L${CPLEXHOME}/lib64 -lilocplex -lcplex -lconcert -lm -lpthread
    Compiling 32-bit Concert/CPLEX
    g++ -m32 -O -fPIC -fexceptions -DNDEBUG -DIL_STD -I${CPLEXHOME}/include source.cpp -o executable -L${CPLEXHOME}/lib -lilocplex -lcplex -lconcert -lm -lpthread
  5. Create a PBS script . Here is an example PBS script to run
    the imaginary CPLEX binary "lpex6" (located in your
    imaginary "pbs/cplex" dir ):
    #!/bin/csh
    #PBS -N cplex-test
    #PBS -l nodes=1,walltime=1:00:00
    #PBS -q route
    #PBS -M uniqname@umich.edu
    #PBS -m abe
    #PBS -V
    cd /home/uniqname/pbs/cplex

    ./lpex6 >&lpex6.out
    You should replace the things in bold with values appropriate for you.
  6. Submit PBS script using "qsub" (qsub mycplex.pbs)