Skip to content

Instantly share code, notes, and snippets.

@andrewstucki
Created November 11, 2017 03:31
Show Gist options
  • Save andrewstucki/b3242e6a5a4520cabfa1a15ff857ca3f to your computer and use it in GitHub Desktop.
Save andrewstucki/b3242e6a5a4520cabfa1a15ff857ca3f to your computer and use it in GitHub Desktop.
Compile Proxygen on Mac OS X
# homebrew dependencies
brew install folly autoconf-archive wget boost
# wangle
curl -L https://github.com/facebook/wangle/archive/v2017.11.06.00.tar.gz | tar xvzf -
mkdir wangle-2017.11.06.00/wangle/Release && cd wangle-2017.11.06.00/wangle/Release
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
make -j 8
make install
cd ../../..
# proxygen
curl -L https://github.com/facebook/proxygen/archive/v2017.11.06.00.tar.gz | tar xvzf -
cd proxygen-2017.11.06.00/proxygen
patch -p0 <<'EOF'
--- configure.ac
+++ configure.ac
@@ -206,7 +206,7 @@ if test x"$HAVE_GPERF" != x"yes"; then
fi
LIBS="$LIBS $BOOST_LDFLAGS -lpthread -pthread -lfolly -lglog"
-LIBS="$LIBS -ldouble-conversion -lboost_system -lboost_thread"
+LIBS="$LIBS -ldouble-conversion -lboost_system -lboost_thread-mt"
AM_CONDITIONAL([HAVE_STD_THREAD], [test "$ac_cv_header_features" = "yes"])
AM_CONDITIONAL([HAVE_X86_64], [test "$build_cpu" = "x86_64"])
EOF
patch -p0 <<'EOF'
--- lib/test/Makefile.am
+++ lib/test/Makefile.am
@@ -9,7 +9,7 @@ release-1.8.0.zip:
# `make` would run `sha1sum` **before** wget. We'd re-extract the archive
# without `touch`, since the contents' timestamps are older than the zip's.
googletest-release-1.8.0/googletest/src/gtest-all.cc: release-1.8.0.zip
- [ "$(shell sha1sum release-1.8.0.zip | awk '{print $$1}')" == \
+ [ "$(shell shasum release-1.8.0.zip | awk '{print $$1}')" == \
"667f873ab7a4d246062565fad32fb6d8e203ee73" ]
unzip release-1.8.0.zip
touch googletest-release-1.8.0/googletest/src/gtest-all.cc
EOF
autoreconf -ivf
LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/include -I/usr/local/opt/openssl/include" ./configure
make -j 8
make install
@andrewstucki
Copy link
Author

I'm not sure if there are any other homebrew dependencies, there probably are (i.e. cmake, etc.), these are just what I had to install to get up and running since I already had a number of packages on my system.

@dio
Copy link

dio commented Jan 9, 2018

Thanks for this, for the latest proxygen (https://github.com/facebook/proxygen/archive/v2018.01.08.00.tar.gz) with the latest folly (from brew) and wangle (https://github.com/facebook/wangle/archive/v2018.01.08.00.tar.gz) we only need to patch the -lboost_thread to -lboost_thread-mt.

In addition, with my current setup, the ax_prefix_config_h.m4 is missing. So, I needed to fetch it from http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_prefix_config_h.m4 and put it inside the proxygen/m4 directory. Run another round of autoreconf -ivf

LDFLAGS="-L/usr/local/lib -L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/include -I/usr/local/opt/openssl/include" ./configure
make -j 8

💯

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