Skip to content

getconstant not defined #112

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

Closed
angeris opened this issue Jul 27, 2020 · 7 comments
Closed

getconstant not defined #112

angeris opened this issue Jul 27, 2020 · 7 comments

Comments

@angeris
Copy link

angeris commented Jul 27, 2020

Heya COSMO team!

Here's a (hopefully rather simple) bug:

using JuMP, COSMO

m = Model(COSMO.Optimizer)
@variable(m, x >= 0)

optimize!(m)

which gives

ERROR: LoadError: UndefVarError: getconstant not defined

Essentially, it seems that the function getconstant is not implemented and problem construction fails when including inequality constraints in the variable definition.

Thank you so much!
Guille

@migarstka
Copy link
Member

Thanks for opening the issue.

  1. I believe you forgot to specify the objective in the example above:
using JuMP, COSMO

m = Model(COSMO.Optimizer)
@variable(m, x >= 0)
@objective(m, Min, x)
optimize!(m)
  1. Even if I don't specify the objective, I can't reproduce the error. What versions of JuMP, COSMO and Julia are you using?

@angeris
Copy link
Author

angeris commented Jul 27, 2020

I believe you forgot to specify the objective in the example above:

In my case, it fails independent of specifying an objective (and didn't include it in the MWE) because of it!

Even if I don't specify the objective, I can't reproduce the error. What versions of JuMP, COSMO and Julia are you using?

Here are the current version details (apologies, totally forgot to include them in the OP):

  • Julia v1.4.2
  • COSMO v0.4.1
  • JuMP v0.21.3

Weirdly, the same problem construction also fails even when I add non-negativity as a separate constraint. This must have been some recent interface change from JuMP or MOI or something.

Thanks for the quick response! (For context, I'm attempting to use COSMO to solve some very large SDPs for some types of physical problems.)

@migarstka
Copy link
Member

No worries. Happy to help. Are you sure it's COSMO v0.4.1? That version is 1.5 years old and will likely be incompatible with JuMP v0.21.3

@angeris
Copy link
Author

angeris commented Jul 27, 2020

Huh, that would explain it! Yes, this is what I have on pkg> status. This is odd as I just did a fresh Julia install and installed COSMO from the package manager. Updating now, will report on results...! Thanks again!

@angeris
Copy link
Author

angeris commented Jul 27, 2020

Works beautifully now! I did get some interesting warnings while installing, which I'm not quite sure about:

[ Info: Precompiling COSMO [1e616198-aa4e-51ec-90a2-23f7fbd31d8d]
┌ Warning: Pkg.installed() is deprecated
└ @ Pkg /Applications/Julia-1.4.app/Contents/Resources/julia/share/julia/stdlib/v1.4/Pkg/src/Pkg.jl:531
┌ Warning: Package COSMO does not have Pardiso in its dependencies:- If you have COSMO checked out for development and have
│   added Pardiso as a dependency but haven't updated your primary
│   environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with COSMO
└ Loading Pardiso into COSMO from project dependency, future warnings for COSMO are suppressed.
┌ Warning: Pkg.installed() is deprecated
└ @ Pkg /Applications/Julia-1.4.app/Contents/Resources/julia/share/julia/stdlib/v1.4/Pkg/src/Pkg.jl:531

but this may be to purposefully not require users to install Pardiso as a dependency (from what I can see in the repo). Not exactly sure about the rest.

This may be better as a separate issue, though, so thank you!

@angeris angeris closed this as completed Jul 27, 2020
@migarstka
Copy link
Member

Exactly, we don't want to force users to install Pardiso. Will have to have a closer look why those warnings show up.

@angeris
Copy link
Author

angeris commented Jul 27, 2020

Sounds great, thanks!

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

No branches or pull requests

2 participants