multiscale / muscle3

The third major version of the MUltiScale Coupling Library and Environment
Apache License 2.0
25 stars 13 forks source link

data.hpp includes msgpack.hpp #284

Open LourensVeen opened 6 months ago

LourensVeen commented 6 months ago

I'm seeing an issue on a Mac that has msgpack installed via Homebrew, while compiling a MUSCLE3-using model with XCode's clang. Clang doesn't know about Homebrew, and doesn't add Homebrew's include directory (/usr/local/include on Intel Macs, /opt/homebrew/include on Apple Silicon) to the include paths. See also https://apple.stackexchange.com/questions/414622/installing-a-c-c-library-with-homebrew-on-m1-macs

MUSCLE3's data.hpp includes msgpack.hpp, so if you include data.hpp and don't have the msgpack headers available, compilation fails. And if you compiled MUSCLE3 with Homebrew-installed msgpack, then you won't have the headers.

The SE post suggests some system-wide fixes, but it would be nice if this worked anyway since the model doesn't directly depend on msgpack, only on libmuscle. For the dynamic library this is no problem because we're using macos's rpath facilities, but for the headers it doesn't work.

Possible fixes: