Repository navigation
Unable to include a directory located in macOS Documents in program build options #526
Unanswered
dhellfeld
asked this question in
Troubleshooting
Replies: 1 comment 1 reply
|
I suspect this is a behavior of the Apple OpenCL implementation and not something PyOpenCL can control. AFAICT, Apple has some systemwide "compilation server" process for CL, and they may have changed security settings around that server so that it's no longer able to access header code in those locations.
That's not a good comparison. Instead, use a C program like this to try and compile kernel source code that includes the header. I suspect you'll see the same behavior. Moving to Troubleshooting discussion. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have a set of header files that define some inline functions that I use in several CL kernels. In the past I have been able to successfully include and retrieve these header files by supplying a compiler flag (namely
-I /path/to/headers) to the program build (using theoptionskwarg). At some point after updating macOS (think this may have started on Catalina, I am now on Big Sur), I am no longer able to include the headers if they are in the macOS "Documents", "Desktop", or "Downloads" folders or in an external drive. If I move the headers somewhere else (say~/) and update the-Iflag, everything works. It's just something about these specific places it seems. I believe Apple has started controlling access to these folders, but what is interesting is that if I compile an example OpenCL program from the command line (clang -framework OpenCL -I /Users/username/Documents/include test.c, wheretest.chas an#include <test.h>andtest.hlives in /Users/username/Documents/include ), it works fine.MWE to reproduce the behavior:
conda create -y -n pyopencl-test python=3.8 && conda activate pyopencl-test)pip install pyopencltest.py(see below) and replace "username" in the build optionstest.h(see below) and place in "/Users/username/Documents/include" with appropriate "username"python test.py(should fail)test.hto "/Users/username/include" and update the build options intest.pyaccordingly.python test.py(should succeed)test.py(augmented from documentation example):test.h:Expected behavior
Program should find
test.hand use thea_plus_bfunction in the kernel. After step 5 above the build fails, claiming that it cannot findtest.h. Once it is moved out of "Documents" and rerun (step 7) it works.Output after step 5:

Output after step 7:

Environment
<pyopencl.Device 'Intel(R) Xeon(R) W-2170B CPU @ 2.50GHz' on 'Apple' at 0xffffffff><pyopencl.Device 'AMD Radeon Pro Vega 64X Compute Engine' on 'Apple' at 0x1021d00>All reactions