CPLEX/en: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
(Created page with "==Installation== The file is an executable archive which will perform the installation after you have answered a few questions. To execute the archive, you need to type the co...")
(Created page with "To access the software, you can create a personal module. Modules are normally created and placed in a directory hierarchy. In order for your modules to be found, you need to...")
Line 8: Line 8:
The file is an executable archive which will perform the installation after you have answered a few questions. To execute the archive, you need to type the command  <tt>bash ./cplex_studioXYZ.linux-x86.bin</tt>.
The file is an executable archive which will perform the installation after you have answered a few questions. To execute the archive, you need to type the command  <tt>bash ./cplex_studioXYZ.linux-x86.bin</tt>.


Pour accéder au logiciel, vous pouvez créer des modules personnels. Les modules sont habituellement créés et mis dans une arborescence de répertories. Pour que vos modules soient trouvés, vous devez modifier le fichier de configuration $HOME/.bashrc pour pointer vers la racine de cette arborescence, en ajoutant la ligne suivante:
To access the software, you can create a personal module. Modules are normally created and placed in a directory hierarchy. In order for your modules to be found, you need to modify the configuration file <tt>$HOME/.bashrc</tt> so that it points to the root of this hierarchy, by adding the following line:


{{Commande|export MODULEPATH{{=}}$HOME/modulefiles:$MODULEPATH}}
{{Commande|export MODULEPATH{{=}}$HOME/modulefiles:$MODULEPATH}}

Revision as of 19:44, 28 March 2018

Other languages:

CPLEX is software for optimization, developed by IBM. It is available for academic users through IBM's academic program.

Download

To use CPLEX on Compute Canada clusters, you must first register with the IBM academic program and then download a personal version of the software.

Installation

The file is an executable archive which will perform the installation after you have answered a few questions. To execute the archive, you need to type the command bash ./cplex_studioXYZ.linux-x86.bin.

To access the software, you can create a personal module. Modules are normally created and placed in a directory hierarchy. In order for your modules to be found, you need to modify the configuration file $HOME/.bashrc so that it points to the root of this hierarchy, by adding the following line:

Question.png
[nom@serveur ~]$ export MODULEPATH=$HOME/modulefiles:$MODULEPATH

Ensuite, il faut créer une structure de répertoires pour y mettre votre nouveau module cplex:

Question.png
[nom@serveur ~]$ mkdir -p $HOME/modulefiles/mycplex

Dans ce répertoire, vous allez créer un fichier (par exemple $HOME/modulefiles/mycplex/12.8.0) ayant le numéro de la version que vous avez téléchargé précédemment (le XYX) et qui contient ceci:

Fichier : cplex_module.sh

************************************************************************************************

#%Module1.0#####################################################################
##
## cplex
##
proc ModulesHelp { } {
        global cplexversion

        puts stderr "\tIBM ILOG cplex "
        puts stderr "\tThis module provides configuration for cplex, concert, cpoptimizer and opl"
}

module-whatis   "IBM ILOG cplex (cplex, concert, cpoptimizer, opl). This version doesn't ask for a licence file."

# for Tcl script use only
set     cplexversion        XYZ
set     studio_root          <root path of cplex>
set     cplexroot             $studio_root/cplex
set     concertroot           $studio_root/concert
set     oplroot               $studio_root/opl
set     cpoptimizerroot       $studio_root/cpoptimizer


set cplexbin x86-64_linux
set cplexlib $cplexbin/static_pic
set concertbin x86-64_linux
set concertlib $concertbin/static_pic
set oplbin x86-64_linux
set opllib $oplbin/static_pic
set cpoptimizerbin x86-64_linux
set cpoptimizerlib $cpoptimizerbin/static_pic


prepend-path    PATH         $cplexroot/bin/$cplexbin
prepend-path    PATH         $oplroot/bin/$oplbin
prepend-path    PATH         $cpoptimizerroot/bin/$cpoptimizerbin

prepend-path    CPATH        $cplexroot/include
prepend-path    CPATH        $concertroot/include
prepend-path    CPATH        $oplroot/include
prepend-path    CPATH        $cpoptimizerroot/include

prepend-path -d " "   CPATH_EXPANDED        -I$cplexroot/include
prepend-path  -d " "  CPATH_EXPANDED        -I$concertroot/include
prepend-path -d " "   CPATH_EXPANDED        -I$oplroot/include
prepend-path -d " "   CPATH_EXPANDED        -I$cpoptimizerroot/include

prepend-path    LIBRARY_PATH $cplexroot/lib/$cplexlib
prepend-path    LIBRARY_PATH $concertroot/lib/$concertlib
prepend-path    LIBRARY_PATH $oplroot/lib/$opllib
prepend-path    LIBRARY_PATH $oplroot/bin/x86-64_linux/
prepend-path    LIBRARY_PATH $cpoptimizerroot/lib/$cpoptimizerlib

prepend-path -d " "   LIBRARY_PATH_EXPANDED -L$cplexroot/lib/$cplexlib
prepend-path  -d " "  LIBRARY_PATH_EXPANDED -L$concertroot/lib/$concertlib
prepend-path -d " "   LIBRARY_PATH_EXPANDED -L$oplroot/lib/$opllib
prepend-path -d " "   LIBRARY_PATH_EXPANDED -L$oplroot/bin/x86-64_linux/
prepend-path -d " "   LIBRARY_PATH_EXPANDED  -L$cpoptimizerroot/lib/$cpoptimizerlib

prepend-path    LD_LIBRARY_PATH      $cplexroot/bin/$cplexbin
prepend-path    LD_LIBRARY_PATH      $oplroot/bin/$oplbin

prepend-path     CLASSPATH $cplexroot/lib/cplex.jar
prepend-path     MATLABPATH $cplexroot/matlab

***********************************************************


Ajustez les lignes qui correspondent aux variables cplexversion et studio_root afin qu'elles aient les bonnes valeurs : la version téléchargée et du chemin d'accès pour ce logiciel (c'est-à-dire le chemin que vous avez spécifié lors de l'extraction de l'archive).

Java

Si vous utilisez java, vous aurez quelques étapes supplémentaires. Tout d'abord, dans votre fichier .bashrc, vous pouvez ajouter la ligne,

Question.png
[nom@serveur ~]$ export CLASSPATH=.

qui permettra de trouver votre code lors de l'exécution.

Ensuite, vous devrez modifier la librairie dynamique de cplex. Cherchez cette librairie dans l'arborescence du répertoire d'installation, faites en une copie et exécutez la commande:

Question.png
[nom@serveur ~]$ setrpaths.sh --path libcplex1280.so

Il est possible que lors de votre compilation, vous ayez un message d'erreur à cause d'un manque de mémoire. Si c'est le cas, vous devrez demander un noeud de calcul interactif pour pouvoir faire la compilation. Par exemple:

Question.png
[nom@serveur ~]$ salloc --time=1:0:0 --ntasks=1 --mem-per-cpu=8G