脳汁でコードを書く

snow leopardでsbclをbuildしてみる

snow leopardでsbclのbuildにてこずったのでメモ

まずいまのstable版ではmakeが通らない.
以下のようなエラーが出る.

//entering make-target-1.sh
//building runtime system and symbol table file
rm -f *.[do] sbcl sbcl.nm sbcl.h core *.tmp
echo '#include "genesis/config.h"' >sbcl.h
echo '#include "genesis/constants.h"' >>sbcl.h
gcc -g -Wall -O2 -fdollars-in-identifiers -mmacosx-version-min=10.4 -I. -no-cpp-precomp  -c -o alloc.o alloc.c
In file included from alloc.c:21:
runtime.h: In function 'CONS':
runtime.h:151: warning: cast to pointer from integer of different size
runtime.h: In function 'SYMBOL':
runtime.h:157: warning: cast to pointer from integer of different size
runtime.h: In function 'FDEFN':
runtime.h:163: warning: cast to pointer from integer of different size
/var/folders/3K/3K4LXRIJHoq8UNahYP7P4U+++TI/-Tmp-//cck88adh.s:81:Incorrect register `%rbx' used with `l' suffix
/var/folders/3K/3K4LXRIJHoq8UNahYP7P4U+++TI/-Tmp-//cck88adh.s:578:Incorrect register `%rdx' used with `l' suffix
make: *** [alloc.o] Error 1

x86, x86_64にするとか1.0.30のバイナリをつかうとかいろいろ試してみたけど, 最終的にcvsの先端だとバグがfixされている模様

$ cvs -d :pserver:anonymous@sbcl.cvs.sourceforge.net:/cvsroot/sbcl co sbcl

そしたら, multi threadつかいたいのでsbcl/customize-target-features.lispというファイルを作る

(lambda (features)
      (flet ((enable (x)
               (pushnew x features))
             (disable (x)
               (setf features (remove x features))))
        ;; Threading support, available only on x86/x86-64 Linux, x86 Solaris
        ;; and x86 Mac OS X (experimental).
        (enable :sb-thread)))

次にsbcl/sbclcomprというのを作る

SBCL_HOME=/usr/local/lib/sbcl /usr/local/bin/sbcl $*

そんでもって

$ sh make.sh "sbclcompr"
$ sudo sh install.sh

なんかrun-tests.shが大量のエラーをはいてるけど, みなかったことにしよう…

追記:

sh run-tests.shの結果

Finished running tests.
Status:
 Expected failure:    float.pure.lisp / (SCALE-FLOAT-OVERFLOW BUG-372)
 Expected failure:    float.pure.lisp / (ADDITION-OVERFLOW BUG-372)
 Expected failure:    threads.pure.lisp / WITHOUT-INTERRUPTS+CONDITION-WAIT
 Expected failure:    callback.impure.lisp / UNDERFLOW-DETECTION
 Invalid exit status: clos-add-remove-method.impure.lisp
 Invalid exit status: clos-cache.impure.lisp
 Invalid exit status: clos-interrupts.impure.lisp
 Invalid exit status: compare-and-swap.impure.lisp
 Invalid exit status: debug.impure.lisp
 Expected failure:    external-format.impure.lisp / (CHARACTER-DECODE-LARGE
                                                     FORCE-END-OF-FILE)
 Invalid exit status: gc.impure.lisp
 Invalid exit status: hash.impure.lisp
 Expected failure:    packages.impure.lisp / USE-PACKAGE-CONFLICT-SET
 Expected failure:    packages.impure.lisp / IMPORT-SINGLE-CONFLICT
 Invalid exit status: profile.impure.lisp
 Invalid exit status: threads.impure.lisp
 Invalid exit status: timer.impure.lisp
 Invalid exit status: core.test.sh
test failed, expected 104 return code, got 1

Leave a Reply