fbthrift icon indicating copy to clipboard operation
fbthrift copied to clipboard

unable to find folly library

Open renanbs opened this issue 11 years ago • 2 comments

How do I fix this error? I had the same issue when trying to compile wangle, but there it was easy to fix adding -latomic in CMakeFile.txt. How do I do this here?

configure:17964: checking for folly/folly-config.h in /usr/local
configure:17973: result: no
configure:17964: checking for folly/folly-config.h in /usr
configure:17969: result: yes
configure:17980: checking whether compiling and linking against folly works
configure:18013: g++ -o conftest -std=gnu++0x -I/usr/include -D_FORTIFY_SOURCE=2 -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/lib conftest.cpp -lfolly -lwangle -lnuma -lsnappy -lgflags -lglog  >&5
In file included from /usr/include/c++/5.2.0/x86_64-unknown-linux-gnu/bits/os_defines.h:39:0,
                 from /usr/include/c++/5.2.0/x86_64-unknown-linux-gnu/bits/c++config.h:482,
                 from /usr/include/c++/5.2.0/exception:37,
                 from /usr/include/folly/String.h:20,
                 from conftest.cpp:33:
/usr/include/features.h:328:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^
/usr/lib/libfolly.so: undefined reference to `__atomic_is_lock_free'
collect2: error: ld returned 1 exit status

renanbs avatar Nov 25 '15 04:11 renanbs

To solve this I did this:

diff --git a/thrift/m4/ax_check_folly.m4 b/thrift/m4/ax_check_folly.m4
index d2cf1fb..621a052 100644
--- a/thrift/m4/ax_check_folly.m4
+++ b/thrift/m4/ax_check_folly.m4
@@ -36,7 +36,7 @@ AC_DEFUN([AX_CHECK_FOLLY], [

     succeeded=no
     if test "x$want_folly" = "xyes"; then
-        FOLLY_LIBS="-lfolly"
+        FOLLY_LIBS="-lfolly -latomic"
         for folly_dir in $folly_searchdirs; do
             AC_MSG_CHECKING([for folly/folly-config.h in $folly_dir])
             if test -f "$folly_dir/include/folly/folly-config.h"; then

renanbs avatar Nov 27 '15 19:11 renanbs

In which file did you do it?

auonhaidar avatar Jan 14 '17 01:01 auonhaidar