在OSX上编译clisp-2.49:找不到LIBFFI

vmo*_*eco 6 macos homebrew clisp common-lisp failed-installation

TL; DR:

即使libffi看起来安装了,configure即使我给它(正确的?)前缀,脚本也找不到它.

/!\这篇文章的最后一部分(*)是我被困的地方./!\

我只提出其他信息来解释我是如何到达那里的.我为这篇重要的帖子道歉,如果事情似乎与你无关,请随时告诉我,我会考虑让我的帖子更短.

为什么我要自己编译CLISP:

我有一个lisp程序,我想运行,但在CLISP安装时运行它brew(我没有root访问权限),我收到以下错误:

*** - CFFI requires CLISP compiled with dynamic FFI support.
Run Code Online (Sandbox Code Playgroud)

所以我想自己编译CLISP.

到目前为止我正在使用SBCL,但我遇到了问题,正在寻找其他实现.

我在尝试编译时遇到的问题:

我下载了消息来源,解开它.

然后我试着跑./configure.

但我明白了:

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.
Run Code Online (Sandbox Code Playgroud)

重要提示:

libffi并且libsigsegv都安装了自制软件.但是找不到.我尝试添加--with-libsigsegv-prefix=<several values amongst ~/.brew/{opt,opt/libsigsegv,lib,Cellar/libsigsegv,...}:仍然是同样的问题.

这也与这篇文章本文几乎相同.但经验证的解决方案对我不起作用(没有root访问权限的OSX).

使用--with-dynamic-ffi和运行configure时--ignore-absence-of-libsigsegv:

我试图运行./configure --ignore-absence-of-libsigsegv并添加,--with-dynamic-ffi因为有人在评论中建议我.

但后来我得到了这个:

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
Run Code Online (Sandbox Code Playgroud)

当试图手动安装libffilibsigsegv:

我也尝试了第一条错误消息中的建议:

跑步时./configure --with-libsigsegv-prefix=${prefix}我得到了:

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.
Run Code Online (Sandbox Code Playgroud)

即使我添加--with-dynamic-ffi或如果我尝试libffi手动安装,如建议的第一个错误消息(并添加--with-ffi-prefix=${prefix})

如果我尝试手动构建和安装libffcall:

我得到很多

avcall-i386.s:7:2: error: instruction requires: Not 64-bit mode
Run Code Online (Sandbox Code Playgroud)

跑步的时候 make

(*)所以现在,它找到了libsigsegv,但没有找到libffi.

然而这棵树${prefix}看起来像这样:

.
??? 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
Run Code Online (Sandbox Code Playgroud)

我没有想法.

wlb*_*lbr 0

在 OSX 上(并且仅针对 OSX 进行开发),检查 Clozure 是一个非常好的主意。http://ccl.clozure.com 它包含一个 IDE,从速度和总体性能来看,它与 SBCL 相当。您可以使用 Clozure 开发原生 OSX UI 应用程序,当然这些应用程序是不可移植的。如果您遵守标准,那么您甚至可以在 Linux 等上使用 Clozure。