#3746 closed defect (fixed)
ChimeraX fails to start on macOS 11 beta 6
Reported by: | Tom Goddard | Owned by: | Tom Goddard |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Platform | Version: | |
Keywords: | Cc: | Eric Pettersen | |
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
ChimeraX fails to start on macOS 11 beta 6 (20A5364e). Here is the error message starting it from the shell. OpenGL dynamic library not found.
Last login: Mon Sep 21 23:18:39 on console
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh
.
For more details, please visit https://support.apple.com/kb/HT208050.
Toms-iMac-2:~ goddard$ ~/Desktop/ChimeraX_Daily.app/Contents/MacOS/ChimeraX
Traceback (most recent call last):
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/darwin.py", line 38, in GL
mode=ctypes.RTLD_GLOBAL
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/ctypesloader.py", line 36, in loadLibrary
return _loadLibraryWindows(dllType, name, mode)
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/ctypesloader.py", line 89, in _loadLibraryWindows
return dllType( name, mode )
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/init.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: ('dlopen(OpenGL, 10): image not found', 'OpenGL', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ChimeraX_main.py", line 915, in <module>
exit_code = init(sys.argv)
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ChimeraX_main.py", line 460, in init
sess = session.Session(app_name, debug=opts.debug, silent=opts.silent, minimal=opts.safe_mode)
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/session.py", line 456, in init
from chimerax.graphics.gsession import register_graphics_session_save
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/graphics/init.py", line 34, in <module>
from .opengl import Texture, Lighting, Material
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/graphics/opengl.py", line 61, in <module>
from OpenGL import GL
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/GL/init.py", line 3, in <module>
from OpenGL import error as _error
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/error.py", line 12, in <module>
from OpenGL import platform, _configflags
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/init.py", line 36, in <module>
_load()
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/init.py", line 33, in _load
plugin.install(globals())
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/baseplatform.py", line 97, in install
namespace[ name ] = getattr(self,name,None)
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/baseplatform.py", line 15, in get
value = self.fget( obj )
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/darwin.py", line 62, in GetCurrentContext
return self.CGL.CGLGetCurrentContext
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/baseplatform.py", line 15, in get
value = self.fget( obj )
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/darwin.py", line 45, in CGL
def CGL(self): return self.GL
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/baseplatform.py", line 15, in get
value = self.fget( obj )
File "/Users/goddard/Desktop/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PyOpenGL-3.1.5-py3.7.egg/OpenGL/platform/darwin.py", line 41, in GL
raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 'dlopen(OpenGL, 10): image not found', 'OpenGL', None)
Toms-iMac-2:~ goddard$
Change History (7)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Problem is that macOS Big Sur no longer has library file
/System/Library/Frameworks/OpenGL.Framework/OpenGL
Instead according to Big Sur beta release notes
https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11-beta-release-notes/
"New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)"
PyOpenGL uses ctypes.util.find_library('OpenGL') and this does not find the library on Big Sur although it does find it in Catalina.
Hacking PyOpenGL ctypesloader.py to explicitly specify the path /System/Library/Frameworks/OpenGL.Framework/OpenGL for dlopen even though no such file exists allows ChimeraX to start. Then simple tests in daily build, opening PDB, map, toolbar, open dialog, all worked. We could make this patch to PyOpenGL if necessary. Probably should file a PyOpenGL bug report if one does not already exist.
comment:3 by , 5 years ago
The reason PyOpenGL does not find the OpenGL library is because ctypes.util.find_library('OpenGL') does not find the library. This is reported as a Python bug here
That bug report was closed and merged into a big Python macOS Big Sur ticket that has a pull request that supposedly fixes ctypes.util.find_library()
Here is the Python pull request from Apple June 30, 2020 to fix this
It has made some progress through review but has not yet been accepted. It looks like there is only one of 11 checks remaining.
comment:4 by , 5 years ago
It looks like Python will probably fix this bug. But ChimeraX 1.1 and 1.0 will not start since they won't have the fixed Python so a new ChimeraX release, 1.1.1 or 1.2 will be needed before macOS Big Sur is released. There is no date set for macOS Big Sur release but today beta 8 was released, so the final release may be within a couple weeks or a month.
comment:5 by , 5 years ago
I patched PyOpenGL to dlopen /System/Library/Frameworks/OpenGL.Framework/OpenGL on macOS 11 and 10.16 (beta release of macOS Big Sur uses version 10.16). This will make the daily builds start on Big Sur. When Python fixes the ctypes problem this patch can be removed.
comment:6 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Current ChimeraX daily build is now working on Big Sur. We will make a ChimeraX 1.1.1 production release probably in a couple weeks so that our production release will also work on BIg Sur.
comment:7 by , 5 years ago
Unfortunately unpatched PyOpenGL 3.1.5 still fails to start in Python 3.8.7 in ChimeraX daily build. Leaving patch in. I am working on making a ChimeraX Python module for use in a stock Python where PyOpenGL will be pip installed so will not have the patch. For now it simply won't work on Big Sur.
PyOpenGL is reported not to work in Big Sur, exact same error ChimeraX gets, no responses to this report from a month ago: