Skip to content
Prev 11737 / 12125 Next

[R-pkg-devel] CL/cl.hpp file not found

Thanks! It seems that the headers can be easily shipped without much 
effort inside the inst/include/CL/, working at least for both Debian and 
Windows for now. (Updates available on 
https://github.com/Quirinms/GeneralizedUmatrixGPU/tree/main)

However, there comes another problem afterwards with a dynamic 
library/shared object (Win/Debian).

After finding the headers, following message appeared:

D:\rtools45\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -lOpenCL: No such file or directory

similar in Debian:

Error: package or namespace load failed for ?GeneralizedUmatrixGPU? in library.dynam(lib, package, package.lib):
  shared object ?GeneralizedUmatrixGPU.so? not found


For?Windows there is more output using -lOpenCL --verbose:

g++ -std=gnu++17 -shared -s -static-libgcc -o GeneralizedUmatrixGPU.dll tmp.def RcppExports.o trainSESOM.o -Ld:/RCompile/CRANpkg/extralibs/OpenCL/lib/x64/ -lOpenCL --verbose -Ld:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64 -Ld:/rtools45/x86_64-w64-mingw32.static.posix/lib -LD:/RCompile/recent/R/bin/x64 -lR
Using built-in specs.
COLLECT_GCC=D:\rtools45\x86_64-w64-mingw32.static.posix\bin\g++.exe
COLLECT_LTO_WRAPPER=D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../libexec/gcc/x86_64-w64-mingw32.static.posix/14.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32.static.posix
Configured with: /root/mxe/tmp-gcc-host-x86_64-w64-mingw32.static.posix/gcc-14.2.0/configure --host=x86_64-w64-mingw32.static.posix --target=x86_64-w64-mingw32.static.posix --build=x86_64-pc-linux-gnu --prefix=/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix --with-native-system-header-dir=/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix/include --enable-languages=c,c++,objc,fortran --enable-version-specific-runtime-libs --with-gcc --with-gnu-ld --with-gnu-as --disable-nls --without-libiconv-prefix --disable-shared --disable-multilib --without-x --disable-win32-registry --enable-threads=posix --enable-libgomp --with-gmp=/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix --with-isl=/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix --with-mpc=/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix --with-mpfr=/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix --enable-libstdcxx-time target_configargs=XCFLAGS=-Wno-format ac_cv_header_sys_mman_h=no
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (GCC)
COMPILER_PATH=D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../libexec/gcc/x86_64-w64-mingw32.static.posix/14.2.0/;D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../libexec/gcc/
LIBRARY_PATH=D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/;D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/;D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/../../../../lib/;D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/../../../
COLLECT_GCC_OPTIONS='-std=gnu++17' '-shared' '-s' '-static-libgcc' '-o' 'GeneralizedUmatrixGPU.dll' '-Ld:/RCompile/CRANpkg/extralibs/OpenCL/lib/x64/' '-v' '-Ld:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64' '-Ld:/rtools45/x86_64-w64-mingw32.static.posix/lib' '-LD:/RCompile/recent/R/bin/x64' '-mtune=generic' '-march=x86-64' '-dumpdir' 'GeneralizedUmatrixGPU.dll.'
  D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../libexec/gcc/x86_64-w64-mingw32.static.posix/14.2.0/collect2.exe -plugin D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../libexec/gcc/x86_64-w64-mingw32.static.posix/14.2.0/liblto_plugin.dll -plugin-opt=D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../libexec/gcc/x86_64-w64-mingw32.static.posix/14.2.0/lto-wrapper.exe -plugin-opt=-fresolution=D:\temp\2025_08_29_11_20_18_14976\cc2Dbamn.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m i386pep --shared -Bdynamic -e DllMainCRTStartup --enable-auto-image-base -o GeneralizedUmatrixGPU.dll -s D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/../../../../lib/dllcrt2.o D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/crtbegin.o -Ld:/RCompile/CRANpkg/extralibs/OpenCL/lib/x64/ -Ld:/rtools45/x86_64-w64-mingw32.static.posix/lib/x64 -Ld:/rtools45/x86_64-w64-mingw32.static.posix/lib -LD:/RCompile/recent/R/bin/x64 -LD:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0 -LD:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc -LD:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/../../../../lib -LD:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/../../.. tmp.def RcppExports.o trainSESOM.o -lOpenCL -lR -lstdc++ -lmingw32 -lgcc -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lmingwex -lmsvcrt -lkernel32 D:/rtools45/x86_64-w64-mingw32.static.posix/bin/../lib/gcc/x86_64-w64-mingw32.static.posix/14.2.0/crtend.o
D:\rtools45\x86_64-w64-mingw32.static.posix\bin/ld.exe: cannot find -lOpenCL: No such file or directory
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'GeneralizedUmatrixGPU'



Am 28.08.2025 um 15:31 schrieb Dirk Eddelbuettel: