Is it possible to compile OpenCL using Mingw and Nvidia SDK?
I'm aware that its not officially supported but that just doesn't make sense. Aren't the libraries provided as a statically linked libraries? I mean once compiled with whatever compiler that may be, and linked successfully, whats should be the problem?
I managed to compile and successfully link my code to OpenCL libraries provided with Nvidia's SDK, however the executable throws Segmentation Fault at clGetPlatformIDs
which is the first OpenCL call in my code.
Here is my compilation command
x86_64-w64-mingw32-g++ -std=c++11 File.cpp \
-L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\lib\x64" \
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" \
-gcoff -lOpenCL -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 \
-lshell32 -lole32 -loleaut32 \
-luuid -lodbc32 -lodbccp32 -luser32 -lgdi32 -lmingwex -m64 \
-DWIN32 -D_DEBUG -D_CONSOLE
Note that these libraries were taken from the .sln file of the sample OpenCL code.
I tried various combinations of these libraries and nothing seems to work.
Also is there a way to compile using Mingw and link using something else? I'm not sure what the something else might be.