JuliaConstraints / CPLEXCP.jl

Julia interface for CPLEX CP Optimizer
MIT License
3 stars 1 forks source link

Installation problem under Ubuntu 20.04 with CPLEX 20.1 #4

Closed IgnacioRubioScola closed 2 years ago

IgnacioRubioScola commented 2 years ago

Hi,

I have problems installing CPLEXCP, CPLEX.jl is correctly installed. To reproduce, under ubuntu 20.04 download julia 1.6.3, and then:

]up
ENV["CPLEX_STUDIO_BINARIES"] = "/opt/ibm/ILOG/CPLEX_Studio201/cplex/bin/x86-64_linux/"
]add CPLEX
import Pkg
Pkg.add("CPLEXCP")
Pkg.build("CPLEXCP")

then I got this error:

ERROR: Error building `CPLEXCP`: 
ERROR: LoadError: Unable to locate CPLEX installation. Note this must be downloaded separately. See the CPLEXCP.jl README for further instructions.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] get_jar_file()
   @ Main ~/.julia/packages/CPLEXCP/jbgSe/deps/build.jl:61
 [3] try_local_installation()
   @ Main ~/.julia/packages/CPLEXCP/jbgSe/deps/build.jl:68
 [4] top-level scope
   @ ~/.julia/packages/CPLEXCP/jbgSe/deps/build.jl:78
 [5] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [6] top-level scope
   @ none:5
in expression starting at /home/ignacio/.julia/packages/CPLEXCP/jbgSe/deps/build.jl:73
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:55
  [2] (::Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec})()
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1048
  [3] withenv(::Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, ::Pair{String, String}, ::Vararg{Pair{String, B} where B, N} where N)
    @ Base ./env.jl:161
  [4] (::Pkg.Operations.var"#109#113"{String, Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1546
  [5] with_temp_env(fn::Pkg.Operations.var"#109#113"{String, Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1448
  [6] (::Pkg.Operations.var"#108#112"{Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1521
  [7] mktempdir(fn::Pkg.Operations.var"#108#112"{Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:729
  [8] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem ./file.jl:727
  [9] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1487
 [10] build_versions(ctx::Pkg.Types.Context, uuids::Vector{Base.UUID}; verbose::Bool)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1029
 [11] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, verbose::Bool)
    @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:910
 [12] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Iterators.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:900
 [13] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:80
 [14] build(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:78
 [15] #build#71
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:76 [inlined]
 [16] build
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:76 [inlined]
 [17] #build#70
    @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:75 [inlined]
 [18] build(pkg::String)
    @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:75
 [19] top-level scope
    @ REPL[9]:1

thank you,

Ignacio

dourouc05 commented 2 years ago

Actually, the package is not really tested under Linux, as I'm mostly working on Windows. By the way, your command ]add CPLEX is not useful for CPLEXCP.jl, as the two packages are completely unrelated (except the fact that they wrap parts of the CPLEX solver for MOI consumption, there is no reliance of one on the other).

What's in the log file? It should be ~/.julia/packages/CPLEXCP/jbgSe/deps/build.log.

I think the issue is that you are setting the CPLEX_STUDIO_BINARIES environment variable, while the package only looks for CPLEX_STUDIO_DIR. That's a mistake in the README, I just fixed it as e6b1b84.

IgnacioRubioScola commented 2 years ago

Inside ~/.julia/packages/CPLEXCP/If8ky/deps I don't see the file build.log, I just see the file build.jl. I change the environment variable to ENV["CPLEX_STUDIO_DIR"] = "/opt/ibm/ILOG/CPLEX_Studio201/cplex/bin/x86-64_linux/" and I still got the error ERROR: LoadError: Unable to locate CPLEX installation. Note this must be downloaded separately. See the CPLEXCP.jl README for further instructions. when I execute locate ILOG.CP.jar I have /opt/ibm/ILOG/CPLEX_Studio201/cpoptimizer/lib/ILOG.CP.jar

IgnacioRubioScola commented 2 years ago

I could build CPLEXCP using the following env. variable: ENV["CPLEX_STUDIO_DIR"] = "/opt/ibm/ILOG/CPLEX_Studio201/"

dourouc05 commented 2 years ago

Again, I was copy-pasting the docs from CPLEX.jl too quickly… CPLEX_STUDIO_DIR should really have the value that is set by the installer, i.e. without the bin/x86-64_linux at the end.

dourouc05 commented 2 years ago

Thanks for your perseverance! I've updated the docs based on your feedback. Also, for the next release, the build process should output much more information (which could be helpful in debugging these issues).