Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkgs/by-name/op/openvino/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ stdenv.mkDerivation rec {
];

postPatch = ''
substituteInPlace src/plugins/intel_cpu/thirdparty/ComputeLibrary/SConstruct \
--replace-fail 'toolchain_prefix + "ar"' '"${stdenv.cc.cc}/bin/gcc-ar"' \
--replace-fail 'toolchain_prefix + "ranlib"' '"${stdenv.cc.cc}/bin/gcc-ranlib"'
Comment on lines +97 to +98
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will definitely not work with clang 😅 Can we use the generic ar and ranlib instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the GNU toolchain does not install the LTO plugin, so using the prefixed tools is required to understand LTO objects and generate a working static library. See also for example #188544 #384599. A git grep -w gcc-ar shows several packages doing the same thing. I suppose the right thing to do is gate the patch behind stdenv.cc.isGNU? (LLVM+binutils would need to use llvm-ar if that is a supported combination.)

Copy link
Contributor

@izelnakri izelnakri Aug 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smaeul does this have any consequences for the x86 environments? Seems like this should be rather a fix that needs to happen on openvino repository side. Is there an Issue thread? Let me know if I'm wrong, thats been my first thoughts ;)


mkdir -p temp/tbbbind_${tbbbind_version}
pushd temp/tbbbind_${tbbbind_version}
bsdtar -xf ${tbbbind}
Expand Down Expand Up @@ -120,7 +124,7 @@ stdenv.mkDerivation rec {
(cmakeBool "ENABLE_SAMPLES" false)

# features
(cmakeBool "ENABLE_INTEL_CPU" stdenv.hostPlatform.isx86_64)
(cmakeBool "ENABLE_INTEL_CPU" true)
(cmakeBool "ENABLE_INTEL_GPU" true)
(cmakeBool "ENABLE_INTEL_NPU" stdenv.hostPlatform.isx86_64)
(cmakeBool "ENABLE_JS" false)
Expand Down
Loading