From 1561bef21d169dd5985be10806153ae23c1d89b2 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Wed, 13 Dec 2023 17:26:22 -0800 Subject: [PATCH] iterate --- doc/developers.md | 27 +++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/doc/developers.md b/doc/developers.md index 01e040f..9b93efe 100644 --- a/doc/developers.md +++ b/doc/developers.md @@ -7,6 +7,7 @@ - [with bazel](#build-cli-bazel) - [with cmake](#build-cli-cmake) - [with gcc](#build-cli-gcc) + - [with clang](#build-cli-clang) - [Building chromobius as a python package](#build-python) - [with bazel](#build-python-bazel) - [with cmake](#build-python-cmake) @@ -82,6 +83,32 @@ g++ \ -l pymatching ``` + +### with clang: + +```bash +# This must be run from the repository root. +# This requires that you have libstim and libpymatching installed. + +readarray -d '' CC_FILES_TO_BUILD < \ + <( \ + find src \ + | grep "\\.cc$" \ + | grep -v "\\.\(test\|perf\|pybind\)\\.cc$" \ + ) + +clang \ + -I src \ + -std=c++20 \ + -O3 \ + -march=native \ + ${CC_FILES_TO_BUILD[@]} \ + -l "stdc++" \ + -l m \ + -l stim \ + -l pymatching +``` + Then, to run the built tool: ```bash diff --git a/setup.py b/setup.py index c149712..08d79da 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ CC_FILES = glob.glob("src/**/*.cc", recursive=True) H_FILES = glob.glob("src/**/*.h", recursive=True) + glob.glob("src/**/*.inl", recursive=True) -CMAKE_FILES = ['CMakeLists.txt', *glob.glob("file_lists/**", recursive=True)] +CMAKE_FILES = ['CMakeLists.txt', *glob.glob("file_lists/*", recursive=True)] RELEVANT_SOURCE_FILES = sorted(CMAKE_FILES + CC_FILES + CMAKE_FILES)