Skip to content
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

Get qpid C++ building on OSX. #7

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open

Conversation

tibbetts
Copy link

@tibbetts tibbetts commented Apr 7, 2015

QPID-2536: Implement posix clock_gettime
QPID-4280: clock_gettime not available on Mac OS X
QPID-4278: Broken OS X Build

Add documentation to INSTALL and fix up build scripts
Conditionalize posix clock routines for MACH
sigfillset is a macro on osx.
Open question around absolute time pthread wait()s.

QPID-4280: clock_gettime not available on Mac OS X

Get qpid C++ building on OSX.
Add documentation to INSTALL and fix up build scripts
Conditionalize posix clock routines for __MACH__
sigfillset is a macro on osx.
Open question around absolute time pthread wait()s.
@astitcher
Copy link
Member

This implementation doesn't follow the usual qpid portability strategy for not introducing inline conditional compilation.

The way we do do this in qpid is to introduce a new file for the platform and compile that as an alternative implementation. the posix/Time.cpp file is more-or-les reimplemented so this needs to be a new file with the new implementation and not switched using long term unmaintainable #ifdefs.

Also I think that you will have a fundamental problem with timekeeping if condvars can't use monotonic clocks - You will basically have to have a custom OSX implementation of timekeeping and condvars. As you can't have one use a monotonic clock without the other

Also we don't need a commit to remove commented out stuff, when the it was the other commit in the pull request that introduced it, please just squash them together.

@sideshowcoder
Copy link

I just found this and also http://web.archive.org/web/20100501115556/http://le-depotoir.googlecode.com/svn/trunk/misc/clock_gettime_stub.c which tries to provided a version of monotonic clocks on OSX, what do you think about using something like this gettime_stub on OSX to provide Monotonic clock functionality?

@astitcher
Copy link
Member

As a way to implement clock_gettime() this seems like a good approach.

However the bigger problem is the timekeeping between clock_gettime() and condition vars need to be the same. So you would either need to reimplement condvars to use CLOCK_MONOTONIC (SYSTEM_CLOCK?) or go back to using CLOCK_REALTIME in the OSX port.

The reason we changed to CLOCK_MONOTONIC in the first instance is that CLOCK_REALTIME can go backwards if the system time is changed and this has bad effects on qpid. If OSX/Mach CALENDAR_CLOCK can't go backwards then this isn't important, I expect that, given its name, it can go back though.

@mbroadst
Copy link

@astitcher do you have an proposed way forward with this? Being able to build qpidd on my laptop without booting up a VM would be really great

@mbroadst
Copy link

mbroadst commented Jul 6, 2016

@sideshowcoder have you tried using that stub locally at all?

@sideshowcoder
Copy link

@mbroadst I tried with the stub back when I commented but only compile and made some more changes I think to actually get it to compile not sure what I got out actually worked as I since then moved to prototype on Java, but I can try again.

@gemmellr
Copy link
Member

gemmellr commented Jul 7, 2016

Note that any progress here will need a new PR with this one being closed, as the code has now migrated to its own repo, which is mirrored at: https://github.com/apache/qpid-cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants