JuliaConstraints / CPLEXCP.jl

Julia interface for CPLEX CP Optimizer
MIT License
3 stars 1 forks source link

Think about wrapping the C++ API #7

Open dourouc05 opened 2 years ago

dourouc05 commented 2 years ago

Possible way to write the wrapper: https://github.com/grasph/wrapit

Still the problem of a closed-source dependency, I'm afraid that wrappers generated with CxxWrap.jl link the static CPLEX CP library :/.

matheusdiogenesandrade commented 1 year ago

Sorry for the ingenuous question, but what would be the advantage of calling the C++ API instead of the Java API, as it is stands now?

dourouc05 commented 1 year ago

The major advantage would be to get rid of the JVM, a useless dependency that also adds some overhead to each function call (the solver being written in C++). JavaCall.jl also has some quirks (JULIA_COPY_STACKS when this package was developed, the function init that can only be called once and may cause problems if users are calling other Java libraries). It should work fine for many use cases, but it's clearly not a good fit for production use, for instance.

However, the major advantage of Java is that there is already a nice way to call functions without a lot of work, unlike C++, where you need to write your own C++ wrapper (CxxWrap.jl), especially as CPLEX CP Optimizer is not available as a shared library (.so/.dll). Users would then need to compile something on their end, as I believe IBM would not be happy to see a freely available binary with their solver.

1991jhf commented 1 year ago

Is there any plan to support CP-SAT Solver?

matheusdiogenesandrade commented 1 year ago

Is there any plan to support CP-SAT Solver?

Not sure, but it was already discussed before https://github.com/google/or-tools/issues/2584.

dourouc05 commented 1 year ago

There is absolutely no plan to support CP-SAT in this package, because it only wraps CPLEX CP Optimizer and nothing else :). But there might be another package to support OR-Tools.