Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cachelib fails to build #282

Closed
george-reilly-wdc opened this issue Dec 12, 2023 · 3 comments
Closed

cachelib fails to build #282

george-reilly-wdc opened this issue Dec 12, 2023 · 3 comments

Comments

@george-reilly-wdc
Copy link

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 #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
Copy link
Contributor

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
Copy link
Author

Hi Jaesoo-fb,

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

@jaesoo-fb
Copy link
Contributor

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.

facebook-github-bot pushed a commit that referenced this issue Jan 12, 2024
Summary:
The Ubuntu-18 build has been broken for long time and the similar issue has also been reported for
Centos-8.1 (#282).

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

It seems that those issues can be fixed by using upper version of gcc (e.g., gcc-11). Both of those
platforms had been EOL-ed already, so this change fixes the builds for both Ubuntu-18 and Centos-8.1
by installing custom gcc packages and creating symbolic links manually (i.e., update-alternatives)
for github workflows.

Reviewed By: therealgymmy

Differential Revision: D52449219

fbshipit-source-id: 03c59216d7d6609882169e0eef208899be20473a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants