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
28.05k stars 5.53k forks source link

Folly can't seem to compile with Clang #1261

Closed TheButlah closed 6 days ago

TheButlah commented 4 years ago

Hi, I tried to compile folly with clang-6, clang-7, and clang-8, but it fails (ubuntu 18.04). Here is the build failure. Hopefully this helps someone? I don't have the first clue on how to fix this other than using g++. I ran cmake with cmake -DCMAKE_CXX_COMPILER=clang++-7 -DCMAKE_C_COMPILER=clang-7 ..

In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/Conv.cpp:16:
In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/Conv.h:40:
In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/Demangle.h:19:
In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/FBString.h:61:
In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/memory/Malloc.h:100:
/usr/include/malloc.h:64:14: error: exception specification in declaration does not match previous declaration
extern void *memalign (size_t __alignment, size_t __size)
             ^
/usr/include/jemalloc/jemalloc.h:167:24: note: previous declaration is here
JEMALLOC_EXPORT void *  je_memalign(size_t alignment, size_t size)
                        ^
/usr/include/jemalloc/jemalloc.h:57:23: note: expanded from macro 'je_memalign'
#  define je_memalign memalign
                      ^
In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/Conv.cpp:16:
In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/Conv.h:40:
In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/Demangle.h:19:
In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/FBString.h:61:
In file included from /home/ryan.butler/Programming/robotics/third_party/folly/folly/memory/Malloc.h:100:
/usr/include/malloc.h:134:15: error: exception specification in declaration does not match previous declaration
extern size_t malloc_usable_size (void *__ptr) __THROW;
              ^
/usr/include/jemalloc/jemalloc.h:163:24: note: previous declaration is here
JEMALLOC_EXPORT size_t  je_malloc_usable_size(
                        ^
/usr/include/jemalloc/jemalloc.h:56:33: note: expanded from macro 'je_malloc_usable_size'
#  define je_malloc_usable_size malloc_usable_size
                                ^
2 errors generated.
third_party/folly/CMakeFiles/folly_base.dir/build.make:110: recipe for target 'third_party/folly/CMakeFiles/folly_base.dir/folly/Conv.cpp.o' failed
make[2]: *** [third_party/folly/CMakeFiles/folly_base.dir/folly/Conv.cpp.o] Error 1
CMakeFiles/Makefile2:1977: recipe for target 'third_party/folly/CMakeFiles/folly_base.dir/all' failed
make[1]: *** [third_party/folly/CMakeFiles/folly_base.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2
blockspacer commented 4 years ago

related to https://github.com/facebook/folly/issues/976