Installation

HSL.py uses external packages that are not included in the HSL.py source code because they are released under different licenses than the one used for HSL.py. Hence we cannot distribute their code and you have to obtain them yourself.

HSL routines

HSL website is divided into two parts:

  1. Archive, which contains outdated codes that are freely available for personal commercial or non-commercial usage. It includes, amongst other, MA27 and MC19.
  2. Academic access, which contains more modern codes that are freely available for academic use only. It includes, amongst other, MC21, MC60, MA57, MA87, and MA97.

To obtain the HSL code, go to the HSL website and download desired source code.

You do not need to compile them by yourself. We will do it for you.

Note: If you are an academic or a student, we recommend you download and use MA57 instead of MA27, because it can be considerably faster than MA27 on some problems.

METIS (optional)

The linear solvers MA57, MA87 and MA97 can make use of the matrix ordering algorithms implemented in METIS. If you are using one of these linear solvers, you should obtain the METIS source code and compile it.

If you are under OS X, a Homebrew formula is available. Follow the instructions to install Homebrew. Then, metis and its dependencies can be installed automatically in /usr/local by typing

brew tap homebrew/science
brew install metis4

Note: only version 4 is supported by MA57, MA87 and MA97.

HSL.py master branch provides C files generated by Cython and doesn’t need Cython installed. Most users will only use this branch. HSL.py develop branch is the developpement branch in which all Cython templates are stored and all the tools to generate C files are present.

Branch master (recommanded)

HSL.py installation is done in few simple steps:

  1. Clone the repository

    git clone https://github.com/PythonOptimizers/HSL.py.git
    
  2. Install the Python dependencies:

  • NumPy

  • CySparse <—- optional

    Python installer pip is recommended for that

    pip install numpy
    pip install CySparse (not possible yet!) <---- optional
    
  1. Copy site.template.cfg to site.cfg and adjust it to reflect your own environment

  2. Compile and install the library:

    The preferred way to install the library is to install it in its own virtualenv. To compile and install the library, just type

    python setup.py install
    

Branch develop (experimented users only)

HSL.py installation is done in few simple steps:

  1. Clone the repository

    git clone https://github.com/PythonOptimizers/HSL.py.git
    cd HSL.py
    git checkout develop
    
  2. Install the Python dependencies:

  • NumPy

  • cygenja

  • CySparse <—- optional

    Python installer pip is recommended for that

    pip install numpy
    pip instal cygenja
    pip install CySparse (not possible yet!) <---- optional
    
  1. Copy site.template.cfg to site.cfg and adjust it to reflect your own environment

  2. Generate code and setup.py files

    python generate_code.py
    
  3. Compile and install the library:

    The preferred way to install the library is to install it in its own virtualenv. To compile and install the library, just type

    python setup.py install
    

Further dependencies

Documentation

To generate the documentation you will need other Python dependencies:

  • Sphinx
  • sphinx-bootstrap-theme

which can be easily installed using pip

Testing

Testing is done using py.test, so it needs to be installed before running them.

pip install pytest

In the root directory, type

py.test

Note that a complete list of dependencies is provided in the requirements.txt file. You can easily install all of them with:

pip install -r requirements.txt