Problems to build CPLEX

Dear all,
I am having a problem to build the CPLEX v 20.10 on my computer. The error message appears:

Pkg.build("CPLEX")
   Building CPLEX → `C:\Users\Usuário\.julia\packages\CPLEX\DgohF\deps\build.log`
┌ Error: Error building `CPLEX`:
│ ERROR: LoadError: Unable to locate CPLEX installation. Note this must be downloaded separately. See the CPLEX.jl README for further instructions.        
│ Stacktrace:
│  [1] error(::String) at .\error.jl:33
│  [2] try_local_installation() at C:\Users\Usuário\.julia\packages\CPLEX\DgohF\deps\build.jl:64
│  [3] top-level scope at C:\Users\Usuário\.julia\packages\CPLEX\DgohF\deps\build.jl:80
│  [4] include(::String) at .\client.jl:457
│  [5] top-level scope at none:5
│ in expression starting at C:\Users\Usuário\.julia\packages\CPLEX\DgohF\deps\build.jl:77
└ @ Pkg.Operations D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:942

Could anyone can help me please?

Which version of CPLEX.jl are you using ?
What is the value of the CPLEX_STUDIO_BINARIES environment variable ?
Did you follow the install instructions ?

CPLEX version 20.10
Yes I have followed exactly the instructions:

ENV["CPLEX_STUDIO_BINARIES"] = "C:\\Program Files\\CPLEX_Studio1210\\cplex\\bin\\x86-64_win\\"
import Pkg
Pkg.add("CPLEX")
Pkg.build("CPLEX")

By CPLEX.jl, I mean the version of the CPLEX Julia package, you get it with Pkg.status("JuMP"). The latest version of CPLEX.jl gives more details on why the build failed. Moreover, older version of CPLEX.jl do not support CPLEX v20.1

Sorry,

[a076750e] CPLEX v0.6.6
[4076af6c] JuMP v0.21.3

I have update all packages now.

CPLEX v20.1 is not supported by CPLEX.jl v0.6.6, the latest version of CPLEX is v0.7.6.
Try Pkg.add(Pkg.PackageSpec(name="CPLEX", version="0.7.6")) (not that you should restart Julia in order to use the new version.

Not yet:

julia>  Pkg.add(Pkg.PackageSpec(name="CPLEX", version="0.7.7"))
   Updating registry at `C:\Users\Usuário\.julia\registries\General`
   Updating registry at `C:\Users\Usuário\.julia\registries\JuliaComputingRegistry`
  Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CPLEX [a076750e]:
 CPLEX [a076750e] log:
 ├─possible versions are: [0.3.3, 0.4.0-0.4.4, 0.5.0-0.5.1, 0.6.0-0.6.6, 0.7.0-0.7.6] or uninstalled
 └─restricted to versions 0.7.7 by an explicit requirement — no versions left
Stacktrace:
 [1] check_constraints(::Pkg.Resolve.Graph) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:935
 [2] Pkg.Resolve.Graph(::Dict{Base.UUID,Set{VersionNumber}}, ::Dict{Base.UUID,Dict{VersionNumber,Dict{String,Base.UUID}}}, ::Dict{Base.UUID,Dict{VersionNumber,Dict{String,Pkg.Types.VersionSpec}}}, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Resolve.Fixed}, ::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:362
 [3] deps_graph(::Pkg.Types.Context, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Resolve.Fixed}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:495
 [4] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:367
 [5] targeted_resolve at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1107 [inlined]
 [6] tiered_resolve(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1093
 [7] _resolve at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1113 [inlined]
 [8] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1128
 [9] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:189    
 [10] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:140
 [11] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
 [12] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
 [13] #add#19 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65 [inlined]
 [14] add(::Pkg.Types.PackageSpec) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65
 [15] top-level scope at none:1

Sorry, I meant v0.7.6, not v0.7.7 (I have edited the command in my previous post)

No work yet. There isn’t this version. Thank you for attention.
Maybe, in future CPLEX 20.1 works on this latest version,

This function exists, maybe it conflicts with other packages you have. Can you give the error you get when you run Pkg.add(Pkg.PackageSpec(name="CPLEX", version="0.7.6")) ?

Something very strange:

julia>  Pkg.add(Pkg.PackageSpec(name="CPLEX", version="0.7.6"))
  Resolving package versions...
ERROR: Unsatisfiable requirements detected for package VegaLite [112f6efa]:
 VegaLite [112f6efa] log:
 ├─possible versions are: [0.3.4, 0.4.0, 0.5.0-0.5.3, 0.6.0, 0.7.0, 1.0.0, 2.0.0-2.0.1, 2.1.0-2.1.3, 2.2.0, 2.3.0] or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions [0.3.4, 0.4.0, 0.5.0-0.5.3, 0.6.0, 0.7.0, 1.0.0, 2.0.0-2.0.1, 2.1.0-2.1.3, 2.2.0, 2.3.0]
 ├─restricted by compatibility requirements with Requires [ae029012] to versions: [0.7.0, 1.0.0, 2.0.0-2.0.1, 2.1.0-2.1.3, 2.2.0, 2.3.0] or uninstalled, leaving only versions: [0.7.0, 1.0.0, 2.0.0-2.0.1, 2.1.0-2.1.3, 2.2.0, 2.3.0]
 │ └─Requires [ae029012] log:
 │   ├─possible versions are: [0.5.0-0.5.2, 1.0.0-1.0.3, 1.1.0-1.1.2] or uninstalled
 │   └─restricted by compatibility requirements with Weave [44d3d7a6] to versions: [1.0.0-1.0.3, 1.1.0-1.1.2]
 │     └─Weave [44d3d7a6] log:
 │       ├─possible versions are: [0.6.0-0.6.2, 0.7.0-0.7.2, 0.8.0-0.8.1, 0.9.0-0.9.4, 0.10.0-0.10.6] or uninstalled
 │       └─restricted to versions * by an explicit requirement, leaving only versions [0.6.0-0.6.2, 0.7.0-0.7.2, 0.8.0-0.8.1, 0.9.0-0.9.4, 0.10.0-0.10.6]  
 └─restricted by compatibility requirements with JSONSchema [7d188eb4] to versions: [0.3.4, 0.4.0, 0.5.0-0.5.3, 0.6.0] or uninstalled — no versions left   
   └─JSONSchema [7d188eb4] log:
     ├─possible versions are: [0.1.0-0.1.1, 0.2.0, 0.3.0-0.3.3] or uninstalled
     └─restricted by compatibility requirements with MathOptInterface [b8f27783] to versions: 0.3.0-0.3.3
       └─MathOptInterface [b8f27783] log:
         ├─possible versions are: [0.5.0-0.5.1, 0.6.0-0.6.4, 0.7.0, 0.8.0-0.8.4, 0.9.0-0.9.19] or uninstalled
         ├─restricted by compatibility requirements with Ipopt [b6b21f68] to versions: [0.6.0-0.6.4, 0.7.0, 0.8.0-0.8.4, 0.9.0-0.9.19]
         │ └─Ipopt [b6b21f68] log:
         │   ├─possible versions are: [0.4.1-0.4.5, 0.5.0-0.5.4, 0.6.0-0.6.5] or uninstalled
         │   ├─restricted to versions * by an explicit requirement, leaving only versions [0.4.1-0.4.5, 0.5.0-0.5.4, 0.6.0-0.6.5]
         │   └─restricted by compatibility requirements with MathOptInterface [b8f27783] to versions: [0.4.5, 0.5.0-0.5.4, 0.6.0-0.6.5] or uninstalled, leaving only versions: [0.4.5, 0.5.0-0.5.4, 0.6.0-0.6.5]
         │     └─MathOptInterface [b8f27783] log: see above
         └─restricted by compatibility requirements with CPLEX [a076750e] to versions: 0.9.19
           └─CPLEX [a076750e] log:
             ├─possible versions are: [0.3.3, 0.4.0-0.4.4, 0.5.0-0.5.1, 0.6.0-0.6.6, 0.7.0-0.7.6] or uninstalled
             └─restricted to versions 0.7.6 by an explicit requirement, leaving only versions 0.7.6
Stacktrace:
 [1] propagate_constraints!(::Pkg.Resolve.Graph, ::Set{Int64}; log_events::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:1005
 [2] propagate_constraints! at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:946 [inlined] (repeats 2 times)
 [3] simplify_graph!(::Pkg.Resolve.Graph, ::Set{Int64}; clean_graph::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:1460
 [4] simplify_graph! at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:1460 [inlined] (repeats 2 times)   
 [5] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:368
 [6] targeted_resolve at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1107 [inlined]
 [7] tiered_resolve(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1093
 [8] _resolve at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1113 [inlined]
 [9] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1128
 [10] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:189
 [11] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:140  
 [12] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
 [13] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
 [14] #add#19 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65 [inlined]
 [15] add(::Pkg.Types.PackageSpec) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65
 [16] top-level scope at none:1

julia> 

It’s indeed quite weird as JSONSchema is not listed in the packages depending in VegaLite: JuliaHub.
As a workaround, you can create a local environment: 4. Working with Environments · Pkg.jl.
In this environment, you will only add the packages you need so you won’t have incompatibilities between packages you use for different projects.

1 Like

There is a compatibility issue with Vegalite: https://github.com/queryverse/VegaLite.jl/issues/345

Run import Pkg; Pkg.rm("VegaLite"); Pkg.add("CPLEX"); Pkg.update(). Then restart Julia for the changes to take effect.

1 Like
] add CPLEX#master

Now, CPLEX version CPLEX v0.7.6 works and was installed.

1 Like

Oops. Yes, I fixed VegaLite but forgot to reply here to tell you.

2 Likes