You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Benjamin Mahler <bm...@apache.org> on 2016/12/01 20:34:41 UTC

Building on OS X 10.12

I ran into some compilation issues after upgrading to OS X 10.12.1, and was
able to build successfully with Jie's help.

The first thing was that I encountered a lot of these deprecation warnings:

../../../3rdparty/libprocess/../stout/include/stout/os/posix/su.hpp:241:9:
warning: 'syscall' is deprecated: first deprecated in macOS 10.12 -
syscall(2) is unsupported; please switch to a supported interface. For
SYS_kdebug_trace use kdebug_signpost(). [-Wdeprecated-declarations]

Which was fixed by adding CXXFLAGS=-Wno-deprecated-declarations when
configuring.

The next thing was hitting the following when running the libprocess tests:

./libprocess-tests
Failed to obtain the IP address for 'Benjamins-MacBook-Pro.local'; the DNS
service may not be able to resolve it: nodename nor servname provided, or
not known

To resolve this, (I'm not sure how Jie figured this out), I had to go into
System Preferences > Sharing and turn on Remote Login (but you'll want to
do this only for administrators I assume..).

The last thing was that apparently there is an incompatibility in the
system installed apr and svn headers, which is fixed by using the headers
from a brew installation of subversion. For me, I had to re-install the
brew version before I could successfully point to them during configuration:

$ brew unlink subversion
$ brew install subversion
$ ../configure CXXFLAGS=-Wno-deprecated-declarations --disable-python
--disable-java --with-apr=/usr/local/opt/apr/libexec
--with-svn=/usr/local/opt/subversion

I figured this would be helpful to anyone else running into these issues,
I'll update the getting started page to direct users towards these steps.

Ben

Re: Building on OS X 10.12

Posted by tommy xiao <xi...@gmail.com>.
Cool

2016-12-03 14:54 GMT+08:00 Jie Yu <yu...@gmail.com>:

> Another tip. If you are on macOS sierra, you might notice the linking is
> extremely slow using the default clang.
>
> Using CXXFLAGS `-fvisibility-inlines-hidden` will greatly speedup the
> linking.
>
> - Jie
>
> On Thu, Dec 1, 2016 at 5:05 PM, Michael Park <mp...@apache.org> wrote:
>
> > Thanks for writing this up!
> >
> > The remote login thing is funky!
> >
> > The `-Wno-deprecated-declarations` is currently very unfortunate, and
> > hopefully we can fix this in our build automatically soon.
> > I personally have been doing: `CC="ccache clang-3.7
> > -Wno-deprecated-declarations" CXX="ccache clang++-3.7
> > -Wno-deprecated-declarations"`
> > for now because setting `CXXFLAGS` overrides everything. For example,
> > `--enable-optimize` won't do anything if `CXXFLAGS` is set.
> >
> > For the `apr` issues, we should be detecting whether we have a `brew`
> > version installed or not on OS X and use it if it's available.
> > The following patches make the build system `apr` similar to
> `subversion`,
> > `libevent` as well as `openssl`.
> >
> > https://reviews.apache.org/r/54278/
> > https://reviews.apache.org/r/54279/
> > https://reviews.apache.org/r/54280/
> >
> > On Thu, Dec 1, 2016 at 12:50 PM, Benjamin Mahler <bm...@apache.org>
> > wrote:
> >
> > > Here is the update:
> > >
> > > https://reviews.apache.org/r/54262/
> > >
> > > On Thu, Dec 1, 2016 at 12:36 PM, Vinod Kone <vi...@apache.org>
> > wrote:
> > >
> > > > Thanks!
> > > >
> > > > On Thu, Dec 1, 2016 at 12:34 PM, Benjamin Mahler <bmahler@apache.org
> >
> > > > wrote:
> > > >
> > > > > I ran into some compilation issues after upgrading to OS X 10.12.1,
> > and
> > > > was
> > > > > able to build successfully with Jie's help.
> > > > >
> > > > > The first thing was that I encountered a lot of these deprecation
> > > > warnings:
> > > > >
> > > > > ../../../3rdparty/libprocess/../stout/include/stout/os/posix
> > > > /su.hpp:241:9:
> > > > > warning: 'syscall' is deprecated: first deprecated in macOS 10.12 -
> > > > > syscall(2) is unsupported; please switch to a supported interface.
> > For
> > > > > SYS_kdebug_trace use kdebug_signpost(). [-Wdeprecated-declarations]
> > > > >
> > > > > Which was fixed by adding CXXFLAGS=-Wno-deprecated-declarations
> when
> > > > > configuring.
> > > > >
> > > > > The next thing was hitting the following when running the
> libprocess
> > > > tests:
> > > > >
> > > > > ./libprocess-tests
> > > > > Failed to obtain the IP address for 'Benjamins-MacBook-Pro.local';
> > the
> > > > DNS
> > > > > service may not be able to resolve it: nodename nor servname
> > provided,
> > > or
> > > > > not known
> > > > >
> > > > > To resolve this, (I'm not sure how Jie figured this out), I had to
> go
> > > > into
> > > > > System Preferences > Sharing and turn on Remote Login (but you'll
> > want
> > > to
> > > > > do this only for administrators I assume..).
> > > > >
> > > > > The last thing was that apparently there is an incompatibility in
> the
> > > > > system installed apr and svn headers, which is fixed by using the
> > > headers
> > > > > from a brew installation of subversion. For me, I had to re-install
> > the
> > > > > brew version before I could successfully point to them during
> > > > > configuration:
> > > > >
> > > > > $ brew unlink subversion
> > > > > $ brew install subversion
> > > > > $ ../configure CXXFLAGS=-Wno-deprecated-declarations
> > --disable-python
> > > > > --disable-java --with-apr=/usr/local/opt/apr/libexec
> > > > > --with-svn=/usr/local/opt/subversion
> > > > >
> > > > > I figured this would be helpful to anyone else running into these
> > > issues,
> > > > > I'll update the getting started page to direct users towards these
> > > steps.
> > > > >
> > > > > Ben
> > > > >
> > > >
> > >
> >
>



-- 
Deshi Xiao
Twitter: xds2000
E-mail: xiaods(AT)gmail.com

Re: Building on OS X 10.12

Posted by Neil Conway <ne...@gmail.com>.
I think we should look into adopting "-fvisibility=hidden" and
explicitly annotating the symbols that we want to export:

https://issues.apache.org/jira/browse/MESOS-6734

Although I agree this isn't a trivial change and it would be good to
have some tool support here, but there are lots of benefits [1,2].

Neil

[1] https://gcc.gnu.org/wiki/Visibility
[2] https://software.intel.com/sites/default/files/m/a/1/e/dsohowto.pdf

On Mon, Dec 12, 2016 at 2:17 PM, Joris Van Remoortere
<jo...@mesosphere.io> wrote:
> There are a significant number of developer and runtime performance
> benefits from turning this flag on.
> In my opinion it is also a dangerous flag to turn on by default without a
> strict set of rules for our codebase to ensure that we don't accidentally:
>
>    - have multiple instances of static variables when we think they are a
>    singleton
>    - run into inequality when we expect equality for comparison of in-lined
>    function pointers (For example when building a vtable in a library for
>    something like variant / visitor)
>
> Although the likelihood that our codebase would suffer from these is low, I
> would prefer to have clang-tidy support and have some rule checkers to
> ensure that we can turn this flag on by default and know we will catch any
> future code that may break these rules.
>
> @James have you done any validation of the codebase and the libraries we
> depend on to ensure this is safe?
>
> Joris
>
> —
> *Joris Van Remoortere*
> Mesosphere
>
> On Mon, Dec 5, 2016 at 1:16 PM, James Peach <jo...@gmail.com> wrote:
>
>>
>> > On Dec 2, 2016, at 10:54 PM, Jie Yu <yu...@gmail.com> wrote:
>> >
>> > Another tip. If you are on macOS sierra, you might notice the linking is
>> > extremely slow using the default clang.
>> >
>> > Using CXXFLAGS `-fvisibility-inlines-hidden` will greatly speedup the
>> > linking.
>>
>> Is there a reason we should not always do this? It reduces the number of
>> exported symbols in libmesos.so from 250K to 100K.
>>
>> J

Re: Building on OS X 10.12

Posted by Joris Van Remoortere <jo...@mesosphere.io>.
There are a significant number of developer and runtime performance
benefits from turning this flag on.
In my opinion it is also a dangerous flag to turn on by default without a
strict set of rules for our codebase to ensure that we don't accidentally:

   - have multiple instances of static variables when we think they are a
   singleton
   - run into inequality when we expect equality for comparison of in-lined
   function pointers (For example when building a vtable in a library for
   something like variant / visitor)

Although the likelihood that our codebase would suffer from these is low, I
would prefer to have clang-tidy support and have some rule checkers to
ensure that we can turn this flag on by default and know we will catch any
future code that may break these rules.

@James have you done any validation of the codebase and the libraries we
depend on to ensure this is safe?

Joris

—
*Joris Van Remoortere*
Mesosphere

On Mon, Dec 5, 2016 at 1:16 PM, James Peach <jo...@gmail.com> wrote:

>
> > On Dec 2, 2016, at 10:54 PM, Jie Yu <yu...@gmail.com> wrote:
> >
> > Another tip. If you are on macOS sierra, you might notice the linking is
> > extremely slow using the default clang.
> >
> > Using CXXFLAGS `-fvisibility-inlines-hidden` will greatly speedup the
> > linking.
>
> Is there a reason we should not always do this? It reduces the number of
> exported symbols in libmesos.so from 250K to 100K.
>
> J

Re: Building on OS X 10.12

Posted by James Peach <jo...@gmail.com>.
> On Dec 2, 2016, at 10:54 PM, Jie Yu <yu...@gmail.com> wrote:
> 
> Another tip. If you are on macOS sierra, you might notice the linking is
> extremely slow using the default clang.
> 
> Using CXXFLAGS `-fvisibility-inlines-hidden` will greatly speedup the
> linking.

Is there a reason we should not always do this? It reduces the number of exported symbols in libmesos.so from 250K to 100K.

J 

Re: Building on OS X 10.12

Posted by Jie Yu <yu...@gmail.com>.
Another tip. If you are on macOS sierra, you might notice the linking is
extremely slow using the default clang.

Using CXXFLAGS `-fvisibility-inlines-hidden` will greatly speedup the
linking.

- Jie

On Thu, Dec 1, 2016 at 5:05 PM, Michael Park <mp...@apache.org> wrote:

> Thanks for writing this up!
>
> The remote login thing is funky!
>
> The `-Wno-deprecated-declarations` is currently very unfortunate, and
> hopefully we can fix this in our build automatically soon.
> I personally have been doing: `CC="ccache clang-3.7
> -Wno-deprecated-declarations" CXX="ccache clang++-3.7
> -Wno-deprecated-declarations"`
> for now because setting `CXXFLAGS` overrides everything. For example,
> `--enable-optimize` won't do anything if `CXXFLAGS` is set.
>
> For the `apr` issues, we should be detecting whether we have a `brew`
> version installed or not on OS X and use it if it's available.
> The following patches make the build system `apr` similar to `subversion`,
> `libevent` as well as `openssl`.
>
> https://reviews.apache.org/r/54278/
> https://reviews.apache.org/r/54279/
> https://reviews.apache.org/r/54280/
>
> On Thu, Dec 1, 2016 at 12:50 PM, Benjamin Mahler <bm...@apache.org>
> wrote:
>
> > Here is the update:
> >
> > https://reviews.apache.org/r/54262/
> >
> > On Thu, Dec 1, 2016 at 12:36 PM, Vinod Kone <vi...@apache.org>
> wrote:
> >
> > > Thanks!
> > >
> > > On Thu, Dec 1, 2016 at 12:34 PM, Benjamin Mahler <bm...@apache.org>
> > > wrote:
> > >
> > > > I ran into some compilation issues after upgrading to OS X 10.12.1,
> and
> > > was
> > > > able to build successfully with Jie's help.
> > > >
> > > > The first thing was that I encountered a lot of these deprecation
> > > warnings:
> > > >
> > > > ../../../3rdparty/libprocess/../stout/include/stout/os/posix
> > > /su.hpp:241:9:
> > > > warning: 'syscall' is deprecated: first deprecated in macOS 10.12 -
> > > > syscall(2) is unsupported; please switch to a supported interface.
> For
> > > > SYS_kdebug_trace use kdebug_signpost(). [-Wdeprecated-declarations]
> > > >
> > > > Which was fixed by adding CXXFLAGS=-Wno-deprecated-declarations when
> > > > configuring.
> > > >
> > > > The next thing was hitting the following when running the libprocess
> > > tests:
> > > >
> > > > ./libprocess-tests
> > > > Failed to obtain the IP address for 'Benjamins-MacBook-Pro.local';
> the
> > > DNS
> > > > service may not be able to resolve it: nodename nor servname
> provided,
> > or
> > > > not known
> > > >
> > > > To resolve this, (I'm not sure how Jie figured this out), I had to go
> > > into
> > > > System Preferences > Sharing and turn on Remote Login (but you'll
> want
> > to
> > > > do this only for administrators I assume..).
> > > >
> > > > The last thing was that apparently there is an incompatibility in the
> > > > system installed apr and svn headers, which is fixed by using the
> > headers
> > > > from a brew installation of subversion. For me, I had to re-install
> the
> > > > brew version before I could successfully point to them during
> > > > configuration:
> > > >
> > > > $ brew unlink subversion
> > > > $ brew install subversion
> > > > $ ../configure CXXFLAGS=-Wno-deprecated-declarations
> --disable-python
> > > > --disable-java --with-apr=/usr/local/opt/apr/libexec
> > > > --with-svn=/usr/local/opt/subversion
> > > >
> > > > I figured this would be helpful to anyone else running into these
> > issues,
> > > > I'll update the getting started page to direct users towards these
> > steps.
> > > >
> > > > Ben
> > > >
> > >
> >
>

Re: Building on OS X 10.12

Posted by Michael Park <mp...@apache.org>.
Thanks for writing this up!

The remote login thing is funky!

The `-Wno-deprecated-declarations` is currently very unfortunate, and
hopefully we can fix this in our build automatically soon.
I personally have been doing: `CC="ccache clang-3.7
-Wno-deprecated-declarations" CXX="ccache clang++-3.7
-Wno-deprecated-declarations"`
for now because setting `CXXFLAGS` overrides everything. For example,
`--enable-optimize` won't do anything if `CXXFLAGS` is set.

For the `apr` issues, we should be detecting whether we have a `brew`
version installed or not on OS X and use it if it's available.
The following patches make the build system `apr` similar to `subversion`,
`libevent` as well as `openssl`.

https://reviews.apache.org/r/54278/
https://reviews.apache.org/r/54279/
https://reviews.apache.org/r/54280/

On Thu, Dec 1, 2016 at 12:50 PM, Benjamin Mahler <bm...@apache.org> wrote:

> Here is the update:
>
> https://reviews.apache.org/r/54262/
>
> On Thu, Dec 1, 2016 at 12:36 PM, Vinod Kone <vi...@apache.org> wrote:
>
> > Thanks!
> >
> > On Thu, Dec 1, 2016 at 12:34 PM, Benjamin Mahler <bm...@apache.org>
> > wrote:
> >
> > > I ran into some compilation issues after upgrading to OS X 10.12.1, and
> > was
> > > able to build successfully with Jie's help.
> > >
> > > The first thing was that I encountered a lot of these deprecation
> > warnings:
> > >
> > > ../../../3rdparty/libprocess/../stout/include/stout/os/posix
> > /su.hpp:241:9:
> > > warning: 'syscall' is deprecated: first deprecated in macOS 10.12 -
> > > syscall(2) is unsupported; please switch to a supported interface. For
> > > SYS_kdebug_trace use kdebug_signpost(). [-Wdeprecated-declarations]
> > >
> > > Which was fixed by adding CXXFLAGS=-Wno-deprecated-declarations when
> > > configuring.
> > >
> > > The next thing was hitting the following when running the libprocess
> > tests:
> > >
> > > ./libprocess-tests
> > > Failed to obtain the IP address for 'Benjamins-MacBook-Pro.local'; the
> > DNS
> > > service may not be able to resolve it: nodename nor servname provided,
> or
> > > not known
> > >
> > > To resolve this, (I'm not sure how Jie figured this out), I had to go
> > into
> > > System Preferences > Sharing and turn on Remote Login (but you'll want
> to
> > > do this only for administrators I assume..).
> > >
> > > The last thing was that apparently there is an incompatibility in the
> > > system installed apr and svn headers, which is fixed by using the
> headers
> > > from a brew installation of subversion. For me, I had to re-install the
> > > brew version before I could successfully point to them during
> > > configuration:
> > >
> > > $ brew unlink subversion
> > > $ brew install subversion
> > > $ ../configure CXXFLAGS=-Wno-deprecated-declarations --disable-python
> > > --disable-java --with-apr=/usr/local/opt/apr/libexec
> > > --with-svn=/usr/local/opt/subversion
> > >
> > > I figured this would be helpful to anyone else running into these
> issues,
> > > I'll update the getting started page to direct users towards these
> steps.
> > >
> > > Ben
> > >
> >
>

Re: Building on OS X 10.12

Posted by Benjamin Mahler <bm...@apache.org>.
Here is the update:

https://reviews.apache.org/r/54262/

On Thu, Dec 1, 2016 at 12:36 PM, Vinod Kone <vi...@apache.org> wrote:

> Thanks!
>
> On Thu, Dec 1, 2016 at 12:34 PM, Benjamin Mahler <bm...@apache.org>
> wrote:
>
> > I ran into some compilation issues after upgrading to OS X 10.12.1, and
> was
> > able to build successfully with Jie's help.
> >
> > The first thing was that I encountered a lot of these deprecation
> warnings:
> >
> > ../../../3rdparty/libprocess/../stout/include/stout/os/posix
> /su.hpp:241:9:
> > warning: 'syscall' is deprecated: first deprecated in macOS 10.12 -
> > syscall(2) is unsupported; please switch to a supported interface. For
> > SYS_kdebug_trace use kdebug_signpost(). [-Wdeprecated-declarations]
> >
> > Which was fixed by adding CXXFLAGS=-Wno-deprecated-declarations when
> > configuring.
> >
> > The next thing was hitting the following when running the libprocess
> tests:
> >
> > ./libprocess-tests
> > Failed to obtain the IP address for 'Benjamins-MacBook-Pro.local'; the
> DNS
> > service may not be able to resolve it: nodename nor servname provided, or
> > not known
> >
> > To resolve this, (I'm not sure how Jie figured this out), I had to go
> into
> > System Preferences > Sharing and turn on Remote Login (but you'll want to
> > do this only for administrators I assume..).
> >
> > The last thing was that apparently there is an incompatibility in the
> > system installed apr and svn headers, which is fixed by using the headers
> > from a brew installation of subversion. For me, I had to re-install the
> > brew version before I could successfully point to them during
> > configuration:
> >
> > $ brew unlink subversion
> > $ brew install subversion
> > $ ../configure CXXFLAGS=-Wno-deprecated-declarations --disable-python
> > --disable-java --with-apr=/usr/local/opt/apr/libexec
> > --with-svn=/usr/local/opt/subversion
> >
> > I figured this would be helpful to anyone else running into these issues,
> > I'll update the getting started page to direct users towards these steps.
> >
> > Ben
> >
>

Re: Building on OS X 10.12

Posted by Vinod Kone <vi...@apache.org>.
Thanks!

On Thu, Dec 1, 2016 at 12:34 PM, Benjamin Mahler <bm...@apache.org> wrote:

> I ran into some compilation issues after upgrading to OS X 10.12.1, and was
> able to build successfully with Jie's help.
>
> The first thing was that I encountered a lot of these deprecation warnings:
>
> ../../../3rdparty/libprocess/../stout/include/stout/os/posix/su.hpp:241:9:
> warning: 'syscall' is deprecated: first deprecated in macOS 10.12 -
> syscall(2) is unsupported; please switch to a supported interface. For
> SYS_kdebug_trace use kdebug_signpost(). [-Wdeprecated-declarations]
>
> Which was fixed by adding CXXFLAGS=-Wno-deprecated-declarations when
> configuring.
>
> The next thing was hitting the following when running the libprocess tests:
>
> ./libprocess-tests
> Failed to obtain the IP address for 'Benjamins-MacBook-Pro.local'; the DNS
> service may not be able to resolve it: nodename nor servname provided, or
> not known
>
> To resolve this, (I'm not sure how Jie figured this out), I had to go into
> System Preferences > Sharing and turn on Remote Login (but you'll want to
> do this only for administrators I assume..).
>
> The last thing was that apparently there is an incompatibility in the
> system installed apr and svn headers, which is fixed by using the headers
> from a brew installation of subversion. For me, I had to re-install the
> brew version before I could successfully point to them during
> configuration:
>
> $ brew unlink subversion
> $ brew install subversion
> $ ../configure CXXFLAGS=-Wno-deprecated-declarations --disable-python
> --disable-java --with-apr=/usr/local/opt/apr/libexec
> --with-svn=/usr/local/opt/subversion
>
> I figured this would be helpful to anyone else running into these issues,
> I'll update the getting started page to direct users towards these steps.
>
> Ben
>