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

unicode μ causes problems on older compilers #27

Closed ghorn closed 5 months ago

ghorn commented 9 months ago

Using GCC 9.4, I had a build error where the C interface would not accept the unicode μ character. GCC 9.4 is not old (June 2021) or uncommon (I came across it using an nvidia toolchain for a new product).

Is it possible to use "mu" in the C++ part and "μ" in the rust part? My workaround was a global find-replace but that doesn't help other people.

jwnimmer-tri commented 9 months ago

FYI We also hit this problem when integrating Clarabel.cpp into Drake.

My solution there was to only support the Drake-Clarabel integration on Ubuntu 22.04 or newer (and macOS, with Clang).

This is not a big deal for Drake, since our support for the older Ubuntu 20.04 will reach end-of-life next March, anyway.

(Additionally, Clarabel.cpp is also not compatible with the default Eigen 3.3.7 on Ubuntu 20.04, so even if the mu error was fixed, we still couldn't support the older Ubuntu anyway.)

goulart-paul commented 9 months ago

Fix in #29. It compiles fine for me this way, but I can't exclude the possibility that other compilers may complain about some unicode characters I missed since my compiler was not complaining already.

I will keep this open for a few days before merging. If you have a chance to try this new branch before I merge it would be appreciated.

ghorn commented 9 months ago

@goulart-paul I'm sorry but I don't have an easy way to test until it's released on pypi. I can report back after that.

@jwnimmer-tri I also hit the Eigen issue. I have to compile in a docker container for later use with cc_import, so I just downloaded and built with the newer Eigen version.

jwnimmer-tri commented 8 months ago

If memory serves, the mu was the only unicode character I hit. So the pull request is probably good enough to merge.

goulart-paul commented 5 months ago

I think this is resolved now. Please reopen if not.