Veka
Veka
TTermux
Created by Veka on 6/9/2024 in #support
Running moderngl (and glcontext) python library
Hello! I'm trying to get moderngl python library working on termux. First of all, I encountered this issue during installation pip install moderngl
In file included from glcontext/x11.cpp:5:
/data/data/com.termux/files/usr/include/X11/Xlib.h:44:10: fatal error: 'X11/X.h' file not found
44 | #include <X11/X.h>
| ^~~~~~~~~
1 error generated.
error: command '/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang' failed with exit code 1
[end of output]
In file included from glcontext/x11.cpp:5:
/data/data/com.termux/files/usr/include/X11/Xlib.h:44:10: fatal error: 'X11/X.h' file not found
44 | #include <X11/X.h>
| ^~~~~~~~~
1 error generated.
error: command '/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang' failed with exit code 1
[end of output]
And fixed it with apt install xorgproto, after which it installed correctly Then I got an issue when running moderngl.create_context(standalone=True) which complained about lack of libGL.so, which I also fixed with apt install mesa But now I get the following error, that I cannot solve
opengl_context = moderngl.create_context(standalone=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/moderngl/__init__.py", line 1936, in create_context
ctx.mglo, ctx.version_code = mgl.create_context(glversion=require, mode=mode, **settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/glcontext/__init__.py", line 90, in create
return x11.create_context(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: (standalone) XOpenDisplay: cannot open display
opengl_context = moderngl.create_context(standalone=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/moderngl/__init__.py", line 1936, in create_context
ctx.mglo, ctx.version_code = mgl.create_context(glversion=require, mode=mode, **settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/glcontext/__init__.py", line 90, in create
return x11.create_context(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: (standalone) XOpenDisplay: cannot open display
To clarify, the only thing I need moderngl library for is to attempt to compile GLSL shaders and check them for errors, via Context.program() and Context.compute_shader()
14 replies