Open poldy opened 1 year ago
I assume that you are using clang as the C compiler here. The problem is simply that there is not a definition of MR_atomic_sub_int for clang on Aarch64 based systems in the runtime; we will need to add one. (There is a generic definition for GCC which should work on M1 based systems, although I've not tested that myself, so installing GCC via homebrew and using that may be an option.)
Yes, I'm using clang.
I added the bare minimum of
Requiring the use of C11 is not an option in the short to medium term. MSVC only just gained some initial experimental support for C11/C17 style atomics (and I gather even that is not complete). It would make sense for us to starting C11 atomics on platforms where they are supported (i.e. in preference to the inline assembly).
I logged PR #114 in an attempt to do this. Feel free to review ...
The full error message is:
I installed Mercury from homebrew using
brew install mercury
. This is on an M1 Mac running the latest Ventura. A sequential "hello world" program compiles and runs no problem. And indeed, when I compile the Dining Philosophers sample code with either--parallel
or--grade hlc.par.gc
it compiles ok, but when I run it gives the above error message.