Problem compiling with #pragma cl_amd_printf

jdowner
Posts: 7
Joined: Fri Jan 06, 2012 1:04 pm

Problem compiling with #pragma cl_amd_printf

Post by jdowner »

I am having trouble compiling on Ubuntu 10.10 (sort of) due to the line

#pragma OPENCL EXTENSION cl_amd_printf : enable\n

in the files,

src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC/ComputeBounds.cl
src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/SolveCollisionsAndUpdateVelocities.cl

The output error I get is,

Scanning dependencies of target BulletSoftBodySolvers_OpenCL_Mini
[ 98%] Building CXX object src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/CMakeFiles/BulletSoftBodySolvers_OpenCL_Mini.dir/__/btSoftBodySolver_OpenCL.o
In file included from /tmp/bullet-2.79/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp:98:
/tmp/bullet-2.79/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/SolveCollisionsAndUpdateVelocities.cl:4: error: stray '#' in program
In file included from /tmp/bullet-2.79/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp:98:
/tmp/bullet-2.79/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/SolveCollisionsAndUpdateVelocities.cl:4: error: expected unqualified-id before numeric constant
make[2]: *** [src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/CMakeFiles/BulletSoftBodySolvers_OpenCL_Mini.dir/__/btSoftBodySolver_OpenCL.o] Error 1
make[1]: *** [src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/MiniCL/CMakeFiles/BulletSoftBodySolvers_OpenCL_Mini.dir/all] Error 2
make: *** [all] Error 2


If I remove the pragmas above, I am able to compile and I think the demos run correctly. However, I'm not confident this is the right thing to do and I was wondering if anyone else could suggest the correct fix to the problem. I should also mention that I have experienced this problem on several computers at work, but I do not experience it on my installation at home, which is also running ubuntu 10.10. One of the differences is that when I run cmake on the machines at work I get,

INTEL OPENCL NOT FOUND
NVidia OPENCL NOT FOUND

Despite the fact that I am running on an intel processor. So I am wondering if there is an assumption that openCL is always going to be available and if not that I must be using an AMD chip???

Any thoughts?

-Josh

[edit] I should also mention that this is from the version 2.79 download.

[edit] Ok, I don't think the cmake output has anything to say about this issue after all -- I get the same result on my laptop but it has no trouble compiling v2.79 :/
kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: Problem compiling with #pragma cl_amd_printf

Post by kloplop321 »

Erwin uses an AMD system, so this might be a lack of foresight on his part.

Either way, after taking out that line, you don't seem to have any OpenCL runtime installed, or you don't have the necessary means to utilize it.