convexengineering / gpkit

Geometric programming for engineers
http://gpkit.readthedocs.org
MIT License
206 stars 40 forks source link

No backwards compatibility with MOSEK C api? #1471

Closed pgkirsch closed 4 years ago

pgkirsch commented 4 years ago

As of 367a46dd78d4369b286784687c98e1314d064f08, GPkit can't find my installation of mosek:

--> 518     sol = hl.localsolve()
    519     sol.savetxt("fixedmass.sol")
    520     sol.save("fixedmass.p")

~/Documents/Optimization/gpkit/gpkit/constraints/prog_factories.py in solvefn(self, solver, verbosity, skipsweepfailures, **kwargs)
    124         else:
    125             self.program, progsolve = genfunction(self, **kwargs)
--> 126             result = progsolve(solver, verbosity=verbosity, **kwargs)
    127             solution.append(result)
    128         solution.to_arrays()

~/Documents/Optimization/gpkit/gpkit/constraints/sgp.py in localsolve(self, solver, verbosity, x0, reltol, iteration_limit, mutategp, **solveargs)
    152                 print("===============")
    153             solver_out = gp.solve(solver, verbosity=verbosity-1,
--> 154                                   gen_result=False, **solveargs)
    155             self.solver_outs.append(solver_out)
    156             cost = float(solver_out["objective"])

~/Documents/Optimization/gpkit/gpkit/constraints/gp.py in solve(self, solver, verbosity, process_result, gen_result, **kwargs)
    180         result : SolutionArray
    181         """
--> 182         solvername, solverfn = _get_solver(solver, kwargs)
    183         solver_kwargs = DEFAULT_SOLVER_KWARGS.get(solvername, {})
    184         solver_kwargs.update(kwargs)

~/Documents/Optimization/gpkit/gpkit/constraints/gp.py in _get_solver(solver, kwargs)
     44         solver, optimize = solver.__name__, solver
     45     else:
---> 46         raise ValueError("Unknown solver '%s'." % solver)
     47     return solver, optimize
     48 

ValueError: Unknown solver 'mosek'.

So I tried re-building and got the following:

# Looking for mosek_conif
#   Trying to import mosek...
# Did not find
# mosek_conif
#

What is mosek_conif and do I need to do something to my mosek installation?

Judging by the commit notes for 367a46dd78d4369b286784687c98e1314d064f08, I may need to download something other than the C api?

1ozturkbe commented 4 years ago

@pgkirsch mosek_conif is the mosek 9.0 integration through the Python Optimizer API. It works if you pip install -e mosek from a local mosek9 directory. everything else is compatible with mosek 8. Have you tried reinstalling and building gpkit to find the solvers again?

pgkirsch commented 4 years ago

I don't have mosek 9 and won't be able to get it for the foreseeable future (commercial licenses).

I believe I tried rebuilding (see above). Does anything need to be done besides python build.py?

1ozturkbe commented 4 years ago

Oy, sorry I misred your post. It seems like Ned has scrapped support for mosek C bindings in the v1.0.0pre PR. Don't know why, @bqpd? Sorry about that @pgkirsch.

1ozturkbe commented 4 years ago

Is mosek_cli not an option @pgkirsch? That still uses mosek8.

bqpd commented 4 years ago

Yeah unfortunately supporting mosek in Python3 was shaping up to be a huge hassle; considering mosek_cli is almost identical in performance I was hoping everyone could use that instead, at least until Mosek9 is as fast.

pgkirsch commented 4 years ago

All good @1ozturkbe.

And ok, works for me @bqpd, good to know why.