Putting a space in path supplied to clBuildProgram()


I am trying to use #include within a kernel. And despite what I originally read on many internet pages it does work. But now I am having trouble with the locations searched for the included header files. I use the options of clBuildProgram() to pass “-I /PATH_TO_FILES/” which works for paths with no spaces, but it doesn’t work for a path with a space in it.

Does anybody know how to include spaces in this path?
-I have tried using “” around the path (correctly escaped using ) This doesn’t work, even for paths without spaces.

Does anyone know where a relative path would use as it’s basis (./) ?
-I’ve already tested and it’s not the directory containing the host program and kernel file.

For what it’s worth, I’m using MacOS. But obviously I’m hoping any solution is OS independent.

Thank you,

I’ve never used the -I parameter; I do << #include “/PATH_TO_FILES/headerfile.h” >> in the .cl under OSX, which might work with spaces

I’m feeling a little stupid for not having thought of that! :wink:

Thank you

Well, super cool! It feels good to be useful once in a while!

For my part, I felt stupid when I found out about the -I option. It hadn’t occurred to me at all; I just blindly tried putting the path in the #include statement, discovered that it worked, felt relieved, and went on to the next problem, of which there were many