Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get CPLEX in Julia 0.6.4 #214

Closed
general6r opened this issue Feb 18, 2019 · 15 comments
Closed

How to get CPLEX in Julia 0.6.4 #214

general6r opened this issue Feb 18, 2019 · 15 comments

Comments

@general6r
Copy link

general6r commented Feb 18, 2019

Hello everyone. I need to get CPLEX in my Julia 0.6.4. I've already done everything that was mentioned in the previous issues. I have CPLEX optimizer installed on my computer but when I use "using CPLEX" I get this error:

INFO: Precompiling module CPLEX.
ERROR: LoadError: CPLEX not properly installed. Please run Pkg.build("CPLEX")
Stacktrace:
 [1] error at .\error.jl:21
 [2] include_from_node1 at .\loading.jl:576
 [3] include at .\sysimg.jl:14
while loading C:\Users\ramin\.julia\v0.6\CPLEX\src\CPLEX.jl, in expression starting on line 16
**********************
and then when I run Pkg.build("CPLEX") I get this error:
INFO: Building CPLEX
================================[ ERROR: CPLEX ]================================

LoadError: Unable to locate CPLEX installation. Note this must be downloaded separately. See the CPLEX.jl README for further instructions.
while loading C:\Users\ramin\.julia\v0.6\CPLEX\deps\build.jl, in expression starting on line 69

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: CPLEX had build errors.

 - packages with build errors remain installed in C:\Users\ramin\.julia\v0.6
 - build the package(s) and all dependencies with `Pkg.build("CPLEX")`
 - build a single package by running its `deps/build.jl` script

================================================================================

Does anyone know how I can resolve this issue? I'm using windows 10, Julia 0.6.4, CPLEX 12.8.0 and Jupyter Notebook.
Thank you.

@odow
Copy link
Member

odow commented Feb 18, 2019

LoadError: Unable to locate CPLEX installation. Note this must be downloaded separately. See the CPLEX.jl README for further instructions.

Please read: https://github.com/JuliaOpt/CPLEX.jl#note-for-windows

Make sure you have an environment variable called CPLEX_STUDIO_BINARIES that points to the correct location. For example:

julia> ENV["CPLEX_STUDIO_BINARIES"] = "path/to/cplex/installation"
julia> Pkg.build("CPLEX")

@general6r
Copy link
Author

Thank you Odow, but I'm still getting the same error.
error 2

@odow
Copy link
Member

odow commented Feb 18, 2019

@general6r, please see #168 and #215.

Your code needs to be CPLEX_STUDIO_BINARIES not CPLEX_STUDIO_BINARY. If that doesn't work (which is probably), the environment variable needs to be ENV["CPLEX_STUDIO_BINARIES128"]

@general6r
Copy link
Author

@odow Thank you. I read all the previous issues and those two that you suggested, yet for some reason I'm still getting the same error. Help please :(
error 3

@odow
Copy link
Member

odow commented Feb 19, 2019

What is in the directory of that folder?

@general6r
Copy link
Author

general6r commented Feb 19, 2019

@odow I guess you mean the path to cplex installation. This is the directory:
error 4

@odow
Copy link
Member

odow commented Feb 19, 2019

Close Julia, then open a new julia REPL and show the output of

Pkg.status("CPLEX")
using Libdl
@show ENV["CPLEX_STUDIO_BINARIES128"]
@show Libdl.dlopen_e("C:/Program Files/IBM/ILOG/CPLEX_Studio_Community128/cplex/bin/x64_win64/cplex1280")

@general6r
Copy link
Author

@odow I got another error for Libdl! :(
error 5

@odow
Copy link
Member

odow commented Feb 20, 2019

Oops, don't worry about the Libdl error. Julia behaves differently on 0.6.

I'm not sure what the problem is. Everything looks correct, but you can't open CPLEX correctly (the last line should not end in 0x00000000.

The only other thing I can think of is that you are using the community edition. Do you have a valid license? Can you actually run CPLEX?

@general6r
Copy link
Author

@odow Yes I downloaded the free version of CPLEX from the link in CPLEX.jl file. Thank you so much for taking time for me. Is there anything else that I can do to fix it?

@odow
Copy link
Member

odow commented Feb 20, 2019

Some things you could try

  • when did you download it? Has the license expired?
  • Try installing Julia 1.1 and see if CPLEX will install on that.
  • If you are an academic, you can get an academic license for the full version.

Thank you so much for taking time for me.

No worries.

@general6r
Copy link
Author

general6r commented Feb 21, 2019

@odow I downloaded it on Feb 6 and it is valid for 30 days. I installed Julia 1.1 as well and the funny thing is I can't even add packages. For example Pkg.add("JuMP") results in an error saying "Pkg not defined"!!!

@odow
Copy link
Member

odow commented Feb 21, 2019

Many things changed between Julia 0.6 and Julia 1.0. You now need to import Pkg.

julia> import Pkg

julia> Pkg.add("JuMP")

You will probably run into many other issues. However, if you search https://discourse.julialang.org/, you should be able to find lots of questions that others had when upgrading.

In addition, JuMP recently updated. See https://discourse.julialang.org/t/jump-v0-19-has-been-released/20878

@general6r
Copy link
Author

@odow Thank you so much. I finally managed to fix the issue by reinstalling Julia and defining the environment variable.

@odow
Copy link
Member

odow commented Feb 24, 2019

Great!

@odow odow closed this as completed Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants