erwincoumans/tiny-differentiable-simulator

'ceres' does not name a type

Closed this issue · 1 comments

When running the install instructions as described in README.md:

mkdir build
cd build
cmake ..
make -j

The build fails with the following error:

tiny-differentiable-simulator/examples/billiard_opt_example_gui.cpp: 
  In member function ‘bool CeresFunctional::operator()(const T*, T*) const’:
tiny-differentiable-simulator/examples/billiard_opt_example_gui.cpp:249:13: error: ‘ceres’ does not name a type
  249 |     typedef ceres::Jet<double, 2> Jet;

Since the error message appears to be referencing some missing ceres definitions, I tried something similar to what was suggested in #20 and added:

find_package(Ceres)
add_definitions(-DUSE_CERES)

To examples/CMakeLists.txt. I then get the following build error:

/tiny-differentiable-simulator/examples/billiard_opt_example_gui.cpp:43:10:
  fatal error: ceres_utils.h: No such file or directory
   43 | #include "ceres_utils.h"

Going off this, I also tried as a last effort adding:

include_directories("../src/math/tiny")

But still no luck, this gives error:

tiny-differentiable-simulator/examples/billiard_opt_example_gui.cpp:349:63:
 error: no matching function for call to ‘rollout<double, TINY::DoubleUtils>(double&, double&, int&, TinyOpenGL3App*)’
  349 |     rollout<double, DoubleUtils>(force_x, force_y, steps, &app);

I am running on :

  • Ubuntu 20.04.1 LTS
  • cmake version 3.18.4
  • g++ version 9.3

We have a script to build Ceres, that should work out-of-the-box, using the Ceres in third_party (not system install!)
build_libs_unix.sh
and
build_libs_windows.bat