Issue with generate_precompile.
Hello,
I am working on a project where I am trying to interface Julia and C++ code (i.e., embedding Julia code in C++). For reference, I am using a package structure similar to: libcg/CG.
The associated Julia code I am working with uses JuMP, MOI (MathOptInterface) and Mosek for a numerical optimization task. My generate_precompile.jl code runs perfectly if I simply cd to my package directory and call:
julia --startup-file=no --project=. build/generate_precompile.jl
However, when I try to call PackageCompiler.create_library with this same generate_precompile function, I get the following error relating to the MOI package:
ERROR: LoadError: MathOptInterface.UnsupportedConstraint{MathOptInterface.ScalarQuadraticFunction{Float64}, MathOptInterface.LessThan{Float64}}: 'MathOptInterface.ScalarQuadraticFunction{Float64}'-in-'MathOptInterface.LessThan{Float64}' constraint is not supported by the model: Unable to transform a quadratic constraint into a second-order cone constraint because the quadratic constraint is not strongly convex.
Convex constraints that are not strongly convex (i.e., the matrix is positive semidefinite but not positive definite) are not supported yet.
Note that a quadratic equality constraint is non-convex.
It appears this issue above was fixed in jump-dev/MathOptInterface.jl#529, so it is unclear why it is still occurring specifically when using the create_library feature. I am unsure if this is an issue with MOI's build process, or with PackageCompiler, but I welcome any debugging suggestions or ideas.
For reference, I have localized which portions of my optimization problem setup are triggering the issue and preventing compilation, however I am unable to reformalize the problem without compromising the intended purpose of the code.
Would it be possible to setup a repository with code that reproduces the issue? It is hard to do much with the information given in here.
Hey @KristofferC, I went ahead and produced a minimum working example to replicate this issue. The following repository provides a very simple optimization routine using JuMP/ECOS: https://github.com/sbuckner50/JuMPCompiledLib.jl
As before, the build/generate_precompile.jl code runs perfectly by itself, but throws the same type of error as before during precompilation when calling make to build the library.
I also want to note real quick that there appears to be another error involving the LinearAlgebra package that is causing the MathOptInterface error in question:
caused by: MethodError: no method matching cholesky(::LinearAlgebra.Symmetric{Float64, SparseArrays.SparseMatrixCSC{Float64, Int64}})
This is making me wonder -- is it possible there is a dependency issue between MathOptInterface and LinearAlgebra?
I also want to note that a quadratic term in the cost function is not the only thing causing this issue to occur, however I figured it would be the simplest way to reproduce and approach this.