Karl Rupp committed 56f911c

Fixed detection of OpenCL on Mac OS.

OpenCL-headers reside in CL/ on all systems except Mac OS, where they reside in OpenCL/
The dispatch is commonly handled correctly by libraries, yet the correct header also needs to be passed to BuildSystem.

  • Participants
  • Parent commits 824c3e1

Comments (0)

Files changed (1)

File config/PETSc/packages/

 import PETSc.package
-import os
+import sys
 class Configure(PETSc.package.NewPackage):
   def __init__(self, framework):
     PETSc.package.NewPackage.__init__(self, framework)
     self.functions        = ['clGetPlatformIDs']
-    self.includes         = ['CL/cl.h']    # Apple might require special care (OpenCL/cl.h)
+    if sys.platform.startswith('darwin'): # Apple requires special care (OpenCL/cl.h)
+      self.includes         = ['OpenCL/cl.h']
+    else:
+      self.includes         = ['CL/cl.h']
     self.liblist          = [['libOpenCL.a', '-framework opencl'], ['libOpenCL.lib']]
     self.double           = 0   # 1 means requires double precision
     self.cxx              = 0