Skip to content

Commit

Permalink
[BUGFIX] Build target dependencies.
Browse files Browse the repository at this point in the history
- Several build targets depend on the existence of a number of .inc files which are TableGen'erated from the DaphneIR sources.
- For some of those targets, these dependencies were not explicitly specified.
  - Affected targets: DaphneCatalogParser, DaphneDSLParser, SQLParser, CompilerUtils, Util.
- These targets could not be built in isolatation so far (e.g., `./build.sh --target DaphneCatalogParser` failed due to some missing .inc files).
- This may not seem like a significant problem, since these targets are anyway not intended to be used without the rest of the system.
- However, it seems like the insufficient dependency information could lead to problematic orderings of the individual targets during a full build by cmake/ninja, where the build of a target requiring the .inc files was started before the targets generating the .inc files were started/done.
  - Most likely, this is the reason why the GitHub action (CI) of building DAPHNE failed in commit 2b4f086.
  - The problem may also be related to non-determinism caused by a multi-threaded built, as building DAPHNE at that commit worked well on my machine (same for the GitHub action executed locally).
- This commit makes the dependencies on the .inc files explicit for the targets mentioned above.
  • Loading branch information
pdamme committed May 16, 2024
1 parent 2b4f086 commit 4eb0757
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/compiler/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ add_library(CompilerUtils STATIC
target_link_libraries(CompilerUtils PUBLIC
DaphneMetaDataParser
)

# Make sure that certain .inc files have been generated by TableGen.
add_dependencies(CompilerUtils
MLIRDaphneDistributableOpInterfaceIncGen
MLIRDaphneInferFrameLabelsOpInterfaceIncGen
MLIRDaphneInferShapeOpInterfaceIncGen
MLIRDaphneInferSparsityOpInterfaceIncGen
MLIRDaphneInferTypesOpInterfaceIncGen
MLIRDaphneOpsEnumsIncGen
MLIRDaphneOpsIncGen
MLIRDaphneTransformsIncGen
MLIRDaphneVectorizableOpInterfaceIncGen
)
13 changes: 13 additions & 0 deletions src/parser/catalog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@
add_library(DaphneCatalogParser STATIC
KernelCatalogParser.cpp
)

# Make sure that certain .inc files have been generated by TableGen.
add_dependencies(CompilerUtils
MLIRDaphneDistributableOpInterfaceIncGen
MLIRDaphneInferFrameLabelsOpInterfaceIncGen
MLIRDaphneInferShapeOpInterfaceIncGen
MLIRDaphneInferSparsityOpInterfaceIncGen
MLIRDaphneInferTypesOpInterfaceIncGen
MLIRDaphneOpsEnumsIncGen
MLIRDaphneOpsIncGen
MLIRDaphneTransformsIncGen
MLIRDaphneVectorizableOpInterfaceIncGen
)
13 changes: 13 additions & 0 deletions src/parser/daphnedsl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,17 @@ target_link_libraries(DaphneDSLParser PRIVATE
CompilerUtils
DataStructures
antlr4_shared
)

# Make sure that certain .inc files have been generated by TableGen.
add_dependencies(CompilerUtils
MLIRDaphneDistributableOpInterfaceIncGen
MLIRDaphneInferFrameLabelsOpInterfaceIncGen
MLIRDaphneInferShapeOpInterfaceIncGen
MLIRDaphneInferSparsityOpInterfaceIncGen
MLIRDaphneInferTypesOpInterfaceIncGen
MLIRDaphneOpsEnumsIncGen
MLIRDaphneOpsIncGen
MLIRDaphneTransformsIncGen
MLIRDaphneVectorizableOpInterfaceIncGen
)
13 changes: 13 additions & 0 deletions src/parser/sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,16 @@ add_library(SQLParser STATIC
target_link_libraries(SQLParser PRIVATE
antlr4_shared
)

# Make sure that certain .inc files have been generated by TableGen.
add_dependencies(CompilerUtils
MLIRDaphneDistributableOpInterfaceIncGen
MLIRDaphneInferFrameLabelsOpInterfaceIncGen
MLIRDaphneInferShapeOpInterfaceIncGen
MLIRDaphneInferSparsityOpInterfaceIncGen
MLIRDaphneInferTypesOpInterfaceIncGen
MLIRDaphneOpsEnumsIncGen
MLIRDaphneOpsIncGen
MLIRDaphneTransformsIncGen
MLIRDaphneVectorizableOpInterfaceIncGen
)
13 changes: 13 additions & 0 deletions src/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@ add_library(Util
)

target_link_libraries(Util PRIVATE spdlog::spdlog)

# Make sure that certain .inc files have been generated by TableGen.
add_dependencies(Util
MLIRDaphneDistributableOpInterfaceIncGen
MLIRDaphneInferFrameLabelsOpInterfaceIncGen
MLIRDaphneInferShapeOpInterfaceIncGen
MLIRDaphneInferSparsityOpInterfaceIncGen
MLIRDaphneInferTypesOpInterfaceIncGen
MLIRDaphneOpsEnumsIncGen
MLIRDaphneOpsIncGen
MLIRDaphneTransformsIncGen
MLIRDaphneVectorizableOpInterfaceIncGen
)

0 comments on commit 4eb0757

Please sign in to comment.