Failed to install Facebook Folly in EC2 machine

408 Views Asked by At

I am trying to install - [Gorilla (Beringei)][1]. But it is failing while installing Folly facebook project.

Script that I ran -

#!/bin/bash
set -e

FB_VERSION="2017.04.24.00"
ZSTD_VERSION="1.1.1"

echo "This script configures ubuntu with everything needed to run beringei."
echo "It requires that you run it as root. sudo works great for that."

apt update

apt install --yes \
    autoconf \
    autoconf-archive \
    automake \
    binutils-dev \
    bison \
    clang-format-3.9 \
    cmake \
    flex \
    g++ \
    git \
    gperf \
    libboost-all-dev \
    libcap-dev \
    libdouble-conversion-dev \
    libevent-dev \
    libgflags-dev \
    libgoogle-glog-dev \
    libjemalloc-dev \
    libkrb5-dev \
    liblz4-dev \
    liblzma-dev \
    libnuma-dev \
    libsasl2-dev \
    libsnappy-dev \
    libssl-dev \
    libtool \
    make \
    pkg-config \
    scons \
    wget \
    zip \
    zlib1g-dev

ready_destdir() {
        if [[ -e ${2} ]]; then
                echo "Moving aside existing $1 directory.."
                mv -v "$2" "$2.bak.$(date +%Y-%m-%d)"
        fi
}

mkdir -pv /usr/local/facebook-${FB_VERSION}
ln -sfT /usr/local/facebook-${FB_VERSION} /usr/local/facebook

export LDFLAGS="-L/usr/local/facebook/lib -Wl,-rpath=/usr/local/facebook/lib"
export CPPFLAGS="-I/usr/local/facebook/include"

cd /tmp

wget -O /tmp/folly-${FB_VERSION}.tar.gz https://github.com/facebook/folly/archive/v${FB_VERSION}.tar.gz
wget -O /tmp/wangle-${FB_VERSION}.tar.gz https://github.com/facebook/wangle/archive/v${FB_VERSION}.tar.gz
wget -O /tmp/fbthrift-${FB_VERSION}.tar.gz https://github.com/facebook/fbthrift/archive/v${FB_VERSION}.tar.gz
wget -O /tmp/proxygen-${FB_VERSION}.tar.gz https://github.com/facebook/proxygen/archive/v${FB_VERSION}.tar.gz
wget -O /tmp/mstch-master.tar.gz https://github.com/no1msd/mstch/archive/master.tar.gz
wget -O /tmp/zstd-${ZSTD_VERSION}.tar.gz https://github.com/facebook/zstd/archive/v${ZSTD_VERSION}.tar.gz

tar xzvf folly-${FB_VERSION}.tar.gz
tar xzvf wangle-${FB_VERSION}.tar.gz
tar xzvf fbthrift-${FB_VERSION}.tar.gz
tar xzvf proxygen-${FB_VERSION}.tar.gz
tar xzvf mstch-master.tar.gz
tar xzvf zstd-${ZSTD_VERSION}.tar.gz

pushd mstch-master
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/facebook-${FB_VERSION} .
make install
popd

pushd zstd-${ZSTD_VERSION}
make install PREFIX=/usr/local/facebook-${FB_VERSION}
popd


pushd folly-${FB_VERSION}/folly
autoreconf -ivf
./configure --prefix=/usr/local/facebook-${FB_VERSION}
make install
popd

pushd wangle-${FB_VERSION}/wangle
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/facebook-${FB_VERSION} -DBUILD_SHARED_LIBS:BOOL=ON .
make
# Wangle tests are broken. Disabling ctest.
# ctest
make install
popd

pushd fbthrift-${FB_VERSION}/thrift
autoreconf -ivf
./configure --prefix=/usr/local/facebook-${FB_VERSION}
make install
popd

pushd proxygen-${FB_VERSION}/proxygen
autoreconf -ivf
./configure --prefix=/usr/local/facebook-${FB_VERSION}
make install
popd

It failed at Folly - make install step. Exception is -

+ make install
Making install in .
make[1]: Entering directory `/tmp/folly-2017.04.24.00/folly'
depbase=`echo detail/CacheLocality.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
    /bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I./.. -pthread -I/usr/include   -I/usr/local/facebook/include  -std=gnu++1y -g -O2 -MT detail/CacheLocality.lo -MD -MP -MF $depbase.Tpo -c -o detail/CacheLocality.lo detail/CacheLocality.cpp &&\
    mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I./.. -pthread -I/usr/include -I/usr/local/facebook/include -std=gnu++1y -g -O2 -MT detail/CacheLocality.lo -MD -MP -MF detail/.deps/CacheLocality.Tpo -c detail/CacheLocality.cpp  -fPIC -DPIC -o detail/.libs/CacheLocality.o
In file included from ./../folly/String.h:40:0,
                 from ./../folly/Format.h:27,
                 from detail/CacheLocality.cpp:28:
./../folly/FBVector.h: In lambda function:
./../folly/FBVector.h:1432:49: error: parameter packs not expanded with '...':
           M_construct(start, std::forward<Args>(args)...);
                                                 ^
./../folly/FBVector.h:1432:49: note:         'args'
make[1]: *** [detail/CacheLocality.lo] Error 1
make[1]: Leaving directory `/tmp/folly-2017.04.24.00/folly'
make: *** [install-recursive] Error 1

Please help me to debug this issue.

Update 2

I updated gcc to 6.x version.

Now, it is failing at "make install" of fbthrift package. Exception -

mv -f $depbase.Tpo $depbase.Po
/bin/bash ../libtool  --tag=CXX   --mode=link g++  -std=gnu++1y -lcrypto -lglog -lmstch -lboost_filesystem -lboost_system -L/usr/local/facebook/lib -Wl,-rpath=/usr/local/facebook/lib  -o thrift1 main.o generate/common.o generate/t_generator.o generate/t_concat_generator.o generate/t_mstch_generator.o generate/t_android_lite_generator.o generate/t_cocoa_generator.o generate/t_cpp_generator.o generate/t_csharp_generator.o generate/t_d_generator.o generate/t_erl_generator.o generate/t_go_generator.o generate/t_hack_generator.o generate/t_hs_generator.o generate/t_html_generator.o generate/t_java_generator.o generate/t_js_generator.o generate/t_mstch_py3_generator.o generate/t_mstch_swift_generator.o generate/t_ocaml_generator.o generate/t_perl_generator.o generate/t_php_generator.o generate/t_py_generator.o generate/t_rb_generator.o generate/t_st_generator.o generate/t_xsd_generator.o -lfl libparse.la libthriftcompilerbase.la 
libtool: link: g++ -std=gnu++1y -Wl,-rpath=/usr/local/facebook/lib -o thrift1 main.o generate/common.o generate/t_generator.o generate/t_concat_generator.o generate/t_mstch_generator.o generate/t_android_lite_generator.o generate/t_cocoa_generator.o generate/t_cpp_generator.o generate/t_csharp_generator.o generate/t_d_generator.o generate/t_erl_generator.o generate/t_go_generator.o generate/t_hack_generator.o generate/t_hs_generator.o generate/t_html_generator.o generate/t_java_generator.o generate/t_js_generator.o generate/t_mstch_py3_generator.o generate/t_mstch_swift_generator.o generate/t_ocaml_generator.o generate/t_perl_generator.o generate/t_php_generator.o generate/t_py_generator.o generate/t_rb_generator.o generate/t_st_generator.o generate/t_xsd_generator.o  -lglog -lmstch -L/usr/local/facebook/lib -lfl ./.libs/libparse.a ./.libs/libthriftcompilerbase.a -lcrypto -lboost_filesystem -lboost_system
generate/t_mstch_generator.o: In function `t_mstch_generator::render(std::string const&, boost::variant<boost::detail::variant::recursive_flag<decltype(nullptr)>, std::string, int, double, bool, mstch::internal::lambda_t<boost::recursive_variant_>, std::shared_ptr<mstch::internal::object_t<boost::recursive_variant_> >, std::map<std::string const, boost::recursive_variant_, std::less<std::string const>, std::allocator<std::pair<std::string const, boost::recursive_variant_> > >, std::vector<boost::recursive_variant_, std::allocator<boost::recursive_variant_> >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&) const':
t_mstch_generator.cc:(.text+0x5b4b): undefined reference to `mstch::render(std::string const&, boost::variant<boost::detail::variant::recursive_flag<decltype(nullptr)>, std::string, int, double, bool, mstch::internal::lambda_t<boost::recursive_variant_>, std::shared_ptr<mstch::internal::object_t<boost::recursive_variant_> >, std::map<std::string const, boost::recursive_variant_, std::less<std::string const>, std::allocator<std::pair<std::string const, boost::recursive_variant_> > >, std::vector<boost::recursive_variant_, std::allocator<boost::recursive_variant_> >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)'
collect2: error: ld returned 1 exit status
make[3]: *** [thrift1] Error 1
make[3]: Leaving directory `/tmp/fbthrift-2017.04.24.00/thrift/compiler'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/tmp/fbthrift-2017.04.24.00/thrift/compiler'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/tmp/fbthrift-2017.04.24.00/thrift/compiler'
make: *** [install-recursive] Error 1

  [1]: https://github.com/facebookincubator/beringei
0

There are 0 best solutions below