intel / compute-runtime

Intel® Graphics Compute Runtime for oneAPI Level Zero and OpenCL™ Driver
MIT License
1.15k stars 234 forks source link

ocloc (without suffix) missing from compute-runtime builds #768

Open ph0b opened 1 month ago

ph0b commented 1 month ago

Since https://github.com/intel/compute-runtime/commit/bbe11205e3605d9d4e53dfe9d1a2f8857f294d42, there are only suffixed versions of ocloc being built.

Some distribution package specific code calls update-alternatives at install time to then symlink a version of ocloc: https://github.com/intel/compute-runtime/blob/b6038de550f3b7a411217ae6d4b4d8360d03d3a8/scripts/packaging/opencl/sles_15/SPECS/opencl.spec#L118 so on such distributions, after installing built packages, calling "ocloc" works.

However:

  1. compute-runtime can't be compiled and used in-place (by toolchains like DPC++ that call ocloc on path) unless locally installed with a package manager. With Blender I had to patch it out: https://projects.blender.org/blender/blender/src/branch/blender-v4.3-release/build_files/build_environment/patches/ocloc.diff
  2. not all distributions support such model with update-alternatives - as an example, archlinux doesn't.

Will there be a new ocloc entry point able to use both new and legacy ocloc at the same time? Until then, can you support building a binary called ocloc without suffix, or an ocloc symlink to the version that supports current platforms being built?

Ideally this should be the default, and the update-alternatives method could be enabled behind a CMake flag instead.

svenstaro commented 1 month ago

As a point of reference, this is me adding a manual symlink on Arch Linux.