RadeonRays_SDK icon indicating copy to clipboard operation
RadeonRays_SDK copied to clipboard

OS X: Exception in `CLWProgram::CreateFromSource` about "<angled> includes"

Open ericwa opened this issue 8 years ago • 2 comments

I get this error log:

<program source>:26:10: error: '../FireRays/src/kernel/CL/common.cl' file not found with <angled> include; use "quotes" instead
#include <../FireRays/src/kernel/CL/common.cl>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         "../FireRays/src/kernel/CL/common.cl"
In file included from <program source>:26:
../FireRays/src/kernel/CL/common.cl:124:8: warning: no previous prototype for function 'transform_point'
float3 transform_point(float3 p, float4 m0, float4 m1, float4 m2, float4 m3)
       ^
../FireRays/src/kernel/CL/common.cl:133:8: warning: no previous prototype for function 'transform_vector'
float3 transform_vector(float3 p, float4 m0, float4 m1, float4 m2, float4 m3)
       ^
../FireRays/src/kernel/CL/common.cl:142:5: warning: no previous prototype for function 'transform_ray'
ray transform_ray(ray r, float4 m0, float4 m1, float4 m2, float4 m3)
    ^
../FireRays/src/kernel/CL/common.cl:152:8: warning: no previous prototype for function 'quaternion_mul'
float4 quaternion_mul(float4 q1, float4 q2)
       ^
../FireRays/src/kernel/CL/common.cl:162:8: warning: no previous prototype for function 'quaternion_conjugate'
float4 quaternion_conjugate(float4 q)
       ^
../FireRays/src/kernel/CL/common.cl:167:8: warning: no previous prototype for function 'quaternion_inverse'
float4 quaternion_inverse(float4 q)
       ^
../FireRays/src/kernel/CL/common.cl:181:6: warning: no previous prototype for function 'rotate_ray'
void rotate_ray(ray* r, float4 q)
     ^
../FireRays/src/kernel/CL/common.cl:193:5: warning: no previous prototype for function 'IntersectTriangle'
int IntersectTriangle(ray const* r, float3 v1, float3 v2, float3 v3, Intersection* isect)
    ^
../FireRays/src/kernel/CL/common.cl:217:5: warning: no previous prototype for function 'IntersectTriangleP'
int IntersectTriangleP(ray const* r, float3 v1, float3 v2, float3 v3)
    ^
../FireRays/src/kernel/CL/common.cl:239:5: warning: no previous prototype for function 'IntersectBox'
int IntersectBox(ray const* r, float3 invdir, bbox box, float maxt)
    ^
../FireRays/src/kernel/CL/common.cl:253:7: warning: no previous prototype for function 'IntersectBoxF'
float IntersectBoxF(ray const* r, float3 invdir, bbox box, float maxt)
      ^
../FireRays/src/kernel/CL/common.cl:267:5: warning: no previous prototype for function 'Ray_GetMask'
int Ray_GetMask(ray const* r)
    ^
../FireRays/src/kernel/CL/common.cl:272:5: warning: no previous prototype for function 'Ray_IsActive'
int Ray_IsActive(ray const* r)
    ^
../FireRays/src/kernel/CL/common.cl:277:7: warning: no previous prototype for function 'Ray_GetMaxT'
float Ray_GetMaxT(ray const* r)
      ^
../FireRays/src/kernel/CL/common.cl:282:7: warning: no previous prototype for function 'Ray_GetTime'
float Ray_GetTime(ray const* r)
      ^
<program source>:66:6: warning: no previous prototype for function 'IntersectLeafClosest'
bool IntersectLeafClosest(
     ^
<program source>:97:6: warning: no previous prototype for function 'IntersectLeafAny'
bool IntersectLeafAny(
     ^
<program source>:127:6: warning: no previous prototype for function 'IntersectSceneClosest'
bool IntersectSceneClosest(SceneData const* scenedata,  ray const* r, Intersection* isect)
     ^
<program source>:168:6: warning: no previous prototype for function 'IntersectSceneAny'
bool IntersectSceneAny(SceneData const* scenedata,  ray const* r)
     ^
<program source>:223:9: warning: unused variable 'global_id'
    int global_id  = get_global_id(0);
        ^
<program source>:287:9: warning: unused variable 'global_id'
    int global_id = get_global_id(0);
        ^
<program source>:345:9: warning: unused variable 'global_id'
    int global_id = get_global_id(0);
        ^
<program source>:408:9: warning: unused variable 'global_id'
    int global_id = get_global_id(0);
        ^
<program source>:465:9: warning: unused variable 'local_id'
    int local_id = get_local_id(0);
        ^
<program source>:508:9: warning: unused variable 'local_id'
    int local_id = get_local_id(0);
        ^

Changing the angled includes in bvh.cl to:

#include "../FireRays/src/kernel/CL/common.cl"

fixes the error. This is the last issue I ran in to, the program runs now :-) screen shot 2016-05-19 at 1 06 19 pm

ericwa avatar May 19 '16 19:05 ericwa

Hi ericwa,

What is your working directory? Demo app requires working directory to be SDKROOT/App

yozhijk avatar May 19 '16 19:05 yozhijk

Can you try using --embed_kernels premake option? (You'll have to revert angle brackets back to use it I guess). That's most likely due to incorrect handling of includes in Apple CL compiler.

OK, I tried:

  • reverted to angle brackets
  • ./Tools/premake/osx/premake5 xcode4 --embed_kernels
  • working directory in Xcode set to SDKROOT/App

and everything worked. Running premake again without --embed_kernels, the OpenCL compile error about angle brackets returns.

ericwa avatar May 19 '16 20:05 ericwa