Skip to content

gidden/mp

 
 

Repository files navigation

AMPL/MP

image

image

An open-source library for mathematical programming.

Documentation: http://ampl.github.io

Features

Usage

Binaries for the open-source AMPL solvers for major platforms can be downloaded from the AMPL's Open Source Solvers page. To use a solver with AMPL, extract the binaries from a downloaded archive into the AMPL installation directory.

Building from source

An included CMake build script can be used to build the MP library, solver interfaces and function libraries on a wide range of platforms. You can download CMake for free from http://www.cmake.org/download/.

CMake works by generating native makefiles or project files that can be used in the compiler environment of your choice. The typical workflow starts with:

mkdir build         # Create a directory to hold the build output.
cd build
cmake <path/to/mp>  # Generate native build scripts.

where <path/to/mp> is a path to the mp repository.

If you are on a *nix system, you should now see a Makefile in the current directory. Now you can build MP by running make.

Once MP has been built you can invoke make test to run the tests.

If you use Windows and have Vistual Studio installed, an MP.sln file and several .vcproj files will be created. You can then build them using Visual Studio or msbuild.

On Mac OS X with Xcode installed, an .xcodeproj file will be generated.

Modules

AMPL/MP allows building only parts of the project you are interested in, for example you can choose to build only a single solver interface. This is done with the help of modules which are optional components that can be built separately. Each solver interface and function library is a module.

By default all modules are disabled and only the main MP libraries are built. To enable modules, pass their names as a comma-separated list in the BUILD variable when running CMake:

cmake -DBUILD=gsl,ilogcp .

Use -DBUILD=all to build all modules.

If a module is enabled, its dependencies are automatically downloaded and built when necessary. For example, enabling the gecode module will download the source code of Gecode__ constraint programming solver, build the solver and its AMPL interface.

Dependencies of some modules cannot be handled automatically due to licensing restrictions. If you enable such module, you should have its dependencies installed on the systems or it will not be built. For example, if you enable the ilogcp module, you should have IBM ILOG CPLEX Optimization Studio__ installed.

Using Eclipse CDT

You can generate Eclipse CDT project files with CMake:

cmake -G "Eclipse CDT 4 -  Unix Makefiles"

To get rid of semantic errors reported by Indexer add preprocessor symbols _GLIBCPP_USE_NAMESPACES, __GXX_EXPERIMENTAL_CXX0X__ and STAND_ALONE in "Project Properties" / "C/C++ Include Files and Symbols" and rebuild the index.

AMPL home | AMPL book | Discussion group | SolverStudio for Excel

AMPL models by Håkan Kjellerstrand

About

An open-source library for mathematical programming

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 52.2%
  • C 41.0%
  • Python 2.6%
  • AMPL 2.0%
  • CMake 1.7%
  • HTML 0.2%
  • Other 0.3%