roboptim/roboptim-core

Difficulty installing roboptim-core from homebrew

ahundt opened this issue · 7 comments

It tried installing roboptim-core from homebrew, but it failed. Here is the diagnostic info:

https://gist.github.com/466dcf1146052896ee28

which is from this command sequence you provided in the instructions:

# We make assumption that you have already installed Homebrew!
    # If this is not the case, please look at: http://brew.sh/

    # Add the repositories
    brew tap homebrew/python   # only for roboptim-core-python
    brew tap homebrew/science  # for IPOPT, CMinPack
    brew tap roboptim/roboptim

    # RobOptim Core
    brew install --HEAD roboptim/roboptim/roboptim-core

    # RobOptim Core Plugin CMinPack
    brew install --HEAD roboptim/roboptim/roboptim-core-plugin-cminpack

    # RobOptim Core Plugin IPOPT
    brew install --HEAD roboptim/roboptim/roboptim-core-plugin-ipopt

    # RobOptim Trajectory
    brew install --HEAD roboptim/roboptim/roboptim-trajectory

    # RobOptim Capsule
    brew install --HEAD roboptim/roboptim/roboptim-capsule

    # IMPORTANT: some of these repositories are not released.
    # In this case, you can install from Git using:
    # brew install --HEAD a_package
    #
    # Note that in this case, you have to install *all* packages
    # from source (even roboptim-core!).

I believe all the other ones failed too, but they probably require the core anyway.

Thanks for reporting this! The problem is here, there's actually an extra build-time dependency on texlive-core/ghostscript (or whatever their name is on homebrew) for generating the documentation. Thus, we have 2 options here:

  • Add LaTeX as a dependency in the homebrew formula, but I don't use a Mac (@thomas-moulard took care of this), so you would need provide a PR to homebrew-roboptim addressing this issue, and I would merge it.
  • Use another backend for LaTeX formulae with doxygen (apparently MathJax is supported).

The second option seems better, so I will give it a go and see how it goes.

If you want to use the release homebrew formulae (and they need a version bump), for now we will need to add the LaTeX-related dependencies, but this should no longer be the case for the next releases (cf. jrl-umi3218/jrl-cmakemodules#57). If you're using the master branch, the MathJax version should be available tomorrow (it's just a matter of updating the submodule and setting DOXYGEN_USE_MATHJAX to YES).

Thanks, I'm planning on using this with the Posture Generator library. I also wouldn't mind cloning and compiling the code myself. Is there a branch that is better to use than master?

I tried running my script again, reproduced below. However several of the dependencies still failed.

# We make assumption that you have already installed Homebrew!
    # If this is not the case, please look at: http://brew.sh/

    # Add the repositories
    brew tap homebrew/python   # only for roboptim-core-python
    brew tap homebrew/science  # for IPOPT, CMinPack
    brew tap roboptim/roboptim

    # RobOptim Core
    brew install --HEAD roboptim/roboptim/roboptim-core

    # RobOptim Core Plugin CMinPack
    brew install --HEAD roboptim/roboptim/roboptim-core-plugin-cminpack

    # RobOptim Core Plugin IPOPT
    brew install --HEAD roboptim/roboptim/roboptim-core-plugin-ipopt

    # RobOptim Trajectory
    brew install --HEAD roboptim/roboptim/roboptim-trajectory

    # RobOptim Capsule
    brew install --HEAD roboptim/roboptim/roboptim-capsule

    # IMPORTANT: some of these repositories are not released.
    # In this case, you can install from Git using:
    # brew install --HEAD a_package
    #
    # Note that in this case, you have to install *all* packages
    # from source (even roboptim-core!).

For example: here is the next error on the list:

○  brew install --HEAD roboptim/roboptim/roboptim-core-plugin-cminpack
==> Installing roboptim-core-plugin-cminpack from roboptim/homebrew-roboptim
==> Cloning https://github.com/roboptim/roboptim-core-plugin-cminpack.git
Updating /Library/Caches/Homebrew/roboptim-core-plugin-cminpack--git
==> Checking out branch master
Error: inreplace failed
CMakeLists.txt:
  expected replacement of "ADD_REQUIRED_DEPENDENCY(\"roboptim-core >= 2.0\")" with "ADD_REQUIRED_DEPENDENCY(\"roboptim-core\")"

For the PG (cc @jorisv), the only RobOptim packages you need are roboptim-core and roboptim-core-plugin-ipopt (which is missing from PG's CMakeLists.txt), and apparently the old 2.0 API is used.

Ok, thanks for the info. Are the 2.0 components still present in the current API or has there been a breaking change? That is, do I need to use an old version or will the current one run with it?

The API changed quite a lot, mostly from version 2.0 to 3.0, the biggest change involves the functions and was required since we now use Eigen::Ref to avoid costly allocations/copies.

I don't know if @jorisv plans on updating it, but just in case: most of it can be solved with some simple regular expressions, and the details are explained here. Also, if using the master branch and the IPOPT plugin, some of the latest (not released) changes target sparse computation for increased performance: when filling the Jacobian matrix of constraints (e.g. here), coeffRef needs to be used in place of insert, since we now keep the allocated matrices in the plugins, and insert cannot be used on existing elements, while coeffRef will add it if it does not exist. I did this since that specific part became quite expensive for very large sparse matrices (e.g. ~30 000 nonzeros), and got a really appreciated speedup out of it.

In the meantime you need to use the 2.0 release (but we're back to the original problem where latex/dvips/gs will be expected when generating the doc).