Skip to content

Commit 03cfe73

Browse files
joeycartermlxd
andauthored
Fix build system due to clash with new dialects docs build (#1979)
**Context:** Some of our build commands, such as `make dialects`, were failing since adding the build directives for our dialect documentation in #1959. The cause of the issue was a new CMake variable `CATALYST_DOCS_ONLY` that was clashing with the build system for other targets. **Description of the Change:** Build the dialect documentation in a directory separate from the `build` directory used by the main dialect build targets. This new directory is called `build-docs`. --------- Co-authored-by: Lee James O'Riordan <[email protected]>
1 parent a0622ac commit 03cfe73

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ frontend/catalyst/include
2727
# Documentation
2828
doc/_build
2929
doc/code/api
30+
mlir/build-docs
3031
.ipynb*
3132

3233
# Development

mlir/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ COMPILER_LAUNCHER ?= $(shell which ccache)
66
MK_ABSPATH := $(abspath $(lastword $(MAKEFILE_LIST)))
77
MK_DIR := $(dir $(MK_ABSPATH))
88
DIALECTS_BUILD_DIR ?= $(MK_DIR)/build
9+
DIALECTS_DOCS_BUILD_DIR ?= $(MK_DIR)/build-docs
910
LLVM_BUILD_DIR ?= $(MK_DIR)/llvm-project/build
1011
MHLO_BUILD_DIR ?= $(MK_DIR)/mlir-hlo/bazel-build
1112
ENZYME_BUILD_DIR ?= $(MK_DIR)/Enzyme/build
@@ -201,8 +202,8 @@ dialects:
201202
.PHONY: dialect-docs
202203
dialect-docs:
203204

204-
@echo "build quantum-lsp and dialects"
205-
cmake -G Ninja -S . -B $(DIALECTS_BUILD_DIR) \
205+
@echo "build dialect documentation"
206+
cmake -G Ninja -S . -B $(DIALECTS_DOCS_BUILD_DIR) \
206207
-DLLVM_ENABLE_ASSERTIONS=ON \
207208
-DQUANTUM_ENABLE_BINDINGS_PYTHON=ON \
208209
-DPython3_EXECUTABLE=$(PYTHON) \
@@ -214,14 +215,14 @@ dialect-docs:
214215
-DMLIR_LIB_DIR=$(LLVM_BUILD_DIR)/lib \
215216
-DCATALYST_DOCS_ONLY=ON
216217

217-
cmake --build $(DIALECTS_BUILD_DIR) --target mlir-doc
218+
cmake --build $(DIALECTS_DOCS_BUILD_DIR) --target mlir-doc
218219

219220
.PHONY: test
220221
test:
221222
@echo "test the Catalyst MLIR dialects test suite"
222223
cmake --build $(DIALECTS_BUILD_DIR) --target check-dialects
223224

224-
.PHONY: clean clean-dialects clean-enzyme clean-mhlo clean-plugin
225+
.PHONY: clean clean-dialects clean-enzyme clean-mhlo clean-plugin clean-dialect-docs
225226
clean: clean-dialects clean-llvm clean-mhlo clean-enzyme clean-plugin
226227

227228
clean-dialects:
@@ -254,7 +255,7 @@ clean-plugin:
254255

255256
clean-dialect-docs:
256257
@echo "clean dialect docs"
257-
rm -rf $(DIALECTS_BUILD_DIR)/docs
258+
rm -rf $(DIALECTS_DOCS_BUILD_DIR)/docs
258259

259260
.PHONY: format
260261
format:

0 commit comments

Comments
 (0)