Skip to content

MLIRLLVMIRTransforms build failure #125317

@RoboTux

Description

@RoboTux

lib/libMLIRLLVMIRTransforms.a fails to build from scratch with the following error:
In file included from llvm/include/llvm/Frontend/OpenMP/OMPConstants.h:19,
from llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h:19,
from mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h:26,
from mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h:24,
from mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp:17:
llvm/include/llvm/Frontend/OpenMP/OMP.h:16:10:
fatal error: llvm/Frontend/OpenMP/OMP.h.inc: No such file or directory

I believe this issue has been exposed by 8d306cc (@wsmoses ) which added an include of mlir/Dialect/LLVMIR/NVVMDialect.h
in mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp

I tried adding a dependency on MLIRTargetLLVMIRExport but it then causes a dependency cycle due to MLIRTargetLLVMIRExport linking against MLIRLLVMIRTransforms. This cycle does not exist in the bazel build despite NVVMDialect linking against ToLLVMIRTranslation because ToLLVMIRTranslation depends on LLVMIRTransformsLegalizeForExport instead of the whole LLVMIRTransforms. Perhaps a similar approach can be taken in CMake? Any thought @Dinistro ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions