Skip to content

Commit

Permalink
Try to install clang-format-17 via pip rather than the llvm installer
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Oct 18, 2023
1 parent df54144 commit 2c35c2c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
8 changes: 8 additions & 0 deletions features/src/cccl-dev/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,24 @@ fi

check_packages ${PKG[@]} ${PKG_TO_REMOVE[@]};

CC=gcc CXX=g++ python -m pip install --upgrade pip
CC=gcc CXX=g++ python -m pip install wheel setuptools;
CC=gcc CXX=g++ python -m pip install psutil $LIT_VERSION_TO_INSTALL;
CC=gcc CXX=g++ python -m pip install clang-format==17.*;

export LIT_VERSION="$(lit --version | grep -o -e '[0-9].*')";

# there must be a cleaner way, but it works
export CLANG_FORMAT_PATH="$(pip show clang-format | grep "^Location: " | awk '{print $2}')/clang-format";

# export envvars in bashrc files
append_to_etc_bashrc "$(cat .bashrc | envsubst '$LIT_VERSION')";
append_to_etc_bashrc "$(cat .bashrc | envsubst '$CLANG_FORMAT_PATH')";
append_to_all_bashrcs "$(cat .bashrc | envsubst '$LIT_VERSION')";
append_to_all_bashrcs "$(cat .bashrc | envsubst '$CLANG_FORMAT_PATH')";
# export envvars in /etc/profile.d
add_etc_profile_d_script cccl-dev "$(cat .bashrc | envsubst '$LIT_VERSION')";
add_etc_profile_d_script cccl-dev "$(cat .bashrc | envsubst '$CLANG_FORMAT_PATH')";

# Clean up
# rm -rf /tmp/*;
Expand Down
53 changes: 26 additions & 27 deletions matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ x-mambaforge: &conda { name: "mambaforge" }

x-python: &python { name: "ghcr.io/devcontainers/features/python:1", version: "os-provided", installTools: "false", hide: true }
x-cccl_dev: &cccl_dev { name: "cccl-dev", hide: true }
x-cccl-clang-format: &cccl_clang_format {name: "llvm", version: "17", packages: "clang-format", hide: true}

# CCCL only needs a subset of the full CTK:
x-cccl-cuda-opts: &cccl_cuda_opts {
Expand All @@ -53,38 +52,38 @@ include:

- os: "ubuntu:18.04"
images:
- {features: [*gcc_6, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*gcc_7, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*gcc_8, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*gcc_9, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*llvm_9, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*oneapi_2022, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *onapi_env}
- {features: [*gcc_6, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*gcc_7, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*gcc_8, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*gcc_9, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*llvm_9, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*oneapi_2022, {<<: *cuda_prev_min, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *onapi_env}

- os: "ubuntu:20.04"
images:
- {features: [*gcc_7, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*gcc_8, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*gcc_9, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*gcc_10, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*llvm_9, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*llvm_10, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*llvm_11, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*llvm_12, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*llvm_13, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*llvm_14, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*oneapi_2022, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *onapi_env}
- {features: [*gcc_7, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*gcc_8, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*gcc_9, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*gcc_10, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*llvm_9, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*llvm_10, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*llvm_11, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*llvm_12, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*llvm_13, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*llvm_14, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*oneapi_2022, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *onapi_env}

- os: "ubuntu:22.04"
images:
- {features: [*nvhpc_prev, *python, *cccl_clang_format, *cccl_dev], env: *nvhpc_env}
- {features: [*nvhpc_curr, *python, *cccl_clang_format, *cccl_dev], env: *nvhpc_env}
- {features: [*gcc_11, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*gcc_12, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*gcc_13, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *gcc_env}
- {features: [*llvm_15, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*llvm_prev, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*llvm_curr, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *llvm_env}
- {features: [*oneapi_2022, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_clang_format, *cccl_dev], env: *onapi_env}
- {features: [*nvhpc_prev, *python, *cccl_dev], env: *nvhpc_env}
- {features: [*nvhpc_curr, *python, *cccl_dev], env: *nvhpc_env}
- {features: [*gcc_11, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*gcc_12, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*gcc_13, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *gcc_env}
- {features: [*llvm_15, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*llvm_prev, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*llvm_curr, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *llvm_env}
- {features: [*oneapi_2022, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *python, *cccl_dev], env: *onapi_env}
# llvm-cuda-nvhpc (needed by stdexec devcontainers)
- {features: [*llvm_curr, {<<: *cuda_curr_max, <<: *cccl_cuda_opts}, *nvhpc_curr, *python]}

Expand Down

0 comments on commit 2c35c2c

Please sign in to comment.