How to compile Ray on Centos7

Hello everybody,
I am working on a cluster of Power9 machines that use Centos7.
I am trying to install ray but I am facing some difficulties. First of all, Centos7 uses by default a really old version of GCC (version 4.8.5). I have installed my own recent version of GCC and I added it to my PATH, but it seems that in several places (but not always) bazel uses the system GCC anyway. This is especially relevant when I compile redis, because the compilation fails: indeed, redis uses the atomic flag which requires C++11 (and, therefore, GCC > 5).

Another problem that I encountered is related with grpc; the error is the following:

filesystem.cc:(.text._ZN3ray11GetFileNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0xac): undefined reference to `std::filesystem::__cxx11::
path::_M_split_cmpts()’

which seems related to the fact that a -lc++fs flag is missing in the linking stage.

All these problems seems to be easy to fix, but I have already spent several hours trying to telling bazel (which I am totally unfamiliar with) what I want, unfortunately without success. I tried with some environment variables and modifying the scripts of Bazel, but everything has been useless. I think that maybe I have to setup another toolchain inside babel, but I have no idea how.

Do you have any advice about how can I fix these problems? Thank you!

Ok, maybe I have moved a little bit further. I add here some details in case somebody else has the same problems.

For fixing the errors of the linker, I had to modify the file .bazelrc that is saved inside the main directory of the repo and add the following line:
build:linux --linkopt="-lrt -lstdc++fs"

Instead, for what concerns the problem with the GCC version used when compiling redis, I have modified the file ray/bazel/BUILD.redis and I have added some lines with some useful env vars
after the line “unset CC LDFLAGS CXX CXXFLAGS”. Therefore, I added something like
export LD_LIBRARY_PATH=…
export LIBRARY_PATH=…
export CC=…
export PATH=…
where instead of the “dots” I have put the values of my environment.

Now I am able to reach the end of the compilation, but unfortunately when I run
“ray start --head”
I get a SEFGFAULT. Hope I will be able to fix this and to run ray!

Best,