I’m new to using ray. Follow the documentation tutorial, i install ray and run test:
pip install -U ray[cpp]
# Create a Ray C++ project template to start with.
ray cpp --generate-bazel-project-template-to ray-template
cd $somepath/ray-template && bash run.sh
printf:
Fetching @rules_cc; fetching 30s
lding failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: An error occurred during the fetch of repository ‘rules_cc’:
i do not know how to fix it, so i decide to build a demo with gcc:
g++ ray_test.cpp -lray_api -g -std=c++17
int main(int argc, char **argv) {
/// initialization
ray::Init();
/// put and get object
auto object = ray::Put(100);
auto put_get_result = *(ray::Get(object));
}
when i run ray_test, printf:
logging.cc:97: Unhandled exception: St9bad_alloc. what(): std::bad_alloc
logging.cc:104: Stack trace:
libray_api.so(+0xd6fe6a) [0x7f1cef526e6a] ray::operator<<()
,
,
[0x408100] ray::CopyAndAddReference()
[0x40dab2] ray::ObjectRef<>::ObjectRef()
thanks, It’s working right. now I can link ray_api.so to learn how to use ray with c++.
about bazel, may be just network permission issues. I’m going to forget bazel.