You'll be installing everything into your home directory, so you might want to keep it organised. First you want to find out what your home directory is, so run cd
with no directory specif
ied to move to your home directory, and then run pwd
to see your home directory. Mine is /home/595/wep595.
Now choose a place to install cplex. I suggest installing cplex into ~/opt/ibm/ILOG/CPLEX_Studio1263 and the python bindings into ~/cplex. Note that ~ is a common unix shortcut for your home directory, so for me I will install cplex into /home/595/wep595/opt/ibm/ILOG/CPLEX_Studio1263. From here on, I will refer to the cplex directory as $CPLEX and the python directory as $PYTHON.
Run module load python3
Run pyvenv $PYTHON
. N.B. If you have multiple versions of python installed, say 2.7 and 3.4, you can specify the version of python to use by running pyvenv-3.4 $PYTHON
or similar. Recall
that $PYTHON is the place you decided to install the python bindings
cd $PYTHON
and then run source bin/activate
.
Run sh cplex_studio1263.linux-x86-64.bin
(you might need to change the version numbers or path). Select your preferred locale, accept the warning and license agreement. After accepting the license agreement, the installer will ask you for an installation directory. Enter $CPLEX as determined in Step 0. Note that you cannot use the ~ shortcut here, enter the full path (i.e. with your own home directory fully written out).
Ensure the directory has been entered correctly, then continue with installation.
Cplex takes up close to 2GB of drive space, and that is your limit on NCI. To save some space, I remove the documentation folder by running cd $CPLEX/; rm -r doc
.
cd $CPLEX/cplex/python/python3.4/x86-64_linux
(replace 3.4 with 2.6 if you want the 2.6 bindings), then run python3 setup.py install
. N.B. Since you have activated a python virtual environment, python already knows where to install the bindings.
Includes are in $CPLEX/cplex/include and static librarys are in $CPLEX/cplex/lib/x86-64_linux/static_pic. Compile against these and your resulting executable should run fine in jobs without any extra requirements.
Any jobs you want to submit using the Python interface must first load the python3 module, and then activate your virtual environment. For instance
module load python3
source $PYTHON/bin/activate
python3 /path/to/script.py
Replace $PYTHON with the directory you installed the bindings to in Step 4.