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 libc++ working with OS X. #496

Closed
srh opened this issue Mar 18, 2013 · 17 comments
Closed

Get libc++ working with OS X. #496

srh opened this issue Mar 18, 2013 · 17 comments
Assignees
Milestone

Comments

@srh
Copy link
Contributor

srh commented Mar 18, 2013

Right now we can't use anything in the C++11 library, which means we can't really use rvalue references because std::move and std::forward are unavailable.

This is because on OS X, specifying -stdlib=libc++ results in linking problems with libraries compiled with libstdc++. We need to hack some homebrew dependencies for protobuf and whatever else we depend on to compile with libc++.

This is a very high priority because fixing a lot of basic performance problems in the query language code and elsewhere would be much easier with rvalue references, and std::move and std::forward.

@ghost ghost assigned srh Mar 18, 2013
@srh
Copy link
Contributor Author

srh commented Mar 18, 2013

@jmgao made some formulas to build node, protobuf, and v8, linking against libc++, at https://github.com/jmgao/homebrew-rethinkdb

Edit: its v8 is out of date. Use https://github.com/srh/homebrew-rethinkdb instead.

One way to get RethinkDB working on OS X is therefore to replace your node, protobuf, and v8 with these respective libraries. I'm going to make it do this and then link libc++11.

@ghost ghost assigned srh Mar 20, 2013
@AtnNn
Copy link
Member

AtnNn commented Mar 20, 2013

Related issues in homebrew:

Homebrew/legacy-homebrew#14939
Homebrew/legacy-homebrew#16078

@AtnNn
Copy link
Member

AtnNn commented May 1, 2013

@srh your code has been sitting in limbo for too long.

@coffeemug I assume we can't drop homebrew support.

I'll play with it and implement the easiest fix I can think of.

@coffeemug
Copy link
Contributor

We can't drop homebrew.

@srh
Copy link
Contributor Author

srh commented May 1, 2013

Making our own recipes that install to differently-named locations seems like the easiest and best fix. Then putting those in a ... tap or just having a raw URL in the instructions would do the trick. (Note that I don't actually know what a tap is.)

libc++'s subtly different behavior in its implementations has been helpful by exposing bugs (two so far), and I'd really rather not strip it out of the reference-counting branch -- there's no technical difficulties in the code, but it would take less time to just make working homebrew recipes.

@coffeemug
Copy link
Contributor

I don't like providing URLs in the instructions. We should just have a tap and install rethink (and all relevant dependencies) via that.

@AtnNn
Copy link
Member

AtnNn commented May 1, 2013

With that solution, the new instructions would simply be:

brew tap rethinkdb/rethinkdb
brew update
brew install rethinkdb

It'll be impossible for users to discover without visiting our website.

@coffeemug
Copy link
Contributor

I think that's fine. (That's what we do on Ubuntu already)

@coffeemug
Copy link
Contributor

Closing, since this is done in the codebase and the remaining work is captured by #740.

@AtnNn
Copy link
Member

AtnNn commented May 6, 2013

The sam_libcxx branch hasn't been merged into next yet, and it doesn't build on travis with clang.

@coffeemug
Copy link
Contributor

Fair enough -- sorry. Reopening.

@srh -- could you fix the bugs caused by Travis's clang version? (darn you, Strunk and White apostrophe)

@coffeemug coffeemug reopened this May 6, 2013
@srh
Copy link
Contributor Author

srh commented May 8, 2013

In file included from build/release_clang/proto/rdb_protocol/ql2.pb.cc:4:

./build/release_clang/proto/rdb_protocol/ql2.pb.h:7:10: fatal error: 'string'

file not found

#include <string>

I don't know how to fix this.

@AtnNn
Copy link
Member

AtnNn commented May 8, 2013

I'll try to reproduce it, I've got a clone of the VM that travis uses.

@srh
Copy link
Contributor Author

srh commented May 8, 2013

Well, it probably means my changes to the Makefile somehow accidentally applied outside of OS X.

@srh
Copy link
Contributor Author

srh commented May 8, 2013

This problem is probably fixed in a45effd (under the theory that if the makefile isn't changed, clang shouldn't be confused).

@srh
Copy link
Contributor Author

srh commented May 8, 2013

The problem is indeed fixed.

@srh
Copy link
Contributor Author

srh commented May 8, 2013

sam_libcxx is now merged into next.

We still have #740 to do.

In the mean time, you can install the dependencies on your machine with

brew uninstall node protobuf v8
brew install https://raw.github.com/srh/homebrew-rethinkdb/master/node.rb
brew install https://raw.github.com/srh/homebrew-rethinkdb/master/protobuf.rb
brew install https://raw.github.com/srh/homebrew-rethinkdb/master/v8.rb

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

No branches or pull requests

3 participants