OpenCL-ICD-Loader: won't build any more after commit "Added OpenCL Universal Driver Support for Win10 RS3"
I cross-compile this under ubuntu to run under Windows 10.
Until this commit “Added OpenCL Universal Driver Support for Win10 RS3” it used to work fine using this script:
do_git_checkout https://github.com/KhronosGroup/OpenCL-Headers.git OpenCL-Headers
cd OpenCL-Headers || exit 1
mkdir -pv "${mingw_w64_x86_64_prefix}/include/CL"
mkdir -pv "${mingw_w64_x86_64_prefix}/include/OpenCL"
cd opencl22/CL || exit 1 # nvidia is v1.2 as at 2017.05.28 but the ICD loader requires latest
cp -fv *.h "$mingw_w64_x86_64_prefix/include/CL/" || exit 1
cp -fv *.h "$mingw_w64_x86_64_prefix/include/OpenCL/" || exit 1
cd ../..
cd ..
# 2. the icd loader
do_git_checkout https://github.com/KhronosGroup/OpenCL-ICD-Loader.git OpenCL-ICD-Loader
cd OpenCL-ICD-Loader || exit 1
rm -fv "libOpenCL.dll.a"
rm -fv "$mingw_w64_x86_64_prefix/lib/libOpenCL.dll.a"
rm -fv "OpenCL.a"
rm -fv "$mingw_w64_x86_64_prefix/lib/OpenCL.a"
apply_patch https://raw.githubusercontent.com/hydra3333/ffmpeg-windows-build-helpers-withOpenCL/master/patches/0001-OpenCL-git-prefix-static.patch # "-p1"
if [ "$1" = "32" ]; then # this patch applies only to 32bit
apply_patch https://raw.githubusercontent.com/hydra3333/ffmpeg-windows-build-helpers-withOpenCL/master/patches/0001-OpenCL-icd-windows-c.patch #"-p1"
elif [ "$1" = "64" ]; then # this patch applies only to 64bit
echo "inside build_openCL_icd and bits=$1 ... no need to patch icd_windows.c "
else
echo "inside build_openCL_icd and bits=$1 which is not 32 or 64 !! Aborting."
exit 1
fi
cmake –G”Unix Makefiles” . -DENABLE_STATIC_RUNTIME=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RANLIB=${cross_prefix}ranlib -DCMAKE_C_COMPILER=${cross_prefix}gcc -DCMAKE_CXX_COMPILER=${cross_prefix}g++ -DCMAKE_RC_COMPILER=${cross_prefix}windres -DCMAKE_INSTALL_PREFIX=$mingw_w64_x86_64_prefix -DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_ROOT_PATH=$mingw_w64_x86_64_prefix || exit 1
make clean || exit 1
make -j $cpu_count || exit 1
cp -fv "OpenCL.a" "$mingw_w64_x86_64_prefix/lib/libOpenCL.dll.a" || exit 1 # brute force link success by copying to known .a filenames
cd ..
Now, using the same build script, it aborts with this error:
/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/win32/OpenCL-ICD-Loader/icd_windows_hkr.c:45:10:
fatal error: Devpkey.h: No such file or directory
#include <Devpkey.h>
^~~~~~~~~~~
compilation terminated.
cmake –G”Unix Makefiles” . -DENABLE_STATIC_RUNTIME=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RANLIB=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-ranlib -DCMAKE_C_COMPILER=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-g++ -DCMAKE_RC_COMPILER=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-windres -DCMAKE_INSTALL_PREFIX=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32 -DBUILD_SHARED_LIBS=OFF -DCMAKE_FIND_ROOT_PATH=/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32
-- The C compiler identification is GNU 7.2.0
-- The CXX compiler identification is GNU 7.2.0
-- Check for working C compiler: /home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
ENABLE_STATIC_RUNTIME
-- Build files have been written to: /home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/win32/OpenCL-ICD-Loader
make clean
make -j 2
Scanning dependencies of target IcdLog
Scanning dependencies of target OpenCL
[ 3%] Building C object test/platform/CMakeFiles/IcdLog.dir/icd_test_log.c.obj
[ 7%] Building C object CMakeFiles/OpenCL.dir/icd.c.obj
[ 11%] Linking C shared library ../../bin/libIcdLog.dll
[ 11%] Built target IcdLog
Scanning dependencies of target OpenCLDriverStub
[ 15%] Building C object test/driver_stub/CMakeFiles/OpenCLDriverStub.dir/cl.c.obj
[ 19%] Building C object test/driver_stub/CMakeFiles/OpenCLDriverStub.dir/cl_ext.c.obj
[ 23%] Building C object test/driver_stub/CMakeFiles/OpenCLDriverStub.dir/cl_gl.c.obj
[ 26%] Building C object test/driver_stub/CMakeFiles/OpenCLDriverStub.dir/icd.c.obj
[ 30%] Linking C shared library ../../bin/libOpenCLDriverStub.dll
Warning: resolving _clGetExtensionFunctionAddress by linking to _clGetExtensionFunctionAddress@4
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _clIcdGetPlatformIDsKHR by linking to _clIcdGetPlatformIDsKHR@12
[ 30%] Built target OpenCLDriverStub
[ 34%] Building C object CMakeFiles/OpenCL.dir/icd_dispatch.c.obj
[ 38%] Building C object CMakeFiles/OpenCL.dir/icd_windows.c.obj
[ 42%] Building C object CMakeFiles/OpenCL.dir/icd_windows_hkr.c.obj
/home/u/Desktop/ffmpeg-windows-build-helpers-withOpenCL-master/sandbox/win32/OpenCL-ICD-Loader/icd_windows_hkr.c:45:10:
fatal error: Devpkey.h: No such file or directory
#include <Devpkey.h>
^~~~~~~~~~~
compilation terminated.
CMakeFiles/OpenCL.dir/build.make:138: recipe for target 'CMakeFiles/OpenCL.dir/icd_windows_hkr.c.obj' failed
make[2]: *** [CMakeFiles/OpenCL.dir/icd_windows_hkr.c.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/OpenCL.dir/all' failed
make[1]: *** [CMakeFiles/OpenCL.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (7 by maintainers)
@kepatil @hydra3333 I’ll prepare a patch that attempts to fix that and update soon.
I tried this (watch out for the case-sensitive devpkey.h header, lower-case ‘d’, in mingw-w64), but a number of DEFINE_… are missing from mingw-w64. There should be time to experiment with trying them later this week.