-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port openmcx to macOS #18
base: main
Are you sure you want to change the base?
Conversation
`__mcx_dll_load()` makes use of the function `dlopen()`, which has a flag parameter. On Linux one uses `RTLD_DEEPBIND` to ensure that a library uses its own symbols rather than those provided by other loaded libraries. On MacOS there is not a direct equivalent available. Signed-off-by: Robin Caloudis <[email protected]>
Signed-off-by: Robin Caloudis <[email protected]>
Signed-off-by: Robin Caloudis <[email protected]>
Signed-off-by: Robin Caloudis <[email protected]>
Signed-off-by: Robin Caloudis <[email protected]>
When openmcx gets compiled on a Apple machine, it requires two additional headers to be present. My assumption is that these headers find its way into the compilation unit transitively on Linux and Windows machines, which they do not on Apple machines. Signed-off-by: Robin Caloudis <[email protected]>
a3d5983
to
339f1f8
Compare
22c0c30
to
5262e95
Compare
Hi, I'm working porting a Linux specific repo to MacOs Catalina. I have some queries on it. Is it possible to reach out to you on dm and have a discussion on the same. Apologise as the message is not relevant to this posting. |
Hi @Kamal-Nabhan-mcw, sure. You can reach me via my mail |
src/objects/ObjectContainer.c
Outdated
const void *second) { | ||
#else | ||
static int ObjectContainerElementCmp(const void * first, const void * second, | ||
void * ctx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation contains spaces and tabs. Please just use spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally right. Messed up my editor configs. Corrected it. Thank you.
#if(__APPLE__) | ||
void mcx_sort(void *base, size_t nmemb, size_t size, | ||
int (*compar)(void *, const void *, const void *), void *arg); | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange that the arg argument comes first in the apple implementation. We should add a comment to the source code to point this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment 👍
Signed-off-by: Robin Caloudis <[email protected]>
5262e95
to
05df465
Compare
05df465
to
7edbe23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@klausschuch, thanks for your review! Fixed all of your mentioned concerns. Please re-review.
#if(__APPLE__) | ||
void mcx_sort(void *base, size_t nmemb, size_t size, | ||
int (*compar)(void *, const void *, const void *), void *arg); | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment 👍
src/objects/ObjectContainer.c
Outdated
const void *second) { | ||
#else | ||
static int ObjectContainerElementCmp(const void * first, const void * second, | ||
void * ctx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally right. Messed up my editor configs. Corrected it. Thank you.
Why
Currently, openmcx cannot be build on a macOS machine due to platform-specific code.
What
linux
tounix
if underlying source code is common to Linux and macOS/examples
Tested on Apple Silicon M2.