I am attempting to compile and link a C/C++ OpenCL application in CLion on Windows using the NVIDIA OpenCL library provided in the NVIDIA CUDA 7.5 SDK.
My issue is that CLion is using CMake and the Cygwin GCC compiler to create code in Windows. Therefore, there is some confusion about whether I should use the .lib, the .a, the .dll, or the .o files during runtime.
There is an indication is that I may be able to export definitions from OpenCl.dll
and create opencl.a
to import and potentially run against OpenCl.dll
. Cygwin has this guide for using nm
for linking against DLL's. They indicate that we may do
echo EXPORTS > foo.def
nm foo.dll | grep ' T _' | sed 's/.* T _//' >> foo.def
dlltool --def foo.def --dllname foo.dll --output-lib foo.a
will create work. This post contains instructions on how to complete the task with MinGW and also uses dlltool.
However, as the cygwin guide warns, the running nm OpenCl.dll
from the OpenCl.dll in the NVIDIA CUDA SDK results in nm: OpenCl.dll: no symbols
indicating that the DLL has been stripped or some error has occurred.
I am working with the CUDA 7.5 SDK but suspect the issues will be similar across the board.
Has anyone successfully built and linked in CLion for Windows, or from Cygwin in a Windows Environment?