Skip to content

Trying to compile in CentOS 7 (want to know what compiler is used at Facebook?) #25

Closed

Description

@jeroen-dhollander

Issue Description

I am trying to compile and install OpenR in a CentOS 7 docker image.

According to the OpenR github-page ,
this should be supported, but I am running into issues compiling fbthrift.

These issues seem to be caused by a bug in the Red Hat Developer Toolset 7 that I use,
so I was wondering what toolset was used by Facebook when you got it to compile on CentOS 7.

I also tried devtoolset-6, but that doesn't offer proper C++14 support and fails compilation in different ways.

Environment

  • tag or commit hash on which this occured
    • commit hash d331eb0 , but with folly version bumped to include bugfix for #820 (otherwise it would not compile).
/tmp/openr-centos/build # git diff
diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt
index f535f21..0491c68 100644
--- a/build/deps/github_hashes/facebook/folly-rev.txt
+++ b/build/deps/github_hashes/facebook/folly-rev.txt
@@ -1 +1 @@
-Subproject commit 7153cc6bf1b0f71b80ce4412fbc83163d10c9a2f
+Subproject commit e752dcd00ed4b8ff4d633e7996db027321ac7708
  • OS version: <e.g. ubuntu-16.04>
    CentOS 7,
    with devtoolset-7 installed.

Minimal test code / Steps to reproduce the issue

Run attached script,
which is a version of build_openr.sh updated for CentOS 7.

What's the actual result?

[ 31%] Built target compiler_generators
[ 32%] Linking CXX executable ../../bin/thrift1
[ 32%] Building CXX object thrift/lib/cpp/CMakeFiles/security.dir/util/kerberos/Krb5OlderVersionStubs.cpp.o
/jeroend/tmp/openr-centos/build/deps/fbthrift/thrift/lib/cpp/concurrency/TimerManager.cpp: In destructor 'virtual apache::thrift::concurrency::TimerManager::~TimerManager()':
/jeroend/tmp/openr-centos/build/deps/fbthrift/thrift/lib/cpp/concurrency/TimerManager.cpp:158:7: warning: throw will always call terminate() [-Wterminate]
       throw;
       ^~~~~
/jeroend/tmp/openr-centos/build/deps/fbthrift/thrift/lib/cpp/concurrency/TimerManager.cpp:158:7: note: in C++11 destructors default to noexcept
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++_nonshared.a(cow-stdexcept.o): In function `std::__sso_string::__sso_string(std::string const&)':
(.text._ZNSt12__sso_stringC2ERKSs+0x8): undefined reference to `std::__sso_string::__sso_string(char const*, unsigned long)'
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++_nonshared.a(cow-stdexcept.o): In function `std::_V2::error_category::_M_message(int) const':
(.text._ZNKSt3_V214error_category10_M_messageEi+0x30): undefined reference to `std::__sso_string::__sso_string(char const*, unsigned long)'
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: ../../bin/thrift1: hidden symbol `_ZNSt12__sso_stringD1Ev' isn't defined
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [thrift/compiler/CMakeFiles/thrift1.dir/build.make:185: bin/thrift1] Error 1
make[1]: *** [CMakeFiles/Makefile2:115: thrift/compiler/CMakeFiles/thrift1.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 33%] Building CXX object thrift/lib/cpp/CMakeFiles/security.dir/util/kerberos/Krb5CredentialsCacheManager.cpp.o
[ 33%] Building CXX object thrift/lib/cpp/CMakeFiles/security.dir/util/kerberos/Krb5CCacheStore.cpp.o
[ 34%] Building CXX object thrift/lib/cpp/CMakeFiles/security.dir/util/kerberos/Krb5Tgts.cpp.o
[ 35%] Building CXX object thrift/lib/cpp/CMakeFiles/security.dir/util/kerberos/FBKrb5GetCreds.cpp.o
[ 36%] Linking CXX shared library ../../../lib/libthrift-core.so
[ 36%] Built target thrift-core
[ 36%] Linking CXX shared library ../../../lib/libserver.so
[ 36%] Built target server
[ 37%] Linking CXX shared library ../../../lib/libconcurrency.so
[ 37%] Built target concurrency
[ 37%] Linking CXX shared library ../../../lib/libsecurity.so
[ 37%] Built target security
make: *** [Makefile:128: all] Error 2

What's the expected result?

A script that I can run that simply works and installs OpenR on CentOS 7 would be best :-),
but any help would be appreciated.

Activity

  1. saifhhasan commented on Apr 17, 2018

    @saifhhasan
    Contributor

    Quick googling releavs that this is bug in devtoolset-7 just like you mentioned.
    https://bugzilla.redhat.com/show_bug.cgi?id=1519073

    You will need devtoolset-7.1 to get pass this error. You might pull latest devtoolset (from trunk if possible) and compile with it. Here we use CentOS but don't rely on devtoolsets for compilation. Our internal build systems leverages specific gcc-5+ version which supports c++14 very well.

  2. jeroen-dhollander commented on Apr 18, 2018

    @jeroen-dhollander
    Author

    Thanks for the answer.

    After you mentioned you use gcc-5 I took a closer look at devtoolset-6 (which uses gcc-6),
    and I realized the failure was not due to C++14 but due to an interop issue with folly.

    So I opened an issue there,
    but for now I managed to work around it, so I can now compile on CentOS 7.

    @anyone else reading this looking for the same answer: The solution turned out to be to simply use devtoolset-6, and use the patch here for the folly issue

  3. saifhhasan commented on Apr 18, 2018

    @saifhhasan
    Contributor

    Thanks @jeroen-dhollander for posting patch for future references. Will go ahead and close the issue then :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions