Skip to content

Clarify SPIRV Translator dependency and remove custom SPIRV_TRANSLATOR_DIR #48

Open
@dvrogozh

Description

@dvrogozh

We touched these 2 topics in #45 (comment).

  1. SPIRV Translator is embedded into LLVM or not?

The default path of common_clang build assumes that https://github.com/KhronosGroup/SPIRV-LLVM-Translator/ will be built and packaged within LLVM build which could result either in separate static library named libLLVMSPIRVLib.a or in a unified LLVM shared library which will include translator library inside.

However, it seems that distributions may incline to build SPIRV Translator as a separate package rather than within LLVM. For example: https://repology.org/project/spirv-llvm-translator/versions - that's what Debian and Ubuntu does.

I would like to use this Issue to collect community feedback on this. @tjaalton, please, comment.

  1. How to detect SPIRV Translator on the system?

As of now common_clang already has a path to assure that it works with SPIRV translator as a separate package on the system. If I understand correctly, for that we need to specify 2 options:
-DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=/path/to/installed/spirv/translator

While 1st option seems reasonable (though we may wish to consider changing the default after feedback on the 1st question), then 2nd option seems excessive. SPIRV translator provides lib/pkgconfig/LLVMSPIRVLib.pc, thus we can use standard mechanism to detect it on the system rather than introduce custom SPIRV_TRANSLATOR_DIR. Can this change be introduced?

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