title: pyopencl.RuntimeError: clBuildProgram failed: invalid build options
body: <p>I am new to OpenCL and have some problems with setting up a OpenCL program. To illustrate my problem please look at the code (taken from <a href="https://github.com/benshope/PyOpenCL-Tutorial" rel="nofollow">https://github.com/benshope/PyOpenCL-Tutorial</a>):</p>
  
  <pre><code># Use OpenCL To Add Two Random Arrays (This Way Hides Details)
  
  import pyopencl as cl  # Import the OpenCL GPU computing API
  import pyopencl.array as pycl_array  # Import PyOpenCL Array (a Numpy array plus an OpenCL buffer object)
  import numpy as np  # Import Numpy number tools
  
  context = cl.create_some_context()  # Initialize the Context
  queue = cl.CommandQueue(context)  # Instantiate a Queue
  
  a = pycl_array.to_device(queue, np.random.rand(50000).astype(np.float32))
  b = pycl_array.to_device(queue, np.random.rand(50000).astype(np.float32))  
  # Create two random pyopencl arrays
  c = pycl_array.empty_like(a)  # Create an empty pyopencl destination array
  
  program = cl.Program(context, """
  __kernel void sum(__global const float *a, __global const float *b, __global float *c)
  {
    int i = get_global_id(0);
    c[i] = a[i] + b[i];
  }""").build()  # Create the OpenCL program
  
  program.sum(queue, a.shape, None, a.data, b.data, c.data)  # Enqueue the program for execution and store the result in c
  
  print("a: {}".format(a))
  print("b: {}".format(b))
  print("c: {}".format(c))  
  # Print all three arrays, to show sum() worked
  </code></pre>
  
  <p>If I execute the script I get the following error:</p>
  
  <pre><code>"C:\Program Files\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\python.exe" D:/python/openCL/020_array_sum.py
  Traceback (most recent call last):
     File "D:/python/openCL/020_array_sum.py", line 20, in &lt;module&gt;
  }""").build() # Create the OpenCL program
     File "C:\Program Files\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\lib\site-packages\pyopencl\__init__.py", line 166, in build
  options=options, source=self._source)
     File "C:\Program Files\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\lib\site-packages\pyopencl\__init__.py", line 206, in _build_and_catch_errors
       raise err
  pyopencl.RuntimeError: clBuildProgram failed: invalid build options - 
  
  
  (options: -I c:\program files\winpython-64bit-2.7.6.3\python-2.7.6.amd64\lib\site-packages\pyopencl\cl)
  (source saved as c:\appdata\local\temp\tmp0bj_ij.cl)
  </code></pre>
  
  <p>Process finished with exit code 1</p>
  
  <p>As far as I understood it, this is caused by the <code>build()</code> function, but I do not understand why. In one forum they suggested to define the kernel with only one <code>"</code> instead of <code>"""</code>. This also did not help.</p>
  
  <p>I use <code>WinPython-64bit-2.7.6.3</code> and <code>pycharm-community-3.1.1</code>. For the openCL i have installed: <code>AMD-APP-SDK-v2.9-Windows-641</code>, <code>Mako-0.9.1.win-amd64-py2.7</code>, <code>pytools-2014.1.2.win-amd64-py2.7</code> and <code>pyopencl-2013.2.win-amd64-py2.7</code>.</p>
  
  <p>My graphics card is a Radeon HD 7850 and I have a AMD PhenomII processor.</p>
  
  <p>P.S.: When I compile in Spyder, the error message reads:</p>
  
  <pre><code>&gt;&gt;&gt; runfile('D:/python/openCL/020_array_sum.py', wdir=r'D:/python/openCL')
  Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "C:\Program Files\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 540, in runfile
  execfile(filename, namespace)
  File "D:/python/openCL/020_array_sum.py", line 20, in &lt;module&gt;
  }""").build() # Create the OpenCL program
  File "C:\Program Files\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\lib\site-packages\pyopencl\__init__.py", line 166, in build
  options=options, source=self._source)
  File "C:\Program Files\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\lib\site-packages\pyopencl\__init__.py", line 206, in _build_and_catch_errors
  raise err
  pyopencl.RuntimeError: clBuildProgram failed: invalid build options - 
  
  
  (options: -I c:\program files\winpython-64bit-2.7.6.3\python-2.7.6.amd64\lib\site-packages\pyopencl\cl)
  (source saved as c:\users\andreas\appdata\local\temp\tmpzrgacv.cl)
  </code></pre>
  
  <p>Edit: I have now also tested it on another PC: same error. It also has an Nvidia graphics card. What both have in commen, is that they are only specified with OpenCL 1.1. Could it be, that I need OpenCL 1.2?</p>