Skip to content

[BUG]Incorrect usage of variable in CMakeLists.txt #146344

@x12301450

Description

@x12301450

In mlir/lib/Target/LLVM/CMakeLists.txt, the variable CUDAToolkit_LIBRARY_ROOT is used in the following way in Line 66:

set(MLIR_CUDAToolkit_ROOT ${CUDAToolkit_LIBRARY_ROOT})

and like this in Line 135:

find_file(MLIR_NVVM_LIBDEVICE_PATH libdevice.10.bc
                PATHS ${CUDAToolkit_LIBRARY_ROOT}
                PATH_SUFFIXES "nvvm/libdevice" NO_DEFAULT_PATH REQUIRED)

However, when checking whether the variable is defined, it is done in the following way in Line 62:

if(NOT DEFINED ${CUDAToolkit_LIBRARY_ROOT})

This if command doesn't take effect when CUDAToolkit_LIBRARY_ROOT simply represent a path. I think the correct way to write it should be:

if(NOT DEFINED CUDAToolkit_LIBRARY_ROOT)

Looking forward to your feedback!

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particular

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions