facebook / CacheLib

Pluggable in-process caching engine to build and scale high performance services
https://www.cachelib.org
Apache License 2.0
1.18k stars 254 forks source link

cachelib fails to build #282

Closed george-reilly-wdc closed 8 months ago

george-reilly-wdc commented 8 months ago

Describe the bug This is a follow-on of Issue #275. (build.sh: error: failed to build cachelib)

Environment : [root@fb-yv3-s1-n1 /]# uname -a Linux fb-yv3-s1-n1 5.12.0-0_fbk2_3390_g7ecb4ac46d7f https://github.com/facebook/CacheLib/pull/1 SMP Tue Dec 14 10:55:56 PST 2021 x86_64 x86_64 x86_64 GNU/Linux [root@fb-yv3-s1-n1 /]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core)

To Reproduce Steps to reproduce the behavior: Commands : git clone https://github.com/facebook/CacheLib.git ./contrib/build.sh -j Fails with : [ 82%] Building CXX object allocator/CMakeFiles/cachelib_allocator.dir/PoolRebalancer.cpp.o /tmp/ccyAQXIu.s: Assembler messages: /tmp/ccyAQXIu.s:5: Warning: setting incorrect section attributes for .rodata.thrift.data /tmp/ccojqa91.s: Assembler messages: /tmp/ccojqa91.s:5: Warning: setting incorrect section attributes for .rodata.thrift.data /tmp/ccOLUSsf.s: Assembler messages: /tmp/ccOLUSsf.s:5: Warning: setting incorrect section attributes for .rodata.thrift.data c++: fatal error: Killed signal terminated program cc1plus compilation terminated. make[2]: [allocator/CMakeFiles/cachelib_allocator.dir/build.make:397: allocator/CMakeFiles/cachelib_allocator.dir/CacheAllocator.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:532: allocator/CMakeFiles/cachelib_allocator.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 build-package.sh: error: make failed build.sh: error: failed to build cachelib

Then I tried using the link you gave in Issue #275 with this command : git clone https://github.com/facebook/CacheLib/blob/main/.github/workflows/build-cachelib-centos-8-1.yml And it failed with : [root@fb-yv3-s1-n1 /]# git clone https://github.com/facebook/CacheLib/blob/main/.github/workflows/build-cachelib-centos-8-1.yml Cloning into 'build-cachelib-centos-8-1.yml'... fatal: repository 'https://github.com/facebook/CacheLib/blob/main/.github/workflows/build-cachelib-centos-8-1.yml/' not found

Expected behavior successful build

jaesoo-fb commented 8 months ago

Hi @george-reilly-wdc,

To clarify, build-cachelib-centos-8-1.yml mentioned in #275 is not a repo. It is just a file in CacheLib repo which is basically a script to build CacheLib on docker container of Centos 8.1.

For the build issue, what is the version of the gcc? I think this might be the same known issue on older version of OS including Ubuntu 18; e.g., build.

Hopefully, this will be resolved by reinstalling/updating tool chain following build-cachelib-centos-8-1.yml?

george-reilly-wdc commented 8 months ago

Hi Jaesoo-fb,

[root@fb-yv3-s1-n3 ~]# gcc --version gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4)

jaesoo-fb commented 8 months ago

Hi @george-reilly-wdc

Are you still experiencing this issue? I had a chance to repro this and confirmed that the build works with gcc-11 at least. Something like below worked for me.

$ dnf install -y gcc-toolset-11-gcc gcc-toolset-11-gcc-c++
$ update-alternatives --install /usr/bin/gcc gcc /opt/rh/gcc-toolset-11/root/usr/bin/gcc 110 --slave /usr/bin/g++ g++ /opt/rh/gcc-toolset-11/root/usr/bin/g++ --slave /usr/bin/gcov gcov /opt/rh/gcc-toolset-11/root/usr/bin/gcov --slave /usr/bin/gcc-ar gcc-ar /opt/rh/gcc-toolset-11/root/usr/bin/gcc-ar --slave /usr/bin/gcc-ranlib gcc-ranlib /opt/rh/gcc-toolset-11/root/usr/bin/gcc-ranlib  --slave /usr/bin/cpp cpp /opt/rh/gcc-toolset-11/root/usr/bin/cpp

I think you might first need to uninstall gcc if you already installed.