facebook / wdt

Warp speed Data Transfer (WDT) is an embeddedable library (and command line tool) aiming to transfer data between 2 systems as fast as possible over multiple TCP paths.
https://www.facebook.com/WdtOpenSource
Other
2.86k stars 392 forks source link

Folly error building WDT on multiple distros #199

Closed JustinTimperio closed 3 years ago

JustinTimperio commented 4 years ago

I get the following error when building WDT on both Ubuntu > 18.xx and Fedora > 28.

Scanning dependencies of target wdt [ 86%] Building CXX object CMakeFiles/wdt.dir/util/WdtFlags.cpp.o [ 88%] Building CXX object CMakeFiles/wdt.dir/Wdt.cpp.o [ 90%] Linking CXX shared library libwdt.so [ 90%] Built target wdt Scanning dependencies of target wdtbin [ 93%] Building CXX object CMakeFiles/wdtbin.dir/wdtCmdLine.cpp.o [ 95%] Building CXX object CMakeFiles/wdtbin.dir/util/WdtFlags.cpp.o [ 97%] Building CXX object CMakeFiles/wdtbin.dir/Wdt.cpp.o [100%] Linking CXX executable _bin/wdt/wdt libfolly4wdt.so: undefined reference to `folly::strlcpy(char, char const, unsigned long)' collect2: error: ld returned 1 exit status CMakeFiles/wdtbin.dir/build.make:154: recipe for target '_bin/wdt/wdt' failed make[2]: [_bin/wdt/wdt] Error 1 CMakeFiles/Makefile2:180: recipe for target 'CMakeFiles/wdtbin.dir/all' failed make[1]: [CMakeFiles/wdtbin.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

Packages installed on Ubuntu: cmake libjemalloc-dev libgoogle-glog-dev libboost-system-dev libdouble-conversion-dev openssl build-essential libboost-all-dev libssl-dev libgtest-dev

Packages installed on Fedora: cmake boost-devel openssl jemalloc glog-devel double-conversion-devel make automake gcc gcc-c++ kernel-devel gtest-devel openssl-devel

Cmake output:

-- The C compiler identification is GNU 7.4.0 -- The CXX compiler identification is GNU 7.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Boost version: 1.65.1 -- Found the following Boost libraries: -- system -- filesystem -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1") -- Looking for posix_fallocate -- Looking for posix_fallocate - found -- Looking for sync_file_range -- Looking for sync_file_range - found -- Looking for posix_memalign -- Looking for posix_memalign - found -- Looking for posix_fadvise -- Looking for posix_fadvise - found -- Looking for clock_gettime -- Looking for clock_gettime - found -- Looking for memrchr -- Looking for memrchr - found -- Looking for pthread_atfork -- Looking for pthread_atfork - found -- Looking for C++ include linux/sockios.h -- Looking for C++ include linux/sockios.h - found -- Performing Test FOLLY_USE_LIBCPP -- Performing Test FOLLY_USE_LIBCPP - Failed -- Performing Test FOLLY_HAVE_WEAK_SYMBOLS -- Performing Test FOLLY_HAVE_WEAK_SYMBOLS - Success -- Configuring done -- Generating done -- Build files have been written to: /var/app/warp-cli/build/wdt/_build

doubleailes commented 4 years ago

I thinks the answer is here: https://github.com/flier/docker-wdt/blob/master/Dockerfile

DunZzzz commented 4 years ago

Got the exact same issue on arch, fixed it by adding the CString.cpp file to wdt CMakeList in the FOLLY_CPP_SRC. The file contains the strlcpy function.

set (FOLLY_CPP_SRC
    "${FOLLY_SOURCE_DIR}/folly/Conv.cpp"
    "${FOLLY_SOURCE_DIR}/folly/Demangle.cpp"
    "${FOLLY_SOURCE_DIR}/folly/hash/Checksum.cpp"
    "${FOLLY_SOURCE_DIR}/folly/hash/detail/ChecksumDetail.cpp"
    "${FOLLY_SOURCE_DIR}/folly/hash/detail/Crc32cDetail.cpp"
    "${FOLLY_SOURCE_DIR}/folly/hash/detail/Crc32CombineDetail.cpp"
    "${FOLLY_SOURCE_DIR}/folly/lang/ColdClass.cpp"
    "${FOLLY_SOURCE_DIR}/folly/ScopeGuard.cpp"

       # FIX HERE
    "${FOLLY_SOURCE_DIR}/folly/lang/CString.cpp"
)
JustinTimperio commented 3 years ago

For those running into issues, I have locked my install script for warp-cli. You can automatically install WDT with this shell script. https://github.com/JustinTimperio/warp-cli/blob/master/build/install.sh

All you need to do is run: curl https://raw.githubusercontent.com/JustinTimperio/warp-cli/master/build/install.sh | sudo bash

davide125 commented 3 years ago

201 should fix this