| .. | ||
| .gitignore | ||
| bazel.yaml | ||
| build_bazel_sample.sh | ||
| README.md | ||
A Sample C++ Project with Bazel
This project demonstrates how to use Bazel to build C++ projects for Occlum. To install Bazel on Ubuntu, follow the instructions here.
- Download a Bazel sample project in C++ and build it with Occlum toolchain
./build_bazel_sample.sh
When completed, the resulting hello-world can be found in examples/cpp-tutorial/stage3/bazel-bin/main directory.
- (Optional) Run hello-worldon Linux
./examples/cpp-tutorial/stage3/bazel-bin/main/hello-world
- Run hello-worldon Occlum
mkdir occlum_workspace && cd occlum_workspace
occlum init
cp ../examples/cpp-tutorial/stage3/bazel-bin/main/hello-world image/bin
occlum build
occlum run /bin/hello-world