Compiling clisp-2.49 on OSX : LIBFFI not found
Asked Answered
B

1

7

TL;DR :

Even if libffi seems installed, the configure script doesn't find it even if I give it the (correct?) prefix.

/!\ The last part (*) of this post is where I'm stuck. /!\

I only put the other information to explain how I get there. I apologize for the big post, if something seems irrelevant to you, feel free to tell me, I'll consider making my post shorter.

Why I want to compile CLISP by myself :

I have a lisp programm I would like to run but when running it with CLISP installed with brew (I have no root access) I get the following error :

*** - CFFI requires CLISP compiled with dynamic FFI support.

So I would like to compile CLISP by myself.

I was using SBCL thus far but I had a problem and was looking for an other implementation.

The problems I have when trying to compile :

I downloaded the sources, untared it.

I then trying to run ./configure.

But I get this :

Configure findings:
  FFI:        no (user requested: default)
  readline:   no (user requested: default)
  libsigsegv: no, consider installing GNU libsigsegv
./configure: libsigsegv was not detected, thus some features, such as
  generational garbage collection and
  stack overflow detection in interpreted Lisp code
cannot be provided.
Please install libsigsegv like this:
  mkdir tools; cd tools; prefix=`pwd`/x86_64-apple-darwin15.4.0
  wget http://ftp.gnu.org/pub/gnu/libsigsegv/libsigsegv-2.8.tar.gz
  tar xfz libsigsegv-2.8.tar.gz
  cd libsigsegv-2.8
  ./configure --prefix=${prefix} && make && make check && make install
  cd ../..
  rm -f src/config.cache
  ./configure --with-libsigsegv-prefix=${prefix}
If you insist on building without libsigsegv, please pass
  --ignore-absence-of-libsigsegv
to this script:
  ./configure --ignore-absence-of-libsigsegv
If you have installed libsigsegv, but clisp does not detect it,
you might have installed it incorrectly, see section 2 in in unix/INSTALL.

IMPORTANT :

libffi and libsigsegv are both installed with homebrew. But aren't found. I tried adding --with-libsigsegv-prefix=<several values amongst ~/.brew/{opt,opt/libsigsegv,lib,Cellar/libsigsegv,...} : Still the same problem.

This is also almost the same as this post or this one. But the validated solutions doesn't work for me (OSX without root access).

When running configure with --with-dynamic-ffi and --ignore-absence-of-libsigsegv :

I tried to run ./configure --ignore-absence-of-libsigsegv and added --with-dynamic-ffi as someone suggested me in comments.

But then I got this :

Configure findings:
  FFI:        no (user requested: default)
  readline:   no (user requested: default)
  libsigsegv: no, consider installing GNU libsigsegv
As you requested, we will proceed without libsigsegv...
./makemake  --with-dynamic-ffi    > Makefile
clang: error: unsupported option '-print-multi-os-directory'
clang: error: no input files

when trying to manually install libffi and libsigsegv :

I also tried the suggestion in the first error message :

When running ./configure --with-libsigsegv-prefix=${prefix} I got :

Configure findings:
  FFI:        no (user requested: default)
  readline:   no (user requested: default)
  libsigsegv: yes
./makemake  --with-libsigsegv-prefix=/nfs/2013/v/vmonteco/Documents/clisp-2.49/tools/x86_64-apple-darwin15.4.0    > Makefile
clang: error: unsupported option '-print-multi-os-directory'
clang: error: no input files
make: `config.lisp' is up to date.

even if I add --with-dynamic-ffi or if I try to install libffi by hand like the first error message suggested (and adding --with-ffi-prefix=${prefix} as well)

If I try to manually build and install libffcall as well :

I get many

avcall-i386.s:7:2: error: instruction requires: Not 64-bit mode

when running make

(*) So now, it does find libsigsegv, but doesn't find libffi.

Yet the tree at ${prefix} looks like this :

.
├── include
│   └── sigsegv.h
├── lib
│   ├── libffi-3.2.1
│   │   └── include
│   │       ├── ffi.h
│   │       └── ffitarget.h
│   ├── libffi.6.dylib
│   ├── libffi.a
│   ├── libffi.dylib -> libffi.6.dylib
│   ├── libffi.la
│   ├── libsigsegv.a
│   ├── libsigsegv.la
│   └── pkgconfig
│       └── libffi.pc
└── share
    ├── info
    │   ├── dir
    │   └── libffi.info
    └── man
        └── man3
            ├── ffi.3
            ├── ffi_call.3
            ├── ffi_prep_cif.3
            └── ffi_prep_cif_var.3

I'm out of ideas.

Ballou answered 25/4, 2016 at 19:37 Comment(0)
O
0

On OSX (and developing for OSX only) it is a very good idea to check Clozure. http://ccl.clozure.com It includes an IDE and from speed and general performance it is comparable to SBCL. You can develop native OSX UI apps using Clozure, of course these will not be portable. If you keep to the standard, then you might even use Clozure on Linux etc.

Octahedrite answered 1/5, 2016 at 16:7 Comment(2)
It could have been a solution but this lisp implementation isn't repertoried as supporting the library I want to run (lispbuildersdl). :/ I'll still try it though. But here the problem is more that the implementation must be built with CFFI support.Ballou
Years later, sorry ;-) Clozure actually has CFFi support.Octahedrite

© 2022 - 2024 — McMap. All rights reserved.