bakerstu/openmrn

Errors compiling applications/hub on OSX

Opened this issue · 16 comments

I have been having problems compiling applications/hub on OSX.

1. src/utils/FileUtils.cxx

/Users/dpharris/openmrn/src/utils/FileUtils.cxx:111:12: error: comparison of unsigned expression < 0 is always false
      [-Werror,-Wtautological-compare]
    if (nr < 0) {
        ~~ ^ ~
1 error generated.
make[4]: *** [FileUtils.o] Error 1
make[3]: *** [build-utils] Error 2
make[2]: *** [/Users/dpharris/openmrn/targets/mach.x86/lib/timestamp] Error 2
make[1]: *** [build-mach.x86] Error 2
make: *** [build-targets] Error 2
  • nr is defined as "size_t nr". I made a local fix by commenting out the offending if-block.

2. src/utils/SocketClient.hxx and .cxx ....

/Users/dpharris/openmrn/src/utils/SocketClient.hxx:630:28: error: implicit instantiation of undefined template 'std::__1::array<SocketClient::Attempt, 5>'
    std::array<Attempt, 5> strategyConfig_{{
                           ^

...

Thanks for any help.
David

The first one needs to be fixed by changing it to ssize_t from size_t.

The second is a stream of errors going back to one root cause, so looking at the errors indidivually makes no sense beyond the first one.
Could you try adding #include <array> to the top of SocketClient.hxx?

  1. Fixed.
  2. Improved, but now:
    In file included from /Users/dpharris/openmrn/src/openlcb/TractionCvSpace.cxx:37:
    In file included from /Users/dpharris/openmrn/src/dcc/ProgrammingTrackBackend.hxx:41:
    /Users/dpharris/openmrn/src/dcc/DccOutput.hxx:189:17: error: no template named 'atomic_uint8_t' in
    namespace 'std'; did you mean 'atomic_init'?
    static std::atomic_uint8_t outputDisableReasons_;
    ~~~~~^~~~~~~~~~~~~~
    atomic_init

I think I fixed this by;
replacing std::atomic_uint8_t
with: std::atomic<uint8_t>
at four (4) places in src/Dcc/DccOutput.hxx

I assume that this means that OSX does not have these definitions, or perhaps I am behind as I am on OSX 10.10.5.

@dpharris include/openmrn_features.h

I did not want OpenMRN to use pselect().

Out of curiosity, what is the benefit of pselect() over select(), is it just the sigmask? If so, what does overriding the sigmask provide as a benefit?