opengllispcommon-lispasdf

Problem with installation of open-gl in lisp


Using SBCL 2.0.3 the following script

#!/usr/local/bin/sbcl --script
(load "~/quicklisp/setup.lisp")                                                             
(ql:quickload :cffi)                                                                                                                                                 
(ql:quickload :cl-opengl) ; from github repo:3b/cl-opengl

leads to error:

To load "cl-opengl":

  Load 1 ASDF system:

    cl-opengl

; Loading "cl-opengl"

...

; file: /home/mr/quicklisp/local-projects/cl-opengl/gl/funcs-gl-glcore-gles2.lisp

; in: DEFGLEXTFUN ("glBindBufferRange" BIND-BUFFER-RANGE 958)

;     (CL-OPENGL-BINDINGS::DEFGLEXTFUN

;      ("glBindBufferRange" CL-OPENGL-BINDINGS:BIND-BUFFER-RANGE 958) :VOID

;      (CL-OPENGL-BINDINGS::TARGET CL-OPENGL-BINDINGS:ENUM)

;      (CL-OPENGL-BINDINGS::INDEX CL-OPENGL-BINDINGS:UINT)

;      (CL-OPENGL-BINDINGS::BUFFER CL-OPENGL-BINDINGS:UINT)

;      (CL-OPENGL-BINDINGS::OFFSET CL-OPENGL-BINDINGS:INTPTR)

;      (CL-OPENGL-BINDINGS::SIZE CL-OPENGL-BINDINGS:SIZEIPTR))

; 

; caught ERROR:

;   (during macroexpansion of (DEFGLEXTFUN ("glBindBufferRange" BIND-BUFFER-RANGE ...) 
...))

;   Unknown CFFI type :PTRDIFF
ls ~/quicklisp/local-projects

cepl  cl-objc  cl-opengl  cl-sdl2  cl-sdl2-tutorial  py4cl system-index.txt

As I understand there is inconsistency of cffi and opengl packages. M-x package-delete does not show any cffi package.

If I comment (ql:quickload :cffi) nothing changes.

Any ideas?

I could install sdl2 examples, it works, but I would like to have pure opengl. May be there are modern setups? It will be enough..


Solution

  • I can load the current version of cl-opengl into SBCL 2.47 using Quicklisp for all the other dependencies (so, in particular CFFI is whatever Quicklisp has today).

    The only thing I can see that would explain this is if you're using a very old version of CFFI. ptrdiff arrived in this commit in October 2020, so if whatever you have is older than that you might have trouble.