I am using Nvidia GPU Computing toolkit on Windows 7 x64 with the 64 bit Cygwin package and Eclipse. (I use the internal build tools because GNU make doesn't lik colons in Windows paths.) My code:
Here's the fairly basic piece of code: #include #include using namespace std;
int main() {
cl_int error = 42;
cl_platform_id platform;
error = clGetPlatformIDs(1, &platform, NULL);
return 0;
}
C++ code both compiles and runs fine, and I can use OpenCL headers and cl_int
and cl_device_id
, but with clGetPlatformID
I get the following compile error:
relocation truncated to fit: R_X86_64_32 against symbol
'__imp_clGetPlatformIDs' defined in .idata$5 section in
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\lib
\x64/OpenCL.lib(OpenCL.dll.b)
I have tried the following:
- Uninstall/reinstall Cygwin tools
- Uninstall/reinstall both 32 and 64 bit libraries in the Nvidia GPU Computing toolkit
- Uninstall/reinstall Eclipse and checked most settings
- Avoiding 32 bit memory restrictions by adding "-mcmodel=medium" or "-mcmodel=large". (According to searches, at some point 32 and 64 bit binaries are being mixed.)
- Confirmed that I am only using 64 bit Nvidia libraries and Cygwin tools.
My guess is that the internal builder is to blame, but using it was the solution to another problem that caused the build to fail.