facebook / folly

An open-source C++ library developed and used at Facebook.
https://groups.google.com/forum/?fromgroups#!forum/facebook-folly
Apache License 2.0
27.54k stars 5.47k forks source link

installing on ubuntu 16:04 - [CMakeFiles/folly_base.dir/folly/Random.cpp.o] Error 1 #1490

Closed naarkhoo closed 1 year ago

naarkhoo commented 3 years ago

I am trying to install folly on ubuntu 16:04.

I start with cmake CMakeList.txt

root@a44086281337:~/folly# cmake CMakeLists.txt 
-- The CXX compiler identification is GNU 5.4.0
-- The C compiler identification is GNU 5.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Found Boost: /usr/include (found suitable version "1.58.0", minimum required is "1.51.0") found components: context filesystem program_options regex system thread chrono date_time atomic 
-- Found DoubleConversion: /usr/lib/x86_64-linux-gnu/libdouble-conversion.so  
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (gflags)
  does not match the name of the calling package (Gflags).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  build/fbcode_builder/CMake/FindGflags.cmake:70 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/folly-deps.cmake:55 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found gflags: /usr/lib/x86_64-linux-gnu/libgflags.so  
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (glog) does
  not match the name of the calling package (Glog).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  build/fbcode_builder/CMake/FindGlog.cmake:22 (find_package_handle_standard_args)
  CMake/folly-deps.cmake:64 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found glog: /usr/lib/x86_64-linux-gnu/libglog.so  
-- Found libevent: /usr/lib/x86_64-linux-gnu/libevent.so
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g")  
-- Looking for ASN1_TIME_diff
-- Looking for ASN1_TIME_diff - found
-- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.6") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Found LibLZMA: /usr/lib/x86_64-linux-gnu/liblzma.so (found version "5.1.0") 
-- Found LZ4: /usr/lib/x86_64-linux-gnu/liblz4.so  
-- Found LZ4: /usr/lib/x86_64-linux-gnu/liblz4.so
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (ZSTD) does
  not match the name of the calling package (Zstd).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  CMake/FindZstd.cmake:32 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/folly-deps.cmake:114 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found ZSTD: /usr/lib/x86_64-linux-gnu/libzstd.so  
-- Found Zstd: /usr/lib/x86_64-linux-gnu/libzstd.so
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (SNAPPY)
  does not match the name of the calling package (Snappy).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  CMake/FindSnappy.cmake:31 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/folly-deps.cmake:121 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found SNAPPY: /usr/lib/x86_64-linux-gnu/libsnappy.so  
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (LIBDWARF)
  does not match the name of the calling package (LibDwarf).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  CMake/FindLibDwarf.cmake:25 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/folly-deps.cmake:128 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found LIBDWARF: /usr/lib/libdwarf.a  
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (LIBIBERTY)
  does not match the name of the calling package (Libiberty).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  CMake/FindLibiberty.cmake:22 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/folly-deps.cmake:132 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found LIBIBERTY: /usr/lib/x86_64-linux-gnu/libiberty.a  
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (LIBAIO)
  does not match the name of the calling package (LibAIO).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  CMake/FindLibAIO.cmake:22 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/folly-deps.cmake:136 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found LIBAIO: /usr/lib/x86_64-linux-gnu/libaio.so  
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (LIBURING)
  does not match the name of the calling package (LibUring).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  CMake/FindLibUring.cmake:22 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/folly-deps.cmake:140 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found LIBURING: /usr/lib/liburing.so  
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (LIBSODIUM)
  does not match the name of the calling package (Libsodium).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  CMake/FindLibsodium.cmake:22 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/folly-deps.cmake:144 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found LIBSODIUM: /usr/lib/x86_64-linux-gnu/libsodium.so  
-- Found Libsodium: /usr/lib/x86_64-linux-gnu/libsodium.so
CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (LIBUNWIND)
  does not match the name of the calling package (LibUnwind).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  build/fbcode_builder/CMake/FindLibUnwind.cmake:22 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/folly-deps.cmake:156 (find_package)
  CMakeLists.txt:118 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found LIBUNWIND: /usr/lib/x86_64-linux-gnu/libunwind.so  
-- Looking for swapcontext
-- Looking for swapcontext - found
-- Looking for C++ include elf.h
-- Looking for C++ include elf.h - found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include  
-- Setting FOLLY_USE_SYMBOLIZER: ON
-- Setting FOLLY_HAVE_ELF: 1
-- Setting FOLLY_HAVE_DWARF: TRUE
-- Performing Test FOLLY_CPP_ATOMIC_BUILTIN
-- Performing Test FOLLY_CPP_ATOMIC_BUILTIN - Success
-- Looking for C++ include jemalloc/jemalloc.h
-- Looking for C++ include jemalloc/jemalloc.h - found
-- Performing Test COMPILER_HAS_UNKNOWN_WARNING_OPTION
-- Performing Test COMPILER_HAS_UNKNOWN_WARNING_OPTION - Failed
-- Performing Test COMPILER_HAS_W_SHADOW_LOCAL
-- Performing Test COMPILER_HAS_W_SHADOW_LOCAL - Failed
-- Performing Test COMPILER_HAS_W_SHADOW_COMPATIBLE_LOCAL
-- Performing Test COMPILER_HAS_W_SHADOW_COMPATIBLE_LOCAL - Failed
-- Performing Test COMPILER_HAS_W_NOEXCEPT_TYPE
-- Performing Test COMPILER_HAS_W_NOEXCEPT_TYPE - Failed
-- Performing Test COMPILER_HAS_W_NULLABILITY_COMPLETENESS
-- Performing Test COMPILER_HAS_W_NULLABILITY_COMPLETENESS - Failed
-- Performing Test COMPILER_HAS_W_INCONSISTENT_MISSING_OVERRIDE
-- Performing Test COMPILER_HAS_W_INCONSISTENT_MISSING_OVERRIDE - Failed
-- Performing Test COMPILER_HAS_F_ALIGNED_NEW
-- Performing Test COMPILER_HAS_F_ALIGNED_NEW - Failed
-- Performing Test COMPILER_HAS_F_OPENMP
-- Performing Test COMPILER_HAS_F_OPENMP - Success
-- Looking for pthread_atfork
-- Looking for pthread_atfork - found
-- Looking for memrchr
-- Looking for memrchr - found
-- Looking for accept4
-- Looking for accept4 - found
-- Looking for getrandom
-- Looking for getrandom - not found
-- Looking for preadv
-- Looking for preadv - found
-- Looking for pwritev
-- Looking for pwritev - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for pipe2
-- Looking for pipe2 - found
-- Looking for sendmmsg
-- Looking for sendmmsg - found
-- Looking for recvmmsg
-- Looking for recvmmsg - found
-- Looking for malloc_usable_size
-- Looking for malloc_usable_size - found
-- Performing Test FOLLY_HAVE_IFUNC
-- Performing Test FOLLY_HAVE_IFUNC - Success
-- Performing Test FOLLY_HAVE_STD__IS_TRIVIALLY_COPYABLE
-- Performing Test FOLLY_HAVE_STD__IS_TRIVIALLY_COPYABLE - Success
-- Performing Test FOLLY_HAVE_UNALIGNED_ACCESS
-- Performing Test FOLLY_HAVE_UNALIGNED_ACCESS - Success
-- Performing Test FOLLY_HAVE_VLA
-- Performing Test FOLLY_HAVE_VLA - Success
-- Performing Test FOLLY_HAVE_WEAK_SYMBOLS
-- Performing Test FOLLY_HAVE_WEAK_SYMBOLS - Success
-- Performing Test FOLLY_HAVE_LINUX_VDSO
-- Performing Test FOLLY_HAVE_LINUX_VDSO - Success
-- Looking for C++ include sys/types.h
-- Looking for C++ include sys/types.h - found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for C++ include stddef.h
-- Looking for C++ include stddef.h - found
-- Check size of __int128
-- Check size of __int128 - done
-- Performing Test HAVE_INT128_TRAITS
-- Performing Test HAVE_INT128_TRAITS - Failed
-- Performing Test FOLLY_HAVE_WCHAR_SUPPORT
-- Performing Test FOLLY_HAVE_WCHAR_SUPPORT - Success
-- Performing Test FOLLY_HAVE_EXTRANDOM_SFMT19937
-- Performing Test FOLLY_HAVE_EXTRANDOM_SFMT19937 - Success
-- Performing Test FOLLY_USE_LIBCPP
-- Performing Test FOLLY_USE_LIBCPP - Failed
-- Performing Test FOLLY_USE_LIBSTDCPP
-- Performing Test FOLLY_USE_LIBSTDCPP - Success
-- Performing Test HAVE_VSNPRINTF_ERRORS
-- Performing Test HAVE_VSNPRINTF_ERRORS - Success
-- Performing Test GFLAGS_NAMESPACE_IS_GFLAGS
-- Performing Test GFLAGS_NAMESPACE_IS_GFLAGS - Success
-- arch x86_64-linux-gnu matches x86_64, setting SSE2/AVX2 compile flags for LtHash SIMD code
-- Performing Test COMPILER_HAS_M_PCLMUL
-- Performing Test COMPILER_HAS_M_PCLMUL - Success
-- compiler has flag pclmul, setting compile flag for /root/folly/folly/hash/detail/ChecksumDetail.cpp;/root/folly/folly/hash/detail/Crc32CombineDetail.cpp;/root/folly/folly/hash/detail/Crc32cDetail.cpp
-- Configuring done
-- Generating done
-- Build files have been written to: /root/folly

then I do `make`
root@203cb52d9164:~/folly# make
Scanning dependencies of target folly_base
[  0%] Building CXX object CMakeFiles/folly_base.dir/folly/CancellationToken.cpp.o
[  1%] Building CXX object CMakeFiles/folly_base.dir/folly/ClockGettimeWrappers.cpp.o
[  1%] Building CXX object CMakeFiles/folly_base.dir/folly/Conv.cpp.o
[  1%] Building CXX object CMakeFiles/folly_base.dir/folly/Demangle.cpp.o
[  2%] Building CXX object CMakeFiles/folly_base.dir/folly/ExceptionString.cpp.o
[  2%] Building CXX object CMakeFiles/folly_base.dir/folly/ExceptionWrapper.cpp.o
[  2%] Building CXX object CMakeFiles/folly_base.dir/folly/Executor.cpp.o
[  3%] Building CXX object CMakeFiles/folly_base.dir/folly/File.cpp.o
[  3%] Building CXX object CMakeFiles/folly_base.dir/folly/FileUtil.cpp.o
[  3%] Building CXX object CMakeFiles/folly_base.dir/folly/Fingerprint.cpp.o
[  4%] Building CXX object CMakeFiles/folly_base.dir/folly/Format.cpp.o
[  4%] Building CXX object CMakeFiles/folly_base.dir/folly/GroupVarint.cpp.o
[  4%] Building CXX object CMakeFiles/folly_base.dir/folly/IPAddress.cpp.o
[  5%] Building CXX object CMakeFiles/folly_base.dir/folly/IPAddressV4.cpp.o
[  5%] Building CXX object CMakeFiles/folly_base.dir/folly/IPAddressV6.cpp.o
[  6%] Building CXX object CMakeFiles/folly_base.dir/folly/MacAddress.cpp.o
[  6%] Building CXX object CMakeFiles/folly_base.dir/folly/MicroLock.cpp.o
[  6%] Building CXX object CMakeFiles/folly_base.dir/folly/Random.cpp.o
In file included from /root/folly/folly/ThreadLocal.h:51:0,
                 from /root/folly/folly/SingletonThreadLocal.h:25,
                 from /root/folly/folly/Random.cpp:27:
/root/folly/folly/SharedMutex.h: In instantiation of 'class folly::SharedMutexImpl<true>::WriteHolder':
/root/folly/folly/SharedMutex.h:1599:23:   required from here
/root/folly/folly/SharedMutex.h:1504:25: warning: '__warn_unused_result__' attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD WriteHolder {
                         ^
/root/folly/folly/SharedMutex.h: In instantiation of 'class folly::SharedMutexImpl<true>::UpgradeHolder':
/root/folly/folly/SharedMutex.h:1599:23:   required from here
/root/folly/folly/SharedMutex.h:1456:25: warning: '__warn_unused_result__' attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD UpgradeHolder {
                         ^
/root/folly/folly/SharedMutex.h: In instantiation of 'class folly::SharedMutexImpl<true>::ReadHolder':
/root/folly/folly/SharedMutex.h:1599:23:   required from here
/root/folly/folly/SharedMutex.h:1396:25: warning: '__warn_unused_result__' attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD ReadHolder {
                         ^
/root/folly/folly/SharedMutex.h: In instantiation of 'class folly::SharedMutexImpl<false>::WriteHolder':
/root/folly/folly/SharedMutex.h:1600:23:   required from here
/root/folly/folly/SharedMutex.h:1504:25: warning: '__warn_unused_result__' attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD WriteHolder {
                         ^
/root/folly/folly/SharedMutex.h: In instantiation of 'class folly::SharedMutexImpl<false>::UpgradeHolder':
/root/folly/folly/SharedMutex.h:1600:23:   required from here
/root/folly/folly/SharedMutex.h:1456:25: warning: '__warn_unused_result__' attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD UpgradeHolder {
                         ^
/root/folly/folly/SharedMutex.h: In instantiation of 'class folly::SharedMutexImpl<false>::ReadHolder':
/root/folly/folly/SharedMutex.h:1600:23:   required from here
/root/folly/folly/SharedMutex.h:1396:25: warning: '__warn_unused_result__' attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD ReadHolder {
                         ^
/tmp/cca8sM6D.s: Assembler messages:
/tmp/cca8sM6D.s:44991: Error: symbol `_ZN5folly6detailL26is_similar_instantiation_vE' is already defined
CMakeFiles/folly_base.dir/build.make:302: recipe for target 'CMakeFiles/folly_base.dir/folly/Random.cpp.o' failed
make[2]: *** [CMakeFiles/folly_base.dir/folly/Random.cpp.o] Error 1
CMakeFiles/Makefile2:165: recipe for target 'CMakeFiles/folly_base.dir/all' failed
make[1]: *** [CMakeFiles/folly_base.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
root@203cb52d9164:~/folly# 

I am using gcc and g++ 5.4 and my cmake is 3.19 - I appreciate any hint

naarkhoo commented 3 years ago

If I update my compiler to gcc-9 and g++9 - I get further but still it fails

[ 10%] Building CXX object CMakeFiles/folly_base.dir/folly/dynamic.cpp.o
[ 11%] Building CXX object CMakeFiles/folly_base.dir/folly/json.cpp.o
[ 11%] Building CXX object CMakeFiles/folly_base.dir/folly/json_patch.cpp.o
[ 11%] Building CXX object CMakeFiles/folly_base.dir/folly/json_pointer.cpp.o
[ 12%] Building CXX object CMakeFiles/folly_base.dir/folly/compression/Compression.cpp.o
In file included from /root/folly/folly/compression/Compression.cpp:43:
/root/folly/folly/compression/Zstd.h:52:12: error: 'ZSTD_cParameter' has not been declared
   52 |   void set(ZSTD_cParameter param, unsigned value);
      |            ^~~~~~~~~~~~~~~
/root/folly/folly/compression/Zstd.h:65:3: error: 'ZSTD_CCtx_params' does not name a type; did you mean 'ZSTD_CCtx_s'?
   65 |   ZSTD_CCtx_params const* params() const { return params_.get(); }
      |   ^~~~~~~~~~~~~~~~
      |   ZSTD_CCtx_s
/root/folly/folly/compression/Zstd.h:74:30: error: 'ZSTD_CCtx_params' has not been declared
   74 |   static void freeCCtxParams(ZSTD_CCtx_params* params);
      |                              ^~~~~~~~~~~~~~~~
/root/folly/folly/compression/Zstd.h:76:7: error: 'ZSTD_CCtx_params' was not declared in this scope; did you mean 'ZSTD_CCtx_s'?
   76 |       ZSTD_CCtx_params,
      |       ^~~~~~~~~~~~~~~~
      |       ZSTD_CCtx_s
/root/folly/folly/compression/Zstd.h:77:38: error: 'ZSTD_CCtx_params' was not declared in this scope; did you mean 'ZSTD_CCtx_s'?
   77 |       folly::static_function_deleter<ZSTD_CCtx_params, &freeCCtxParams>>
      |                                      ^~~~~~~~~~~~~~~~
      |                                      ZSTD_CCtx_s
/root/folly/folly/compression/Zstd.h:77:57: error: template argument 1 is invalid
   77 |       folly::static_function_deleter<ZSTD_CCtx_params, &freeCCtxParams>>
      |                                                         ^~~~~~~~~~~~~~
/root/folly/folly/compression/Zstd.h:77:57: note: invalid template non-type parameter
/root/folly/folly/compression/Zstd.h:77:71: error: template argument 1 is invalid
   77 |       folly::static_function_deleter<ZSTD_CCtx_params, &freeCCtxParams>>
      |                                                                       ^~
/root/folly/folly/compression/Zstd.h:77:71: error: template argument 2 is invalid
/root/folly/folly/compression/Compression.cpp: In function 'int folly::io::{anonymous}::zstdConvertLevel(int)':
/root/folly/folly/compression/Compression.cpp:1411:28: error: 'ZSTD_maxCLevel' was not declared in this scope
 1411 |   if (level < 1 || level > ZSTD_maxCLevel()) {
      |                            ^~~~~~~~~~~~~~
CMakeFiles/folly_base.dir/build.make:497: recipe for target 'CMakeFiles/folly_base.dir/folly/compression/Compression.cpp.o' failed
make[2]: *** [CMakeFiles/folly_base.dir/folly/compression/Compression.cpp.o] Error 1
CMakeFiles/Makefile2:165: recipe for target 'CMakeFiles/folly_base.dir/all' failed
make[1]: *** [CMakeFiles/folly_base.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
LIZHICHAOUNICORN commented 3 years ago

any update?

yfeldblum commented 3 years ago

Do you have a recent-enough zstd?

irvingzhang0512 commented 3 years ago

@yfeldblum hi, I met the same problem. After install zstd master branch, the same errors

cmake log

-- The CXX compiler identification is GNU 5.5.0
-- The C compiler identification is GNU 5.5.0
-- 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
-- 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
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Found Boost: /usr/include (found suitable version "1.58.0", minimum required is "1.51.0") found components: context filesystem program_options regex system thread chrono date_time atomic 
-- Found DoubleConversion: /usr/lib/x86_64-linux-gnu/libdouble-conversion.so  
-- Found gflags from package config /usr/local/lib/cmake/gflags/gflags-config.cmake
-- Found glog: /usr/local/lib/libglog.so  
-- Found libevent: /usr/lib/x86_64-linux-gnu/libevent.so
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.0.2g")  
-- Looking for ASN1_TIME_diff
-- Looking for ASN1_TIME_diff - found
-- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.6") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Found LibLZMA: /usr/lib/x86_64-linux-gnu/liblzma.so (found version "5.1.0") 
-- Found LZ4: /usr/lib/x86_64-linux-gnu/liblz4.so  
-- Found LZ4: /usr/lib/x86_64-linux-gnu/liblz4.so
-- Found ZSTD: /usr/local/lib/libzstd.so  
-- Found Zstd: /usr/local/lib/libzstd.so
-- Found SNAPPY: /usr/lib/x86_64-linux-gnu/libsnappy.so  
-- Found LIBDWARF: /usr/lib/libdwarf.a  
-- Found LIBIBERTY: /usr/lib/x86_64-linux-gnu/libiberty.a  
-- Could NOT find LIBAIO (missing: LIBAIO_LIBRARY LIBAIO_INCLUDE_DIR) 
-- Could NOT find LIBURING (missing: LIBURING_LIBRARY LIBURING_INCLUDE_DIR) 
-- Could NOT find LIBSODIUM (missing: LIBSODIUM_LIBRARY LIBSODIUM_INCLUDE_DIR) 
-- Found LIBUNWIND: /usr/local/lib/libunwind.so  
-- Looking for swapcontext
-- Looking for swapcontext - found
-- Looking for C++ include elf.h
-- Looking for C++ include elf.h - found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include  
-- Setting FOLLY_USE_SYMBOLIZER: ON
-- Setting FOLLY_HAVE_ELF: 1
-- Setting FOLLY_HAVE_DWARF: TRUE
-- Performing Test FOLLY_CPP_ATOMIC_BUILTIN
-- Performing Test FOLLY_CPP_ATOMIC_BUILTIN - Success
-- Looking for C++ include jemalloc/jemalloc.h
-- Looking for C++ include jemalloc/jemalloc.h - found
-- Performing Test COMPILER_HAS_UNKNOWN_WARNING_OPTION
-- Performing Test COMPILER_HAS_UNKNOWN_WARNING_OPTION - Failed
-- Performing Test COMPILER_HAS_W_SHADOW_LOCAL
-- Performing Test COMPILER_HAS_W_SHADOW_LOCAL - Failed
-- Performing Test COMPILER_HAS_W_SHADOW_COMPATIBLE_LOCAL
-- Performing Test COMPILER_HAS_W_SHADOW_COMPATIBLE_LOCAL - Failed
-- Performing Test COMPILER_HAS_W_NOEXCEPT_TYPE
-- Performing Test COMPILER_HAS_W_NOEXCEPT_TYPE - Failed
-- Performing Test COMPILER_HAS_W_NULLABILITY_COMPLETENESS
-- Performing Test COMPILER_HAS_W_NULLABILITY_COMPLETENESS - Failed
-- Performing Test COMPILER_HAS_W_INCONSISTENT_MISSING_OVERRIDE
-- Performing Test COMPILER_HAS_W_INCONSISTENT_MISSING_OVERRIDE - Failed
-- Performing Test COMPILER_HAS_F_ALIGNED_NEW
-- Performing Test COMPILER_HAS_F_ALIGNED_NEW - Failed
-- Performing Test COMPILER_HAS_F_OPENMP
-- Performing Test COMPILER_HAS_F_OPENMP - Success
-- Looking for pthread_atfork
-- Looking for pthread_atfork - found
-- Looking for accept4
-- Looking for accept4 - found
-- Looking for getrandom
-- Looking for getrandom - not found
-- Looking for preadv
-- Looking for preadv - found
-- Looking for pwritev
-- Looking for pwritev - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for pipe2
-- Looking for pipe2 - found
-- Looking for sendmmsg
-- Looking for sendmmsg - found
-- Looking for recvmmsg
-- Looking for recvmmsg - found
-- Looking for malloc_usable_size
-- Looking for malloc_usable_size - found
-- Performing Test FOLLY_HAVE_IFUNC
-- Performing Test FOLLY_HAVE_IFUNC - Success
-- Performing Test FOLLY_HAVE_STD__IS_TRIVIALLY_COPYABLE
-- Performing Test FOLLY_HAVE_STD__IS_TRIVIALLY_COPYABLE - Success
-- Performing Test FOLLY_HAVE_UNALIGNED_ACCESS
-- Performing Test FOLLY_HAVE_UNALIGNED_ACCESS - Success
-- Performing Test FOLLY_HAVE_VLA
-- Performing Test FOLLY_HAVE_VLA - Success
-- Performing Test FOLLY_HAVE_WEAK_SYMBOLS
-- Performing Test FOLLY_HAVE_WEAK_SYMBOLS - Success
-- Performing Test FOLLY_HAVE_LINUX_VDSO
-- Performing Test FOLLY_HAVE_LINUX_VDSO - Success
-- Looking for C++ include sys/types.h
-- Looking for C++ include sys/types.h - found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for C++ include stddef.h
-- Looking for C++ include stddef.h - found
-- Check size of __int128
-- Check size of __int128 - done
-- Performing Test HAVE_INT128_TRAITS
-- Performing Test HAVE_INT128_TRAITS - Failed
-- Performing Test FOLLY_HAVE_WCHAR_SUPPORT
-- Performing Test FOLLY_HAVE_WCHAR_SUPPORT - Success
-- Performing Test FOLLY_HAVE_EXTRANDOM_SFMT19937
-- Performing Test FOLLY_HAVE_EXTRANDOM_SFMT19937 - Success
-- Performing Test FOLLY_USE_LIBCPP
-- Performing Test FOLLY_USE_LIBCPP - Failed
-- Performing Test FOLLY_USE_LIBSTDCPP
-- Performing Test FOLLY_USE_LIBSTDCPP - Success
-- Performing Test HAVE_VSNPRINTF_ERRORS
-- Performing Test HAVE_VSNPRINTF_ERRORS - Success
-- Performing Test GFLAGS_NAMESPACE_IS_GFLAGS
-- Performing Test GFLAGS_NAMESPACE_IS_GFLAGS - Success
-- Performing Test COMPILER_HAS_M_PCLMUL
-- Performing Test COMPILER_HAS_M_PCLMUL - Success
-- compiler has flag pclmul, setting compile flag for /ssd01/zhangyiyang/folly/folly/hash/detail/ChecksumDetail.cpp;/ssd01/zhangyiyang/folly/folly/hash/detail/Crc32CombineDetail.cpp;/ssd01/zhangyiyang/folly/folly/hash/detail/Crc32cDetail.cpp
-- Configuring done
-- Generating done
-- Build files have been written to: /ssd01/zhangyiyang/folly/_build

make log

[  6%] Building CXX object CMakeFiles/folly_base.dir/folly/Random.cpp.o
In file included from /ssd01/zhangyiyang/folly/folly/ThreadLocal.h:51:0,
                 from /ssd01/zhangyiyang/folly/folly/SingletonThreadLocal.h:25,
                 from /ssd01/zhangyiyang/folly/folly/Random.cpp:27:
/ssd01/zhangyiyang/folly/folly/SharedMutex.h: In instantiation of ‘class folly::SharedMutexImpl<true>::WriteHolder’:
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1599:23:   required from here
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1504:25: warning: ‘__warn_unused_result__’ attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD WriteHolder {
                         ^
/ssd01/zhangyiyang/folly/folly/SharedMutex.h: In instantiation of ‘class folly::SharedMutexImpl<true>::UpgradeHolder’:
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1599:23:   required from here
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1456:25: warning: ‘__warn_unused_result__’ attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD UpgradeHolder {
                         ^
/ssd01/zhangyiyang/folly/folly/SharedMutex.h: In instantiation of ‘class folly::SharedMutexImpl<true>::ReadHolder’:
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1599:23:   required from here
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1396:25: warning: ‘__warn_unused_result__’ attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD ReadHolder {
                         ^
/ssd01/zhangyiyang/folly/folly/SharedMutex.h: In instantiation of ‘class folly::SharedMutexImpl<false>::WriteHolder’:
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1600:23:   required from here
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1504:25: warning: ‘__warn_unused_result__’ attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD WriteHolder {
                         ^
/ssd01/zhangyiyang/folly/folly/SharedMutex.h: In instantiation of ‘class folly::SharedMutexImpl<false>::UpgradeHolder’:
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1600:23:   required from here
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1456:25: warning: ‘__warn_unused_result__’ attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD UpgradeHolder {
                         ^
/ssd01/zhangyiyang/folly/folly/SharedMutex.h: In instantiation of ‘class folly::SharedMutexImpl<false>::ReadHolder’:
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1600:23:   required from here
/ssd01/zhangyiyang/folly/folly/SharedMutex.h:1396:25: warning: ‘__warn_unused_result__’ attribute only applies to function types [-Wattributes]
   class FOLLY_NODISCARD ReadHolder {
                         ^
/tmp/ccC6tpbI.s: Assembler messages:
/tmp/ccC6tpbI.s:45005: Error: symbol `_ZN5folly6detailL26is_similar_instantiation_vE' is already defined
CMakeFiles/folly_base.dir/build.make:283: recipe for target 'CMakeFiles/folly_base.dir/folly/Random.cpp.o' failed
make[2]: *** [CMakeFiles/folly_base.dir/folly/Random.cpp.o] Error 1
CMakeFiles/Makefile2:146: recipe for target 'CMakeFiles/folly_base.dir/all' failed
make[1]: *** [CMakeFiles/folly_base.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
irvingzhang0512 commented 3 years ago

Problem solved. Step 1: use g++-9 instead of g++-5 Step 2: compile and install zstd