From 960936b5c4eabc7633e13b36c09883a57de3a56a Mon Sep 17 00:00:00 2001 From: Ryan Volz Date: Fri, 21 Apr 2023 12:10:01 -0400 Subject: [PATCH] Add patch to create versioned DLL on Windows. Downstream packages newly built against this package will now search for the versioned DLL at runtime, eliminating an issue where non-conda OpenCL.dll (e.g. NVIDIA's own ICD loader) would interfere with the conda-packaged DLL because it has a higher priority on the PATH. --- ...-DLL-on-Windows-OpenCL-1.dll-instead.patch | 26 +++++++++++++++++++ recipe/meta.yaml | 4 ++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 recipe/0001-Create-versioned-DLL-on-Windows-OpenCL-1.dll-instead.patch diff --git a/recipe/0001-Create-versioned-DLL-on-Windows-OpenCL-1.dll-instead.patch b/recipe/0001-Create-versioned-DLL-on-Windows-OpenCL-1.dll-instead.patch new file mode 100644 index 0000000..32d33c9 --- /dev/null +++ b/recipe/0001-Create-versioned-DLL-on-Windows-OpenCL-1.dll-instead.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ryan Volz +Date: Fri, 21 Apr 2023 11:52:29 -0400 +Subject: [PATCH] Create versioned DLL on Windows, OpenCL-1.dll instead of + OpenCL.dll. + +--- + CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 567ceee..c834205 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -124,6 +124,8 @@ set_target_properties (OpenCL PROPERTIES VERSION "1.2" SOVERSION "1") + if (WIN32) + target_link_libraries (OpenCL PRIVATE cfgmgr32.lib runtimeobject.lib) + ++ set_target_properties (OpenCL PROPERTIES RUNTIME_OUTPUT_NAME "OpenCL-${PROJECT_VERSION_MAJOR}") ++ + # Generate a DLL without a "lib" prefix for mingw. + if (MINGW OR MSYS OR CYGWIN) + set_target_properties(OpenCL PROPERTIES PREFIX "") +-- +2.40.0 + diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 731f4b3..e8bfb92 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -9,6 +9,7 @@ source: sha256: 53d33bf629f145e7fded56d7fd9dde3aa85f9e0573171d777464e092f04bbf31 patches: - no_check_integrity_win.patch + - 0001-Create-versioned-DLL-on-Windows-OpenCL-1.dll-instead.patch - url: https://github.com/KhronosGroup/OpenCL-Headers/archive/v{{ version }}.zip sha256: 68dc80a943fdfc760abc15d36ff301e54ebb326e643169ec63c459827b4fbb4d @@ -37,7 +38,8 @@ requirements: test: commands: - if not exist %LIBRARY_INC%\\CL\\cl.h exit 1 # [win] - - if not exist %LIBRARY_BIN%\\OpenCL.dll exit 1 # [win] + - if not exist %LIBRARY_BIN%\\OpenCL-1.dll exit 1 # [win] + - if not exist %LIBRARY_LIB%\\OpenCL.lib exit 1 # [win] - test -f $PREFIX/include/OpenCL/cl.h # [osx] - test -f $PREFIX/include/CL/cl.h # [linux] - test -f $PREFIX/lib/libOpenCL${SHLIB_EXT} # [unix]