Xpress.jl
Xpress.jl is a wrapper for the FICO Xpress Solver.
It has two components:
- a thin wrapper around the complete C API
- an interface to MathOptInterface
Affiliation
The Xpress wrapper for Julia is community driven and not officially supported by FICO Xpress. If you are a commercial customer interested in official support for Julia from FICO Xpress, let them know.
License
Xpress.jl
is licensed under the MIT License.
The underlying solver is a closed-source commercial product for which you must purchase a license.
Installation
First, obtain a license of Xpress and install Xpress solver, following the instructions on the FICO website.
Then, install this package using:
import Pkg
Pkg.add("Xpress")
If you encounter an error, make sure that the XPRESSDIR
environmental variable is set to the path of the Xpress directory. This should be part of a standard installation. The Xpress library will be searched for in XPRESSDIR/lib
on Unix platforms and XPRESSDIR/bin
on Windows.
For example, on macOS, you may need:
ENV["XPRESSDIR"] = "/Applications/FICO Xpress/xpressmp/"
import Pkg
Pkg.add("Xpress")
By default, building Xpress.jl will fail if the Xpress library is not found. This may not be desirable in certain cases, for example when part of a package's test suite uses Xpress as an optional test dependency, but Xpress cannot be installed on a CI server running the test suite. To support this use case, the XPRESS_JL_SKIP_LIB_CHECK
environment variable may be set (to any value) to make Xpress.jl installable (but not usable).
Use with JuMP
To use Xpress with JuMP, use:
using JuMP, Xpress
model = Model(Xpress.Optimizer)
set_optimizer(model, "PRESOLVE", 0)
Options
For other parameters use Xpress Optimizer manual or type julia -e "using Xpress; println(keys(Xpress.XPRS_ATTRIBUTES))"
.
If logfile
is set to ""
, the log file is disabled and output is printed to the console (there might be issues with console output on windows (it is manually implemented with callbacks)). If logfile
is set to a file's path, output is printed to that file. By default, logfile = ""
(console).
Callbacks
Solver specific and solver independent callbacks are working in MathOptInterface and, consequently, in JuMP. However, the current implementation should be considered experimental.
Environment variables
XPRESS_JL_SKIP_LIB_CHECK
: Used to skip build lib check as previously described.XPRESS_JL_NO_INFO
: Disable license info log.XPRESS_JL_NO_DEPS_ERROR
: Disable error when do deps.jl file is found.XPRESS_JL_NO_AUTO_INIT
: Disable automatic run ofXpress.initialize()
.
Specially useful for explicitly loading the dynamic library.
Skipping Xpress.postsolve
In older versions of Xpress, the command XPRSpostsolve
throws an error in infeasible models. In these older versions the post solve should not be executed. To do this, one can use the MOI.RawOptimizerAttribute("MOI_POST_SOLVE")
to skip this routine.
C API
The C API can be accessed via Xpress.Lib.XPRSxx
functions, where the names and arguments are identical to the C API.
See the Xpress documentation for details.
Documentation
For more information, consult the FICO optimizer manual.