Commit 67f63db7 authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

update the README to document building with cmake

Summary:
Update the build steps in the README to build using cmake instead of autoconf
on Linux platforms.

I haven't updated the instructions for Mac OS X or the
`bootstrap-osx-homebrew.sh` script primarily because I have not tested the
steps on Mac.  It sounds like the build is close to working on Mac, but
currently fails due to missing compiler flags to disable some warnings on
clang.

Reviewed By: akushner

Differential Revision: D6780814

fbshipit-source-id: 9c9c211c306d5b35235549ae451bb620098f37e3
parent 50f439af
...@@ -72,28 +72,34 @@ Folly is published on Github at https://github.com/facebook/folly ...@@ -72,28 +72,34 @@ Folly is published on Github at https://github.com/facebook/folly
folly requires gcc 4.9+ and a version of boost compiled with C++14 support. folly requires gcc 4.9+ and a version of boost compiled with C++14 support.
Please download googletest from googletest is required to build and run folly's tests. You can download
https://github.com/google/googletest/archive/release-1.8.0.tar.gz and unpack it into the it from https://github.com/google/googletest/archive/release-1.8.0.tar.gz
folly/test subdirectory as `gtest`: The following commands can be used to download and install it:
(cd folly/test && \ ```
rm -rf gtest && \ wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz && \
wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz && \ tar zxf release-1.8.0.tar.gz && \
tar zxf release-1.8.0.tar.gz && \ rm -f release-1.8.0.tar.gz && \
rm -f release-1.8.0.tar.gz && \ cd googletest-release-1.8.0 && \
mv googletest-release-1.8.0 gtest) cmake configure . && \
make && \
make install
```
#### Linking non-default boost libraries #### Finding dependencies in non-default locations
If you have boost installed in a non-default location, you need to be sure that If you have boost, gtest, or other dependencies installed in a non-default
the linker and configure scripts know where to find boost. This means making location, you can use the `CMAKE_INCLUDE_PATH` and `CMAKE_LIBRARY_PATH`
sure that the `LIBRARY_PATH` environment variable contains `<BOOST_ROOT>/lib`, variables to make CMAKE look also look for header files and libraries in
as well as including the path explicitly when running non-standard locations. For example, to also search the directories
`./configure`: `/alt/include/path1` and `/alt/include/path2` for header files and the
directories `/alt/lib/path1` and `/alt/lib/path2` for libraries, you can invoke
`cmake configure` as follows:
``` ```
export LIBRARY_PATH=$BOOST_ROOT/lib:$LIBRARY_PATH cmake configure \
./configure --with-boost=$BOOST_ROOT/lib -DCMAKE_INCLUDE_PATH=/alt/include/path1:/alt/include/path2 \
-DCMAKE_LIBRARY_PATH=/alt/lib/path1:/alt/lib/path2
``` ```
#### Ubuntu 16.04 LTS #### Ubuntu 16.04 LTS
...@@ -104,10 +110,7 @@ command below): ...@@ -104,10 +110,7 @@ command below):
``` ```
sudo apt-get install \ sudo apt-get install \
g++ \ g++ \
automake \ cmake \
autoconf \
autoconf-archive \
libtool \
libboost-all-dev \ libboost-all-dev \
libevent-dev \ libevent-dev \
libdouble-conversion-dev \ libdouble-conversion-dev \
...@@ -136,11 +139,10 @@ sudo apt-get install \ ...@@ -136,11 +139,10 @@ sudo apt-get install \
In the folly directory, run: In the folly directory, run:
``` ```
autoreconf -ivf mkdir _build && cd _build
./configure cmake configure ..
make make -j $(nproc)
make check make install
sudo make install
``` ```
#### OS X (Homebrew) #### OS X (Homebrew)
...@@ -207,21 +209,21 @@ You may also use `vcpkg install folly:x64-windows --head` to build against `mast ...@@ -207,21 +209,21 @@ You may also use `vcpkg install folly:x64-windows --head` to build against `mast
- double-conversion (https://github.com/google/double-conversion) - double-conversion (https://github.com/google/double-conversion)
Download and build double-conversion. Download and build double-conversion.
You may need to tell configure where to find it. You may need to tell cmake where to find it.
[double-conversion/] `ln -s src double-conversion` [double-conversion/] `ln -s src double-conversion`
[folly/] `./configure LDFLAGS=-L$DOUBLE_CONVERSION_HOME/ CPPFLAGS=-I$DOUBLE_CONVERSION_HOME/` [folly/] `mkdir build && cd build`
[folly/build/] `cmake configure "-DCMAKE_INCLUDE_PATH=$DOUBLE_CONVERSION_HOME/include" "-DCMAKE_LIBRARY_PATH=$DOUBLE_CONVERSION_HOME/lib" ..`
[folly/] `LD_LIBRARY_PATH=$DOUBLE_CONVERSION_HOME/ make` [folly/build/] `make`
- additional platform specific dependencies: - additional platform specific dependencies:
Fedora 21 64-bit Fedora 21 64-bit
- gcc - gcc
- gcc-c++ - gcc-c++
- autoconf - cmake
- autoconf-archive
- automake - automake
- boost-devel - boost-devel
- libtool - libtool
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment