Hi
I'm very new to opencl. I'm trying to compile c opencl code under windows 7 without Visual Studio. I always use console.
How can i compile using only console (cmd) under windows 7. Can i use icl? I already installed gcc.
My trials with gcc are failed. I have already installed AMD APP. Can you post exact command line?
Regards.
Solved! Go to Solution.
Sorry for late reply
I found the exact line for compilation it was very simple
gcc -I "C:\Program Files (x86)\AMD APP\include" hello.c "C:\Program Files (x86)\AMD APP\lib\x86\OpenCL.lib"
It is was the mixed platforms which caused this. gcc is x86 and i was trying to link x64 libraries. Interestingly omitting -lOpenCL dont do any harm.
you must set proper include and lib path. -IC:\path\to\SDK\include -LC:\path\to\lib -lOpenCL and it should work.
whar errors are you getting?
Try nou advice, that may solve the compilation issue. icl or gcc should be fine for compilation.
I'm trying to compile the most generic hello world code.
I'm using this line
gcc -I"C:\Program Files (x86)\AMD APP\include" -L"C:\Program Files (x86)\AMD APP\lib\x86_64" -lOpenCL hello.c
I checked these paths and files are there.
But i still get "undefined reference to clGetPlatformIDs" and other cl functions' errors.
Is it possible to pass -lOpenCL argument to icl?
Have you tried using the make files in windows. You can run them with -d option to check the exact command that needs to be executed.
Sorry for late reply
I found the exact line for compilation it was very simple
gcc -I "C:\Program Files (x86)\AMD APP\include" hello.c "C:\Program Files (x86)\AMD APP\lib\x86\OpenCL.lib"
It is was the mixed platforms which caused this. gcc is x86 and i was trying to link x64 libraries. Interestingly omitting -lOpenCL dont do any harm.