Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A Python package for optimization
Latest commit 63da829 @dpo dpo Merge pull request #16 from bitdeli-chef/master
Add a Bitdeli Badge to README
Failed to load latest commit information.
doc Add css files for docs.
examples Improve error message.
extras Add METIS patch and troubleshooting file.
include Removed useless bits from amplpy includes.
nlpy Improve choice of grays in profiles.
.gitignore Ignore Vim swap files.
LICENSE New licensing: LGPLv3.
README.rst Add a Bitdeli badge to README
Readme.macosx.rst Rename README for OSX.
TODO Added todo list in TODO.
site.template.cfg Setup uses new layout for HSL packages.



Welcome to the NLPy optimization toolkit for Python. If you read documentation, the next section is for you. Otherwise, skip to the Installation section below.


The NLPy documentation is typeset using the Sphinx documentation system ``_ which is particularly suited to documenting Python packages.

The manual in PDF format is in the doc subfolder. The HTML documentation is accessible by pointing your browser to doc/build/contents.html.

Check the paper NLPy---A Large-Scale Optimization Toolkit in Python by Dominique Orban available from ``_.

If the user so desires, the documentation may be generated afresh as follows:

  • To re-generate the HTML documentation, change to the doc subfolder and type:

    make html
  • To re-generate the PDF documentation, change to the doc subfolder and type:

    make latex

    Then change to the build/latex subfolder and type:

    make all-pdf


For now, just:

cp site.template.cfg site.cfg
# Edit site.cfg to adjust to your local settings.
python build
python install [--prefix=...]

To select another C compiler:

python config --compiler=<name> build

To select another Fortran compiler:

python config_fc --fcompiler=<name> build

To see a list of available Fortran compilers and their names:

python config_fc --help-fcompiler

To select both a C and a Fortran compiler:

python config --compiler=<name> config_fc --fcompiler=<name> build

For example, you can force compilation with gfortran by specifying:


and wit g95 by specifiying:


(note the subtle name difference.)


  • On an OpenSuSE system I obtain the following error message with both gfortran and g95:

    ld: build/temp.linux-x86_64-2.6/libnlpy_ma27.a(ma27ad.o): relocation
    R_X86_64_32S against 'a local symbol' can not be used when making a shared
    object; recompile with -fPIC build/temp.linux-x86_64-2.6/libnlpy_ma27.a:
    could not read symbols: Bad value

    The source of the problem is that on this platform, distutils appears to be compiling a static library without the -fPIC flags, which generates relocatable objects. When subsequently linking against this library to build a shared object, the linker complains. This problem can be resolved by restarting the installation and adding the following flags to the python command line:

    --f77flags="-ffixed-form -fno-second-underscore -fPIC -O"
    --f90flags="-fno-second-underscore -fPIC -O"

Licensing Bitdeli badge
Something went wrong with that request. Please try again.