Skip to content

Instantly share code, notes, and snippets.

@antonior92
Last active August 23, 2022 11:11
Show Gist options
  • Save antonior92/9fd6ac9f44c164ee42555e3a7dc5a332 to your computer and use it in GitHub Desktop.
Save antonior92/9fd6ac9f44c164ee42555e3a7dc5a332 to your computer and use it in GitHub Desktop.
How to install pycutest

Installing PyCUTEst

Disclaimer: I wrote the instructions according to my own experience installing this thrice, I can't guarantee it will work out of the box for you

Setup

Choose a new directory to store all the files using:

export OPTDIR=$HOME/Documents/Optimization
mkdir $OPTDIR

Download CUTEst

Go into the new created directory:

cd $OPTDIR

Download ARCHDefs with the command

svn checkout --username anonymous \
  http://ccpforge.cse.rl.ac.uk/svn/cutest/archdefs/trunk ./archdefs

Download SIFDecode with the command

svn checkout --username anonymous \
  http://ccpforge.cse.rl.ac.uk/svn/cutest/sifdecode/trunk ./sifdecode

Download CUTEst, with the command

svn checkout --username anonymous \
  http://ccpforge.cse.rl.ac.uk/svn/cutest/cutest/trunk ./cutest

all in the same directory.

This will produce three sub-directories:

./archdefs
./sifdecode
./cutest

Add Files

Start by adding the following enviromental variables:

export ARCHDEFS="$OPTDIR/archdefs"
export SIFDECODE="$OPTDIR/sifdecode"
export CUTEST="$OPTDIR/cutest"

You shoud posses two different files: pycutestitf.c (here) and pycutestmgr.py (here). And you should move them to the following appropriate locations:

mv pycutestitf.c $CUTEST/src/tools
mkdir $CUTEST/src/python
mv pycutestmgr.py $CUTEST/src/python

Install CUTEst

Install cutest with the command:

cd $CUTEST
$ARCHDEFS/install_optsuite

and follow the instructions

Download Problems Set

Download problem set from: http://www.cuter.rl.ac.uk/Problems/mastsif.shtml and save them on $OPTDIR/sif.

Create Cache

Create a cache file

export PYCUTEST_CACHE="$OPTDIR/cache"
mkdir $PYCUTEST_CACHE

Modify .bashrc

Add the following lines to the file "~/.bashrc":

# *** OPTIMIZATION FILES *** #
export OPTDIR=$HOME/Documents/Optimization  # Change this line accordingly to the path you used

export ARCHDEFS="$OPTDIR/archdefs"
export SIFDECODE="$OPTDIR/sifdecode"
export CUTEST="$OPTDIR/cutest"
export PATH="${SIFDECODE}/bin:${PATH}"
export PATH="${CUTEST}/bin:${PATH}"
export MANPATH="${SIFDECODE}/man:${MANPATH}"
export MANPATH="${CUTEST}/man:${MANPATH}"
export MYARCH="pc.lnx.gfo"  # modify accordingly to your architecture
export MASTSIF="$OPTDIR/sif"

export PYCUTEST="$CUTEST/src/tools"
export PYCUTEST_CACHE="$OPTDIR/cache"
export PYTHONPATH="$PYCUTEST_CACHE:$CUTEST/src/python/"

Reference

CUTEst instalation was done acordingly to the guidelines on https://github.com/optimizers/cutest-mirror

@antonior92
Copy link
Author

Hi @lahcenelbourkhissi1997. It has been a long time since I did this script (I did it in 2018). So, to be completely sincere, I am not entirely sure what is the problem here... I don't have this fresh in my mind. Sorry for not being more useful

@lahcenelbourkhissi1997
Copy link

Hi Antonio. Yes, I understand, it is normal. Thank you for your quick response and thanks again for the incredible work you did to make these instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment