Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
d7fc2bf7
Commit
d7fc2bf7
authored
Jun 14, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document how to build on OSX.
parent
cbd54ef3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
3 deletions
+71
-3
install.md
doc/install.md
+71
-3
No files found.
doc/install.md
View file @
d7fc2bf7
...
...
@@ -92,7 +92,7 @@ be able to ignore any errors that originate outside of the `capnp` and `kj` dire
are just parts of other packages like Google Test that Ekam doesn't fully know how to build, but
aren't needed by Cap'n Proto anyway.
### Running the Benchmarks
###
#
Running the Benchmarks
Before getting into benchmarks, let me be frank: performance varies wildly by use case, and no
benchmark is going to properly reflect the big picture. If performance is critical to your use
...
...
@@ -129,7 +129,7 @@ This test case involves sending to the server a description of a bunch of cars,
to decide how much the lot is worth. This case is very number-heavy, and because of this
Cap'n Proto's "packed" mode really shines.
### Developing with Ekam
###
#
Developing with Ekam
If you intend to do some development, you should build
`continuous`
or
`continuous-opt`
instead
of
`once`
. These modes will build everything, then watch the source tree for changes and rebuild
...
...
@@ -154,6 +154,8 @@ with error markers.
### Building with Automake
_If you are using Mac OSX, you'll need to follow the modified instructions in the next section._
If setting up Ekam is too much work for you, you can also build with Automake.
1.
Make sure the
[
Google Test
](
https://googletest.googlecode.com/
)
headers are in your include
...
...
@@ -168,7 +170,7 @@ If setting up Ekam is too much work for you, you can also build with Automake.
mkdir -p ~/gtest-install/include
mkdir -p ~/gtest-install/lib
cp -r include/gtest ~/gtest-install/include/gtest
cp
./
lib/.libs/*.a ~/gtest-install/lib
cp lib/.libs/*.a ~/gtest-install/lib
2.
Clone and build the Cap'n Proto code.
...
...
@@ -183,3 +185,69 @@ If setting up Ekam is too much work for you, you can also build with Automake.
This will install
`libcapnp.a`
in
`/usr/local/lib`
and headers in
`/usr/local/include/capnp`
and
`/usr/local/include/kj`
.
#### Mac OSX Notes
As of this writing, Mac OSX 10.8 with Xcode 4.6 command-line tools is not quite good enough to
compile Cap'n Proto. The included version of GCC is ancient. The included version of Clang --
which mysteriously advertises itself as version 4.2 -- was actually cut from LLVM SVN somewhere
between versions 3.1 and 3.2; it is not sufficient to build Cap'n Proto.
There are two options:
1.
Use
[
Macports
](
http://www.macports.org/
)
or
[
Fink
](
http://www.finkproject.org/
)
to get an
up-to-date GCC.
2.
Obtain Clang 3.2 (or better)
[
directly from the LLVM project
](
http://llvm.org/releases/download.html
)
.
Option 2 is the one preferred by Cap'n Proto's developers. However, it presents some additional
quirks in that you will want to use libc++ (LLVM's implementation of the standard C++ library)
rather than libstdc++ (GCC's implementation). These problems can be worked around as described
below.
First, download the Clang 3.2 binaries and put them somewhere easy to remember:
curl -O http://llvm.org/releases/3.2/clang+llvm-3.2-x86_64-apple-darwin11.tar.gz
tar zxf clang+llvm-3.2-x86_64-apple-darwin11.tar.gz
mv clang+llvm-3.2-x86_64-apple-darwin11 ~/clang-3.2
Next, you need to symlink the system's libc++ into the clang 3.2 tree so that it can see it:
ln -s /usr/lib/c++ ~/clang-3.2/lib/c++
The other problem is that if you want to run Cap'n Proto's tests (with
`make check`
), you will need
to make sure Google Test is compiled with libc++. This is further complicated by the fact that
the latest version of Google Test (1.6) relies on
`tr1`
headers and namespaces, which in C++11
(and therefore libc++) have been folded into the standand namespace. You will need to modify the
gtest code to strip out references to
`tr1`
. Also, one of gtest's own tests uses
`thread_local`
as
a variable name, but it is a keyword in C++11, so that will need to be fixed too if you happen to
want to run gtest's tests.
Thus, the gtest instructions from above become:
curl -O https://googletest.googlecode.com/files/gtest-1.6.0.zip
unzip gtest-1.6.0.zip
cd gtest-1.6.0
find . -type f | xargs sed -i '' -e \
's,<tr1/,<,g;s/::tr1::/::/g;s/thread_local/thread_local_/g'
CXX=clang++ CXXFLAGS="-std=c++11 -stdlib=libc++" ./configure
make -j4
mkdir -p ~/gtest-install/include
mkdir -p ~/gtest-install/lib
cp -r include/gtest ~/gtest-install/include/gtest
cp lib/.libs/*.a ~/gtest-install/lib
At this point building Cap'n Proto is just like above, except you need to set
`CXX`
to the right
compiler.
git clone https://github.com/kentonv/capnproto.git
cd capnproto/c++
autoreconf -i
CXX=~/clang-3.2/bin/clang++ \
CXXFLAGS="-O2 -DNDEBUG -I$HOME/gtest-install/include" \
LDFLAGS="-L$HOME/gtest-install/lib" \
./configure
make -j4 check
sudo make install
Phew. Here's hoping that XCode 5.0 and a future Google Test release will simplify all this!
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment