unicode μ causes problems on older compilers
Closed this issue · 5 comments
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.
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.)
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.
@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.
If memory serves, the mu was the only unicode character I hit. So the pull request is probably good enough to merge.
I think this is resolved now. Please reopen if not.