vydd / sketch

A Common Lisp framework for the creation of electronic art, visual design, game prototyping, game making, computer graphics, exploration of human-computer interaction, and more.
MIT License
1.41k stars 67 forks source link

Error compiling on OpenSuse #17

Open ArnautDaniel opened 7 years ago

ArnautDaniel commented 7 years ago

cc -m64 -o /home/silver/.cache/common-lisp/sbcl-1.3.11-1.4-suse-linux-x64/home/silver/quicklisp/dists/quicklisp/software/cffi_0.18.0/libffi/libffi-types__grovel-tmpGHU3ALSV -I/home/silver/quicklisp/dists/quicklisp/software/cffi_0.18.0/ /home/silver/.cache/common-lisp/sbcl-1.3.11-1.4-suse-linux-x64/home/silver/quicklisp/dists/quicklisp/software/cffi_0.18.0/libffi/libffi-types__grovel.c

 with command ("cc" "-m64" "-o"
               "/home/silver/.cache/common-lisp/sbcl-1.3.11-1.4-suse-linux-x64/home/silver/quicklisp/dists/quicklisp/software/cffi_0.18.0/libffi/libffi-types__grovel-tmpGHU3ALSV"
               "-I/home/silver/quicklisp/dists/quicklisp/software/cffi_0.18.0/"
               "/home/silver/.cache/common-lisp/sbcl-1.3.11-1.4-suse-linux-x64/home/silver/quicklisp/dists/quicklisp/software/cffi_0.18.0/libffi/libffi-types__grovel.c")
 exited with error code 1
   [Condition of type CFFI-GROVEL:GROVEL-ERROR]

Getting the following error when trying to ql:quickload sketch. Running openSuse Tumbleweed, tried it with sbcl 1.3.11 and CCL 1.12 and got the same error.

Tried starting swank in emacs and separately and clearing out the common lisp cache so it had a fresh try each time.

ArnautDaniel commented 7 years ago

Works just fine on Manjaro with CCL 1.12.

Something must be up with OpenSuse's libffi package.

vydd commented 7 years ago

Thanks for reporting. I don't have a way to test it now though, so I will leave the issue open.

ArnautDaniel commented 7 years ago

I keep forgetting how I fix this on other OS'. I think its a header problem with missing some Linux and GCC headers.

Going to close since I don't use suse anymore and I don't think its a sketch problem.

vydd commented 7 years ago

Installed OpenSuse Tumbleweed and hit the same issue.

Firstly, I had to fix (FL-ERROR "Unable to load any of the alternatives:~% ~S" ("libffi.so.6" "libffi32.so.6" "libffi.so.5" "libffi32.so.5")) by using ("libffi.so"), because that's where libffi can be found on tumbleweed. I should mention that it's libffi7, but libffi6 installed from unofficial sources didn't work either for the next step, so I just used the one on the system.

Shortly after, I got a new error:

grov.c:72:41: error: ‘FFI_SYSV’ undeclared (first use in this function)
   fprintf(output, "%"PRIiMAX, (intmax_t)FFI_SYSV);

I checked ffi.h and ffitarget.h. ffi_abi struct in ffitarget.h on my machine resolves to

#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
  FFI_FIRST_ABI = 1,
  FFI_UNIX64,
  FFI_WIN64,
  FFI_EFI64 = FFI_WIN64,
  FFI_LAST_ABI,
  FFI_DEFAULT_ABI = FFI_UNIX64

leaving FFI_SYSV undefined. As a temporary fix, I added #define FFI_SYSV 1 to grovel/common.h, reloaded sketch, and now everything works fine. I don't know how to fix this properly, but hopefully someone will be able to help with that.

Most importantly, Sketch works fine on Tumbleweed now :)

EDIT: reported here: https://bugs.launchpad.net/cffi/+bug/1692751

jessup commented 5 years ago

This workaround solved the same problem for me on Ubuntu 18.04.2 LTS.