Trouble with incorporating Xpress solver in Julia
Asked Answered
S

1

1

I'm trying to use Xpress solver in Julia-Jump. However, I have trouble to make Julia find the location of my Xpress installation. I'm using a Mac. I downloaded the Xpress, obtained license, put the license in the right folder, added these following lines in bash_profile:

# >>> XPRESS setup
Export /XPRESSDIR="Applications/FICO Xpress/Xpress Workbench.app/Contents/Resources/xpressmp/lib/"
export XPRESS=$XPRESSDIR/bin
source /Applications/FICO\ Xpress/xpressmp/bin/xpvars.sh
source /Applications/FICO\ Xpress/Xpress\ Workbench.app/Contents/Resources/xpressmp/bin/xpvars.sh

Then in Julia, I set:

ENV["EXPRESSDIR"] = "/Applications/FICO Xpress/xpressmp/Applications/FICO Xpress/xpressmp/"

using Pkg
Pkg.add("Xpress")

And have no issue. However when I tried

Pkg.build("Xpress")

I have an error of:

Building Xpress → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/502f7c1142f5233137fa02e27b22d150b78a6db3/build.log`
ERROR: Error building `Xpress`: 
ERROR: LoadError: Unable to locate Xpress installation.
Please check your enviroment variable XPRESSDIR.

Even though when I checked:

optimizer --help

I got:

FICO Xpress Solver 64bit v8.12.3 Jul 21 2021
(c) Copyright Fair Isaac Corporation 1983-2020. All rights reserved
 Optimizer v38.01.04    [/Applications/FICO Xpress/Xpress Workbench.app/Contents/Resources/xpressmp/lib/libxprs.dylib]

Which means my Xpress solver is installed successfully and is in the right path. So how come Julia still cannot find it?

Semester answered 20/7, 2023 at 19:20 Comment(0)
U
2

In Julia, you have called it EXPRESSDIR, not XPRESSDIR.

Try

ENV["XPRESSDIR"] = "/Applications/FICO Xpress/Xpress Workbench.app/Contents/Resources/xpressmp"
Upside answered 20/7, 2023 at 22:8 Comment(3)
Thank you for your answer. I tried XPRESSDIR and then Pkg.build("Xpress") again and still have the same error. Did I do something wrong in the bash_profile?Semester
If this is an M1 or M2 Mac, you need to make sure that the build of Julia (intel or apple silicon) is the same as the build of Xpress. if you still have trouble, please post on our community forum discourse.julialang.org/c/domain/opt/13. it's easier to have a conversation than SO.Upside
Thank you. I removed my current Julia (M1 version) and reinstalled the intel version and it seems to work. At least now I have no error when trying to build Xpress.Semester

© 2022 - 2024 — McMap. All rights reserved.