It has two components:
- a thin wrapper around the complete C API
- an interface to MathOptInterface
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.
Xpress.jl is licensed under the MIT License.
The underlying solver is a closed-source commercial product for which you must purchase a license.
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).
To use Xpress with JuMP, use:
using JuMP, Xpress model = Model(Xpress.Optimizer) set_optimizer(model, "PRESOLVE", 0)
For other parameters use Xpress Optimizer manual or type
julia -e "using Xpress; println(keys(Xpress.XPRS_ATTRIBUTES))".
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).
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 of
Specially useful for explicitly loading the dynamic library.
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.
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.
For more information, consult the FICO optimizer manual.