arm1.ru

Tag: «mac os x»

Homebrew C++ App Compilation Issues on OS X 10.9 Mavericks

event Nov 20, 2013 at 16:53

There is a Homebrew issue on OS X 10.9 Mavericks: some packages do not compile from source. This affects programs written in C++. Yesterday I had to spend quite a bit of time solving it.

Judging by what I found on Google, the issue affects only those who upgraded from 10.8 to 10.9. For those who installed the system from scratch, everything seems to be fine.

Yesterday I got this:

 $ brew update
Updated Homebrew from f949b212 to 9d10c43e.
==> Updated Formulae
gfortran
$ brew install spidermonkey
==> Downloading http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/spidermonkey-1.8.5.tar.gz
==> ../js/src/configure --prefix=/usr/local/Cellar/spidermonkey/1.8.5 --enable-readline --enable-threadsafe --with-system-nspr --enable-macos-target=10.9
==> make
==> make install
Error: spidermonkey dependency readline was built with the following
C++ standard library: libstdc++ (from clang)

This is incompatible with the standard library being used
to build spidermonkey: libc++ (from clang)

Please reinstall readline using a compatible compiler.
hint: Check https://github.com/mxcl/homebrew/wiki/C++-Standard-Libraries

After some googling and poking around in GitHub issues, I followed the link that was in the last line of the console output. It said:


There are two standard C++ libraries supported by Apple's compilers.

By default, 10.8 and earlier used libstdc++, and it was supported by Apple GCC, GNU GCC, and clang.

In 10.9, libc++ is used by default; clang also uses it by default on older platforms when building C++11 code.

There are some incompatibilities between the different standard C++ libraries, so Homebrew rejects installing software if one of its dependencies was built with an incompatible C++ library. It recommends rebuilding the dependency tree with a compatible compiler.

If you upgraded to 10.9 from an earlier version, then because libc++ is now the default C++ library, you may be unable to build from source programs whose dependencies were built on 10.8 or earlier. If you are reading this because a compilation error sent you here, you can fix everything by reinstalling the dependencies of the package you are trying to build.

And that, in fact, is the solution to the problem. If you are installing some package (in this case spidermonkey) and you see an error like this:

Error: spidermonkey dependency readline was built with the following
C++ standard library: libstdc++ (from clang)

then you simply need to reinstall the dependency the compiler complains about. In this case, readline. Just run:

brew reinstall -v readline

After the dependency is rebuilt, the package itself will install.

I ran into this when I was trying to install a new version of CouchDB. It pulls in spidermonkey, which in turn pulls in readline. I simply had to reinstall both dependencies.

I hope this note saves someone some time.

How to Upgrade a Hackintosh from Mac OS X Mountain Lion to Mavericks

event Oct 30, 2013 at 16:49

Hackintosh Mac OS X Mavericks

I upgraded my work Hackintosh to 10.9 today. Everything was rather strange, but doable.

Before that it was running 10.8.5 Mountain Lion. I downloaded the Mavericks update from the Mac App Store. I launched it, the installer asked for a reboot, and after the reboot nothing happened — Mountain Lion simply loaded again.

To install the update, you need the following:

Streaming audio on Mac OS X

event Jul 14, 2011 at 12:21

Streaming audio on Mac OS X

It just so happens that in my room the speakers are on one side and the computer on the other. Running a cable from the speakers doesn’t feel like a sane idea. So — there are speakers, wi-fi, and a wi-fi-capable mobile device (in my case an iPad, but anything that can play music over wi-fi will do). I remembered that there’s a great tool called Nicecast — with one click you can set up an online broadcast. The point: stay at my desk and control the music there, but have it play on the speakers across the room. Some will say running a cable is easier, but… fuck yeah, why not over-engineer it?