Epigraph icon indicating copy to clipboard operation
Epigraph copied to clipboard

Conan package

Open BenjaminNavarro opened this issue 3 years ago • 11 comments

I wanted to give Epigraph a try and since I get my other dependencies using Conan I thought it would be nice to make a Conan package for Epigraph.

So I tried to make one but I stumble on a few problems due to how the project is organized and how its dependencies are managed:

  1. Use of Git submodules: to follow the Conan philosophy it would be better to have the solvers as Conan packages rather than submodules. For this, Epigraph needs a way to rely on find_pakage() for the solvers rather than pulling them directly. A CMake option could make this possible.
  2. Include paths: the solvers' headers are included like #include <solver/include/file.h> which is non standard and doesn't respect how these files are installed (<prefix>/include/solver/file.h) which requires #include <solver/file.h>. Also, Epigraph doesn't use a subfolder for its headers which might lead to clashes, i.e #include <epigraph/variable.hpp> would be better than #include <variable.hpp>
  3. No CMake install rules for Epigraph: running the CMake install target will properly install the solvers (headers + libs) but not Epigraph itself.

For now I'll use Epigraph as a submodule even if it's not ideal but if you are interested in Conan support, I'd encourage you to address the issues I raised. Basically, you need to make sure that Epigraph can be compiled using system dependencies (relying on find_package) and that it installs itself properly inside CMAKE_INSTALL_PREFIX when running the install target. If this works, I can make the Conan packages for Epigraph and its solvers (if they don't have one already).

BenjaminNavarro avatar Aug 25 '20 08:08 BenjaminNavarro

Thanks for the detailed report. I can make these changes.

But first we have to make sure that the solvers (OSQP and ECOS) can actually be installed and found with find_package(). I checked that this is possible with OSQP, but not with ECOS, since it does not have the cmake support to install it. I opened a PR for basic cmake support a couple of days ago, but without the installation part. Since your report I've put a couple of hours into adding installation support to that as well, but it turned out to be much more difficult than anticipated. Getting closer though.

Or maybe there's a different way?

EmbersArc avatar Aug 26 '20 09:08 EmbersArc

Getting CMake support for ECOS is probably the best way to do it but if the PR gets rejected it's probably possible to write a custom CMake find file for ECOS distributed with Epigraph.

Let's wait for an update on the PR before doing anything else.

BenjaminNavarro avatar Aug 26 '20 10:08 BenjaminNavarro

Okay I rewrote the new ECOS CMakeLists.txt to enable installation. When this PR gets accepted I can focus on the Epigraph side of Conan integration.

EmbersArc avatar Aug 26 '20 13:08 EmbersArc

The ECOS CMake support has been merged into the develop branch. If you want, you can now make the Conan packages for OSQP and ECOS. I'll make sure that Epigraph will be able to find them with find_package().

EmbersArc avatar Sep 11 '20 08:09 EmbersArc

Great, I'll look into it and keep you posted

BenjaminNavarro avatar Sep 11 '20 08:09 BenjaminNavarro

Done:

  • OSQP: https://github.com/BenjaminNavarro/conan-oqp & https://bintray.com/benjaminnavarro/bnavarro/osqp%3Abnavarro
  • ECOS: https://github.com/BenjaminNavarro/conan-ecos & https://bintray.com/benjaminnavarro/bnavarro/ecos%3Abnavarro

Do you want me to package EiCOS as well while I'm at it?

BenjaminNavarro avatar Sep 11 '20 10:09 BenjaminNavarro

Thanks for making these! Epigraph will now search for the solvers before automatically pulling the submodules. I've had to open another PR for ECOS to fix a tiny error in the CMake installation. So I don't expect it to work yet, let me know if it does though.

EmbersArc avatar Sep 15 '20 12:09 EmbersArc

I made the Conan package for Epigraph and it seems to be functional since the test_package successfully build and run an app using both OSQP and ECOS. Here are the links: Github: https://github.com/BenjaminNavarro/conan-epigraph Bintray: https://bintray.com/benjaminnavarro/bnavarro/epigraph%3Abnavarro

BenjaminNavarro avatar Sep 16 '20 15:09 BenjaminNavarro

I can't imagine why ECOS works after all (I was expecting a segfault), but that sounds great. Thanks again. You can close the issue if you want, or let me know if any changes are still necessary.

EmbersArc avatar Sep 29 '20 10:09 EmbersArc

I'll still wait for your PR on ECOS to get merged so that I can target this commit instead.

Maybe you can you add a note in the readme to indicate users that a Conan package exists for Epigraph with a link to it.

BenjaminNavarro avatar Sep 29 '20 11:09 BenjaminNavarro

Just found an issue with Eigen, #6 fixes it

BenjaminNavarro avatar Sep 30 '20 15:09 BenjaminNavarro