CPLEX Julia/JuMP Connection Problem

Dear Julia Guys,

I am having a lot of trouble to make cplex run with julia/jump, (Gurobi has been seamless and works perfect). I installed the package and when running the sentence “using CPLEX”, I get the following message. Can you help me out?

julia> using CPLEX
[ Info: Precompiling CPLEX [a076750e-1247-5638-91d2-ce28b192dca0]
ERROR: LoadError: ArgumentError: invalid base 10 digit ‘P’ in “Pi\x8e\x14”
[1] tryparse_internal(::Type{Int64}, ::SubString{String}, ::Int64, ::Int64, ::Int64, ::Bool) at .\parse.jl:132
[2] parse(::Type{Int64}, ::SubString{String}; base::Nothing) at .\parse.jl:238
[3] parse at .\parse.jl:238 [inlined]
[4] _broadcast_getindex_evalf at .\broadcast.jl:648 [inlined]
[5] _broadcast_getindex at .\broadcast.jl:631 [inlined]
[6] getindex at .\broadcast.jl:575 [inlined]
[7] copy at .\broadcast.jl:852 [inlined]
[8] materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,typeof(parse),Tuple{Base.RefValue{Type{Int64}},Base.RefValue{SubString{String}}}}) at .\broadcast.jl:837
[9] top-level scope at C:\Users\Armando.julia\packages\CPLEX\5NpoU\src\CPLEX.jl:22
[10] include(::Function, ::Module, ::String) at .\Base.jl:380
[11] include(::Module, ::String) at .\Base.jl:368
[12] top-level scope at none:2
[13] eval at .\boot.jl:347 [inlined]
[14] eval(::Expr) at .\client.jl:467
[15] top-level scope at .\none:3
in expression starting at C:\Users\Armando.julia\packages\CPLEX\5NpoU\src\CPLEX.jl:13
ERROR: Failed to precompile CPLEX [a076750e-1247-5638-91d2-ce28b192dca0] to C:\Users\Armando.julia\compiled\v1.5\CPLEX\QpT0w_atEpv.ji.
[1] error(::String) at .\error.jl:33
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1305
[3] _require(::Base.PkgId) at .\loading.jl:1030
[4] require(::Base.PkgId) at .\loading.jl:928
[5] require(::Module, ::Symbol) at .\loading.jl:923

I ran into similar issues with CPLEX, solved when I reverted to the old version, as suggested here: GitHub - jump-dev/CPLEX.jl: Julia interface for the CPLEX optimization software Maybe it will help you too?

Thanks for your reply. I reverted to the old version but the failure to precompile keeps happening.

I also uninstalled cplex 20.1 and kept only CPLEX 12.10. I really don´t know what might be the issue…


Can you open an issue at cplex.jl with the details? Please include versioninfo().

cc @dourouc05

I think there is already an issue for that: Installation Problem - CPLEX package on Julia · Issue #368 · jump-dev/CPLEX.jl · GitHub. However, I really cannot reproduce locally (even though I have a Windows system). I think we need a bit more information, like that versioninfo().

1 Like

I have tried several times, reinstalling julia, etc.

julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core™ i7-8550U CPU @ 1.80GHz
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

The cplex error is:

using CPLEX
[ Info: Precompiling CPLEX [a076750e-1247-5638-91d2-ce28b192dca0]
ERROR: LoadError: ArgumentError: invalid base 10 digit ‘\xf0’ in “\xf0\xefs\x19”
[1] tryparse_internal(#unused#::Type{Int64}, s::SubString{String}, startpos::Int64, endpos::Int64, base_::Int64, raise::Bool)
@ Base .\parse.jl:137
[2] parse(::Type{Int64}, s::SubString{String}; base::Nothing)
@ Base .\parse.jl:241
[3] parse
@ .\parse.jl:241 [inlined]
[4] _broadcast_getindex_evalf
@ .\broadcast.jl:648 [inlined]
[5] _broadcast_getindex
@ .\broadcast.jl:631 [inlined]
[6] getindex
@ .\broadcast.jl:575 [inlined]
[7] copy
@ .\broadcast.jl:898 [inlined]
[8] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0}, Nothing, typeof(parse), Tuple{Base.RefValue{Type{Int64}}, Base.RefValue{SubString{String}}}})
@ Base.Broadcast .\broadcast.jl:883
[9] top-level scope
@ C:\Users\Armando.julia\packages\CPLEX\5NpoU\src\CPLEX.jl:22
[10] include
@ .\Base.jl:386 [inlined]
[11] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base .\loading.jl:1213
[12] top-level scope
@ none:1
[13] eval
@ .\boot.jl:360 [inlined]
[14] eval(x::Expr)
@ Base.MainInclude .\client.jl:446
[15] top-level scope
@ none:1
in expression starting at C:\Users\Armando.julia\packages\CPLEX\5NpoU\src\CPLEX.jl:1
ERROR: Failed to precompile CPLEX [a076750e-1247-5638-91d2-ce28b192dca0] to C:\Users\Armando.julia\compiled\v1.6\CPLEX\jl_8B5E.tmp.
[1] error(s::String)
@ Base .\error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
@ Base .\loading.jl:1360
[3] compilecache(pkg::Base.PkgId, path::String)
@ Base .\loading.jl:1306
[4] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1021
[5] require(uuidkey::Base.PkgId)
@ Base .\loading.jl:914
[6] require(into::Module, mod::Symbol)
@ Base .\loading.jl:901
[7] eval
@ .\boot.jl:360 [inlined]
[8] eval
@ .\Base.jl:39 [inlined]
[9] repleval(m::Module, code::Expr, #unused#::String)
@ VSCodeServer c:\Users\Armando.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\repl.jl:124
[10] (::VSCodeServer.var"#47#49"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
@ VSCodeServer c:\Users\Armando.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\repl.jl:99
[11] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging .\logging.jl:491
[12] with_logger
@ .\logging.jl:603 [inlined]
[13] (::VSCodeServer.var"#46#48"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
@ VSCodeServer c:\Users\Armando.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\repl.jl:100
[14] #invokelatest#2
@ .\essentials.jl:708 [inlined]
[15] invokelatest(::Any)
@ Base .\essentials.jl:706
[16] macro expansion
@ c:\Users\Armando.vscode\extensions\julialang.language-julia-1.1.38\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
[17] (::VSCodeServer.var"#60#61")()
@ VSCodeServer .\task.jl:411


For future readers, this was resolved on Github: Installation Problem - CPLEX package on Julia · Issue #368 · jump-dev/CPLEX.jl · GitHub.

1 Like