OS X is, I believe, considered POSIX OS in most of the case. So I was hoping that Sagittarius would work without any change. Well, it didn't. When I write OS specific code, I refer POSIX spec to make sure I'm writing portable code. Was I doing right? I think so because the code worked on FreeBSD without any change which is also considered POSIX compliant OS. The pitfalls of OSX were the followings:
sem_timedwait
is not implemented (linker error)sem_init
is not supported (can be compiled but an error)- Passing
O_TRUNC
toshm_open
is an error.
Long time ago, Sagittarius got a pull request which made it work on OSX. The PR also contains a fix for libffi search path. It requires to specify the path explicitly. Which I think fine as long as you have control of the environment. However on CI server, we don't know until when the version is there. So I've written kind of solution to fine libffi in build process. So now, you can simply build like the following:
$ cmake . $ makeIt does kinda ugly thing internally but it's working so I'm happy with it.
Then I've experienced build failure number of times (including stupid mistake), finally got the successfull build.
Now, I can say Sagittarius supports OSX again.