Skip to main content

A Python wrapper to the CUTEst optimization test environment

Project description

PyCUTEst is a Python interface to CUTEst, a Fortran package for testing optimization software. It is based on the interface originally developed for CUTEr by Prof. Arpad Buermen.

Requirements

PyCUTEst requires the following software to be installed:

Additionally, the following python packages should be installed (these will be installed automatically if using pip, see Installation using pip):

Installing CUTEst on Linux

These instructions do not include installation of the MATLAB interface. You will need to install four packages: archdefs, SIFDecode, CUTEst and MASTSIF. To keep things simple, install all four packages in the same directory:

$ mkdir cutest
$ cd cutest
$ git clone https://github.com/ralna/ARCHDefs ./archdefs
$ git clone https://github.com/ralna/SIFDecode ./sifdecode
$ git clone https://github.com/ralna/CUTEst ./cutest
$ git clone https://bitbucket.org/optrove/sif ./mastsif

Note that mastsif contains all the test problem definitions and is therefore quite large. If you’re short on space you may want to copy only the *.SIF files for the problems you wish to test on.

Next set the following environment variables in your ~/.bashrc to point to the installation directories used above:

# CUTEst
export ARCHDEFS=/path/to/cutest/archdefs/
export SIFDECODE=/path/to/cutest/sifdecode/
export MASTSIF=/path/to/cutest/mastsif/
export CUTEST=/path/to/cutest/cutest/
export MYARCH="pc64.lnx.gfo"

Now we are ready to install CUTEst in double precision (requires gfortran and gcc):

$ cd ./cutest
$ ${ARCHDEFS}/install_optrove
Do you wish to install CUTEst (Y/n)? Y
Do you require the CUTEst-Matlab interface (y/N)? N
Select platform: 6 # PC with generic 64-bit processor
Select operating system: 2 # Linux
Would you like to review and modify the system commands (y/N)? N
Select fortran compiler: 2 # GNU gfortran compiler
Would you like to review and modify the fortran compiler settings (y/N)? N
Select C compiler: 2 # generic GCC
Would you like to compile SIFDecode (Y/n)? Y
Would you like to compile CUTEst (Y/n)? Y
CUTEst may be compiled in (S)ingle or (D)ouble precision or (B)oth.
Which precision do you require for the installed subset (D/s/b) ? D

And CUTEst should run from here.

Installing CUTEst on Mac

To use CUTEst on Mac you will first need to install the Homebrew package manager:

$ cd ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then you can easily install CUTEst:

$ brew tap optimizers/cutest
$ brew install cutest --without-single --with-matlab # if using Matlab interface
$ brew install mastsif  # if you want all the test problems
$ for f in "archdefs" "mastsif" "sifdecode" "cutest"; do \
$ echo ". $(brew --prefix $f)/$f.bashrc" >> ~/.bashrc; \
$ done

Installation using pip

For easy installation, use pip as root:

$ [sudo] pip install pycutest

or alternatively easy_install:

$ [sudo] easy_install pycutest

If you do not have root privileges or you want to install PyCUTEst for your private use, you can use:

$ pip install --user pycutest

which will install PyCUTEst in your home directory.

Note that if an older install of PyCUTEst is present on your system you can use:

$ [sudo] pip install --upgrade pycutest

to upgrade PyCUTEst to the latest version.

You will then need to create a folder which will store all your compiled problems:

$ mkdir pycutest_cache

And set an environment variable to tell PyCUTEst about this directory, by adding to your ~/.bashrc file:

export PYCUTEST_CACHE="/path/to/pycutest_cache"
export PYTHONPATH="${PYCUTEST_CACHE}:${PYTHONPATH}"

Manual installation

Alternatively, you can download the source code from Github and unpack as follows:

$ git clone https://github.com/jfowkes/pycutest
$ cd pycutest

PyCUTEst is written in pure Python and requires no compilation. It can be installed using:

$ [sudo] pip install .

If you do not have root privileges or you want to install PyCUTEst for your private use, you can use:

$ pip install --user .

which will install PyCUTEst in your home directory.

Don’t forget to set up your cache and associated environment variable (see above).

To upgrade PyCUTEst to the latest version, navigate to the top-level directory (i.e. the one containing setup.py) and rerun the installation using pip, as above:

$ git pull
$ [sudo] pip install .  # with root privileges

Testing

If you installed PyCUTEst manually, you can test your installation by running:

$ python setup.py test

Uninstallation

If PyCUTEst was installed using pip you can uninstall as follows:

$ [sudo] pip uninstall pycutest

otherwise you have to remove the installed files by hand (located in your python site-packages directory).

Bugs

Please report any bugs using GitHub’s issue tracker.

License

This algorithm is released under the GNU GPL license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycutest-0.1.tar.gz (34.4 kB view details)

Uploaded Source

File details

Details for the file pycutest-0.1.tar.gz.

File metadata

  • Download URL: pycutest-0.1.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for pycutest-0.1.tar.gz
Algorithm Hash digest
SHA256 8fc519ddfa374de85f2a72a970c6e784c194e676bf5029f165f1ae1a38185aad
MD5 21dde811d74d46053891d6fab1d6aaed
BLAKE2b-256 1efec512e47b8a494b6a68fff561b5f81277e384f24ecb826084f883b10ee556

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page