[MacPorts] #74263: pyopencl in python 3.11 crashes at initialization

MacPorts noreply at macports.org
Thu Jul 30 10:56:12 UTC 2026


#74263: pyopencl in python 3.11 crashes at initialization
-----------------------------+----------------------
  Reporter:  lpagani91       |      Owner:  petrrr
      Type:  defect          |     Status:  assigned
  Priority:  Normal          |  Milestone:
 Component:  ports           |    Version:  2.12.5
Resolution:                  |   Keywords:
      Port:  py311-pyopencl  |
-----------------------------+----------------------

Comment (by lpagani91):

 I am still having the same problem in 2026 as what I mentioned in
 #69350...

 I am now running with Macports 2.12.5 environment, made a fresh reinstall
 of all my ports.
 Since pyopencl crashes at start in python3.11 and is not available for
 python3.14 inside Macports, I collected it using PIP-3.14 :

 {{{
 laurent>sudo -H pip-3.14 install pyopencl
 Collecting pyopencl
   Downloading
 pyopencl-2026.1.2-cp314-cp314-macosx_10_15_x86_64.whl.metadata (4.7 kB)
 Requirement already satisfied: numpy in
 /opt/local/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14
 /site-packages (from pyopencl) (2.5.1)
 Requirement already satisfied: platformdirs>=2.2 in
 /opt/local/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14
 /site-packages (from pyopencl) (4.11.0)
 Collecting pytools>=2025.1.6 (from pyopencl)
   Downloading pytools-2026.1.1-py3-none-any.whl.metadata (2.9 kB)
 Requirement already satisfied: typing_extensions>=4.6 in
 /opt/local/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14
 /site-packages (from pyopencl) (4.16.0)
 Collecting siphash24>=1.6 (from pytools>=2025.1.6->pyopencl)
   Downloading siphash24-1.8-cp314-cp314-macosx_10_13_x86_64.whl.metadata
 (3.2 kB)
 Downloading pyopencl-2026.1.2-cp314-cp314-macosx_10_15_x86_64.whl (438 kB)
 Downloading pytools-2026.1.1-py3-none-any.whl (99 kB)
 Downloading siphash24-1.8-cp314-cp314-macosx_10_13_x86_64.whl (77 kB)
 Installing collected packages: siphash24, pytools, pyopencl
 Successfully installed pyopencl-2026.1.2 pytools-2026.1.1 siphash24-1.8
 }}}

 I tested that i could import pyopencl in python3.14

 {{{
 LOC_OL>python3.14
 Python 3.14.6 (main, Jun 10 2026, 15:47:22) [Clang 11.0.3
 (clang-1103.0.32.62)] on darwin
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import pyopencl
 >>>
 }}}

 however, trying to run the test.py mentioned in
 [https://trac.macports.org/ticket/69350#comment:1] still crashes :

 {{{
 LOC_OL>python test_pyopencl.py
 TRYING PLATFORM 0
 <pyopencl.Platform 'Apple' at 0x7fff0000> [<pyopencl.Device 'Intel(R)
 Core(TM) i9-9880H CPU @ 2.30GHz' on 'Apple' at 0xffffffff>]
 Traceback (most recent call last):
   File "/Users/laurent/Transfert-Radiatif/LOC_OL/test_pyopencl.py", line
 38, in <module>
     program =  cl.Program(context, source).build(args)
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14
 /site-packages/pyopencl/__init__.py", line 577, in build
     self._prg, was_cached = self._build_and_catch_errors(
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
             lambda: create_built_program_from_source_cached(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                 self._context, self._source, options_bytes, devices,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                 cache_dir=cache_dir, include_path=include_path),
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             options_bytes=options_bytes, source=self._source)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14
 /site-packages/pyopencl/__init__.py", line 629, in _build_and_catch_errors
     raise err
 pyopencl._cl.RuntimeError: clBuildProgram failed: BUILD_PROGRAM_FAILURE -
 clBuildProgram failed: BUILD_PROGRAM_FAILURE - clBuildProgram failed:
 BUILD_PROGRAM_FAILURE

 Build on <pyopencl.Device 'Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz' on
 'Apple' at 0xffffffff>:


 (options: -D Nx=128 -I
 /opt/local/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14
 /site-packages/pyopencl/cl)
 (source saved as
 /var/folders/r0/j6n9nts53j13kfmd14_mkjwm0000gn/T/tmpm_tl41p0.cl)

 }}}

 However, since this is not directly linked to Macports anymore, you might
 consider it is none of your business... Fair enough. Simply, I wonder
 whether a true Macports install of pyopencl in Python 3.14 would help ?

-- 
Ticket URL: <https://trac.macports.org/ticket/74263#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list