Opened 8 years ago

Closed 6 years ago

#53075 closed defect (fixed)

zmq @4.2.0 does not build on a PPC running OS X 10.5.8

Reported by: josephsacco Owned by: merijn (Merijn Verstraaten)
Priority: Normal Milestone:
Component: ports Version:
Keywords: leopard powerpc Cc: michaelld (Michael Dickens), stromnov (Andrey Stromnov)
Port: zmq

Description (last modified by ryandesign (Ryan Carsten Schmidt))

The latest version of zmq does not build on a PPC running leopard. The previous version, 4.1.6_0, builds without incident.

The problem is CLOCK_MONOTONIC is not defined in time.h for OSX 10.5.8[see snippet of build output below].

-Joseph

src/clock.cpp: In static member function 'static uint64_t zmq::clock_t::rdtsc()':
src/clock.cpp:243:19: error: 'CLOCK_MONOTONIC' was not declared in this scope
     clock_gettime(CLOCK_MONOTONIC, &ts);
                   ^~~~~~~~~~~~~~~
src/clock.cpp:243:39: error: 'clock_gettime' was not declared in this scope
     clock_gettime(CLOCK_MONOTONIC, &ts);
                                       ^

Change History (7)

comment:1 Changed 8 years ago by kencu (Ken)

The issue could be here <https://github.com/zeromq/libzmq/commit/0dfb32a2595e96bd5850987c7cab9a7936e672e8>

this guard block

#if defined ZMQ_HAVE_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 // less than macOS 10.12    
 +    int rc = alt_clock_gettime (CLOCK_MONOTONIC, &tv);
 +#else
      int rc = clock_gettime (CLOCK_MONOTONIC, &tv);
 +#endif

might not be working correctly for Leopard, because Leopard should not be seeing that function call, it appears. Why don't you try forcing alt_clock_gettime to be used and see if that fixes it?

for a quick one-off way to do that, port -v configure it, go into the source, and monkey with that file like so maybe:

int rc = alt_clock_gettime (CLOCK_MONOTONIC, &tv);

then try building. If it doesn't work, look for other guards that might need fiddling with.

comment:2 Changed 8 years ago by josephsacco

That was one of the first things I tried... :-) The problem is the macro CLOCK_MONOTONIC is not defined for OS X 10.5.8.

The code for version 4.1.6 does something far more trivial. The method containing the offending line,

   zmq::clock_t::rdsc()

returns 0 under OS X 10.5.8.

I am not sure what that means, or whether it is the right thing to do. If I make that change, zmq @4.2 builds.

For added amusement I then ran make check. Of the 77 tests that ran, only 3 passed. The remaining 74 failed [illegal instruction: exit 132].

For comparison, I ran make check on version 4.1.6. Of the 62 tests, 61 passed, and 1 failed [test_unbind_wildcard].

-Joseph

Last edited 8 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: michaelld stromnov added; stromnov@… removed
Description: modified (diff)
Owner: set to merijn@…
Status: newassigned

comment:4 Changed 8 years ago by mf2k (Frank Schima)

Keywords: leopard, powerpcleopard powerpc

comment:5 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Is this still a problem? If so, please report it to the developers of zmq so that they can fix it.

comment:6 Changed 6 years ago by josephsacco

Ryan,

zmq @4.3.0_0 builds and installs on a PPC running OS X 10.5.8. A change was made to the guard block in src/clock.cpp

#if defined ZMQ_HAVE_OSX                                                       \
  && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 // less than macOS 10.12
    alt_clock_gettime (SYSTEM_CLOCK, &ts);
#else
    clock_gettime (CLOCK_MONOTONIC, &ts);
#endif
    return static_cast<uint64_t> (ts.tv_sec) * nsecs_per_usec * usecs_per_sec
           + ts.tv_nsec;
#endif

The call to alt_clock_gettime() now uses SYSTEM_CLOCK rather than CLOCK_MONOTONIC.

-Joseph

comment:7 Changed 6 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

I'm going to go ahead and close this ticket as fixed (even if, admittedly, it wasn't intentional to do so). Thanks for reporting back!

Note: See TracTickets for help on using tickets.