rules_ll
所属分类:GPU/显卡
开发工具:Starlark
文件大小:612KB
下载次数:0
上传日期:2023-06-07 21:42:26
上 传 者:
sh-1993
说明: 用于当代C++和异构编程的基于Upstream Clang LLVM的工具链
(An Upstream Clang LLVM-based toolchain for contemporary C++ and heterogeneous programming)
文件列表:
.bazelrc (2053, 2023-08-04)
.envrc (19, 2023-08-04)
.golangci.yml (405, 2023-08-04)
.markdownlint.json (66, 2023-08-04)
.vale.ini (161, 2023-08-04)
BUILD.bazel (28, 2023-08-04)
LICENSE (13122, 2023-08-04)
MODULE.bazel (2419, 2023-08-04)
SECURITY.md (778, 2023-08-04)
WORKSPACE.bazel (9, 2023-08-04)
bazel-wrapper (0, 2023-08-04)
bazel-wrapper\default.nix (3630, 2023-08-04)
devtools (0, 2023-08-04)
devtools\BUILD.bazel (1585, 2023-08-04)
devtools\clusters (0, 2023-08-04)
devtools\clusters\local.go (3820, 2023-08-04)
devtools\components (0, 2023-08-04)
devtools\components\cilium.go (2043, 2023-08-04)
devtools\components\components.go (667, 2023-08-04)
devtools\components\cubefs.go (1727, 2023-08-04)
devtools\components\tekton.go (1652, 2023-08-04)
devtools\components\zot.go (693, 2023-08-04)
devtools\docs.sh (507, 2023-08-04)
devtools\ll.nix (1872, 2023-08-04)
devtools\main.go (3098, 2023-08-04)
devtools\module.sh (1185, 2023-08-04)
devtools\overlay.sh (1065, 2023-08-04)
devtools\rbe.nix (1826, 2023-08-04)
docs (0, 2023-08-04)
docs\CNAME (13, 2023-08-04)
docs\CODE_OF_CONDUCT.md (290, 2023-08-04)
... ...
# `rules_ll`
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6822/badge)](https://bestpractices.coreinfrastructure.org/projects/6822)
[![OSSF-Scorecard Score](https://img.shields.io/ossf-scorecard/github.com/eomii/rules_ll?label=openssf%20scorecard)](https://api.securityscorecards.dev/projects/github.com/eomii/rules_ll)
An upstream Clang/LLVM-based toolchain for contemporary C++ and heterogeneous
programming.
This project interleaves Nix and Bazel with opinionated Starlark rules for C++.
Builds running within `rules_ll`-compatible workspaces achieve virtually perfect
cache hit rates across machines, using C++ toolchains often several major
versions ahead of most other remote execution setups.
The `ll_*` rules use a toolchain purpose-built around Clang/LLVM. You can't
combine `ll_*` and `cc_*` targets at the moment, but you can still build `cc_*`
projects in `rules_ll`-workspaces to leverage the remote execution setup and
share caches.
## ¨ Setup
1. Install the [nix package manager](https://nixos.org/download.html) and enable
[flakes](https://nixos.wiki/wiki/Flakes).
2. Create a `rules_ll` compatible workspace. To keep the development shell in
sync with the `rules_ll` Bazel module, pin the flake to a specific version:
```bash
git init
nix flake init -t github:eomii/rules_ll/
```
The default toolchains include C++ and HIP for AMDGPU. If you also want to
target NVPTX devices (Nvidia GPUs), make sure to read the [CUDA license](https://docs.nvidia.com/cuda/eula/index.html)
and set `unfree = true` in `flake.nix`.
See [tags](https://github.com/eomii/rules_ll/tags) to find the most recent
version.
3. Enter the `rules_ll` development shell:
```bash
nix develop
```
4. Consider setting up at least a local remote cache as described in the [remote
execution guide](https://ll.eomii.org/setup/remote_execution).
## ”— Links
- [Docs](https://ll.eomii.org)
- [Guides](https://ll.eomii.org/guides)
- [Examples](https://github.com/eomii/rules_ll/tree/main/examples)
- [Discussions](https://github.com/eomii/rules_ll/discussions)
## C++ modules
Use the `interfaces` and `exposed_interfaces` attributes to build C++ modules.
[C++ modules guide](https://ll.eomii.org/guides/modules).
```python
load(
"@rules_ll//ll:defs.bzl",
"ll_binary",
"ll_library",
)
ll_library(
name = "mymodule",
srcs = ["mymodule_impl.cpp"],
exposed_interfaces = {
"mymodule_interface.cppm": "mymodule",
},
compile_flags = ["-std=c++20"],
)
ll_binary(
name = "main",
srcs = ["main.cpp"],
deps = [":mymodule"],
)
```
## § Clang-Tidy
Build compilation databases to use Clang-Tidy as part of your workflows and CI
pipelines. [Clang-Tidy guide](https://ll.eomii.org/guides/clang_tidy).
```python
load(
"@rules_ll//ll:defs.bzl",
"ll_compilation_database",
)
filegroup(
name = "clang_tidy_config",
srcs = [".clang-tidy"],
)
ll_compilation_database(
name = "compile_commands",
targets = [
":my_very_tidy_target",
],
config = ":clang_tidy_config",
)
```
## · Sanitizers
Integrate sanitizers in your builds with the `sanitize` attribute.
[Sanitizers guide](https://ll.eomii.org/guides/sanitizers).
```python
load(
"@rules_ll//ll:defs.bzl",
"ll_binary",
)
ll_binary(
name = "sanitizer_example",
srcs = ["totally_didnt_shoot_myself_in_the_foot.cpp"],
sanitize = ["address"],
)
```
## § CUDA and HIP
Use CUDA and HIP without any manual setup. [CUDA and HIP guide](https://ll.eomii.org/guides/cuda_and_hip).
```python
load(
"@rules_ll//ll:defs.bzl",
"ll_binary",
)
ll_binary(
name = "cuda_example",
srcs = ["look_mum_no_cuda_setup.cu"],
compilation_mode = "cuda_nvptx", # Or "hip_nvptx". Or "hip_amdgpu".
compile_flags = [
"--std=c++20",
"--offload-arch=sm_70", # Your GPU model.
],
)
```
## “ License
Licensed under the Apache 2.0 License with LLVM exceptions.
This repository uses overlays and automated setups for the CUDA toolkit and HIP.
Using `compilation_mode` for heterogeneous toolchains implies acceptance of
their licenses.
近期下载者:
相关文件:
收藏者: