oxfordcontrol / Clarabel.cpp

Clarabel.cpp: C/C++ interface to the Clarabel Interior-point solver for convex conic optimisation problems.
Apache License 2.0
32 stars 10 forks source link

Ninja missing byproducts on clean build #45

Open codeinred opened 1 month ago

codeinred commented 1 month ago

If you download the repository fresh, and attempt to build with Ninja, the build fails with the following error:

ninja: error: '/Users/alecto/3rd/Clarabel.cpp/rust_wrapper/target/debug/libclarabel_c.dylib', needed by 'examples/c/example_expcone', missing and no known rule to make it

This is because Ninja can't find libclarabel_c.a/libclarabel_c.dylib, and the libclarabel_c custom target doesn't inform Ninja that it produces these libraries.

This can be handled by adding LIBCLARABEL_C_SHARED_PATH and LIBCLARABEL_C_STATIC_PATH as byproducts of the call to add_custom_target