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

Example fails with undefined reference to JuMP.OptimizerFactory #9

Closed
richardzhu opened this issue Feb 18, 2020 · 3 comments · Fixed by #10
Closed

Example fails with undefined reference to JuMP.OptimizerFactory #9

richardzhu opened this issue Feb 18, 2020 · 3 comments · Fixed by #10

Comments

@richardzhu
Copy link

richardzhu commented Feb 18, 2020

I tried to run the example as detailed in the README, but got the following error:

julia> using TravelingSalesmanExact, GLPK
[ Info: Precompiling TravelingSalesmanExact [737fac7d-4440-55ef-927e-002196e95561]
ERROR: LoadError: UndefVarError: OptimizerFactory not defined
Stacktrace:
 [1] top-level scope at /Users/richardzhu/.julia/packages/TravelingSalesmanExact/7TcDo/src/TravelingSalesmanExact.jl:10
 [2] include at ./boot.jl:328 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1105
 [4] include(::Module, ::String) at ./Base.jl:31
 [5] top-level scope at none:2
 [6] eval at ./boot.jl:330 [inlined]
 [7] eval(::Expr) at ./client.jl:425
 [8] top-level scope at ./none:3
in expression starting at /Users/richardzhu/.julia/packages/TravelingSalesmanExact/7TcDo/src/TravelingSalesmanExact.jl:10

There doesn't seem to be any such OptimizerFactory, not sure if the newest version of JuMP removed it? I have JuMP 0.21 on a new install of Julia 1.3.1

As an aside, after copy-pasting the src code into my own file, removing the getters/setters for the optimizer, manually writing optimizer = GLPK.Optimizer in place of all the optimizer getters, I manage to get the code to run!

@ericphanson
Copy link
Owner

Thanks very much for the report! Yes, I think JuMP removed those in 0.21. There was a compounding problem that I hadn't added compatability info to the registry when I registered this package, so it didn't know to disallow JuMP 0.21. I added a new version TravelingSalesmanExact 0.3.3 to fix that, and then I'll make the changes for JuMP 0.21 and put out a 0.3.4 release which should solve this.

Glad you got it working anyway! By the way, in case you didn't know, Julia's package manager makes that kind of thing easy with the develop function: you can do ] dev TravelingSalesmanExact and it will download a copy of the source to your computer, and you can make changes use the package locally with those changes too.

@ericphanson
Copy link
Owner

TravelingSalesmanExact 0.3.4 has been released and is compatible with JuMP 0.21, so the example from the (updated) README should now work. You might have to do an using Pkg; Pkg.update() to get the release first, and restart your Julia session to load the new code.

@richardzhu
Copy link
Author

Thanks very much for the report! Yes, I think JuMP removed those in 0.21. There was a compounding problem that I hadn't added compatability info to the registry when I registered this package, so it didn't know to disallow JuMP 0.21. I added a new version TravelingSalesmanExact 0.3.3 to fix that, and then I'll make the changes for JuMP 0.21 and put out a 0.3.4 release which should solve this.

Sweet! Thanks for the fast response.

By the way, in case you didn't know, Julia's package manager makes that kind of thing easy with the develop function: you can do ] dev TravelingSalesmanExact and it will download a copy of the source to your computer, and you can make changes use the package locally with those changes too.

That's neat, I'll keep that in mind as I do more Julia spelunking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants