読者です 読者をやめる 読者になる 読者になる

Raspberry Pi 3 Model B買ってCommon Lisp入れた

Raspberry Pi 3 Model B - Raspberry Pi を購入したのでCommon Lispを動かしてみたメモ。

NOOBSのSDカード作成

PC上で Download NOOBS for Raspberry Pi から NOOBS LITE v1.9をダウンロードし、 NOOBS For Raspberry Pi – Rants & Raves – The Blog! を参考にしてSDカードを作成する。

Raspbianインストール

よく分からないので公式のRaspbianをインストールする。

どこかにありそうな情報を取得

lscpu
Architecture:          armv7l
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
Model name:            ARMv7 Processor rev 4 (v7l)
CPU max MHz:           1200.0000
CPU min MHz:           600.0000
uname -a
Linux raspberrypi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016 armv7l GNU/Linux

公式には ARMv8 て書いてあるけど v7 なのか?

Linuxbrewインストール

sudo apt-get install build-essential curl git python-setuptools ruby
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"
echo 'Pexport ATH="$HOME/.linuxbrew/bin:$PATH"' >> .profile
. ~/.profile
brew install hello

動かない。。。

==> Downloading https://ftpmirror.gnu.org/hello/hello-2.10.tar.gz
==> Downloading from http://ftp.jaist.ac.jp/pub/GNU/hello/hello-2.10.tar.gz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=/home/pi/.linuxbrew/Cellar/hello/2.10
*** Error in `/usr/bin/gcc-4.9': double free or corruption (top): 0x01e66718 ***
Last 15 lines from /home/pi/.cache/Homebrew/Logs/hello/01.configure:
--prefix=/home/pi/.linuxbrew/Cellar/hello/2.10

configure: WARNING: unrecognized options: --disable-debug
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... /usr/bin/gcc-4.9
checking whether the C compiler works... no
configure: error: in `/tmp/hello-20160910-2414-1lq40k3/hello-2.10':
configure: error: C compiler cannot create executables
See `config.log' for more details

READ THIS: https://github.com/Linuxbrew/brew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/Linuxbrew/homebrew-core/issues

C compiler cannot create executables って何だ? double free or corruption の方か? alternativesを使ってgccを4.8に変えてみたが、linuxbrewの使うgccバージョンが4.9から変更されなかったのでとりあえず諦める。

Roswellインストール

linuxbrewを使わず直接roswellをビルドする。

sudo apt-get install autoconf automake libcurl4-openssl-dev
git clone https://github.com/roswell/roswell.git
cd roswell
./bootstrap
./configure
make
make install
ros init
ros --version
roswell 0.0.6.65(00f7451)

処理系色々インストール

SBCL

ros install sbcl-bin
ros use sbcl-bin
ros run -- --version
SBCL 1.3.9

CCL

ros install ccl-bin
ros use ccl-bin
ros run -- --version
Version 1.11-r16635  (LinuxARM32)

ECL

ros install ecl
ros use ecl
ros run -- --version
ECL 16.1.2

CMUL

ros install cmu-bin
Installing cmu-bin/21a...
Downloading archive:https://common-lisp.net/project/cmucl/downloads/release/21a/cmucl-21a-armhf-linux.tar.bz2
Downloading https://common-lisp.net/project/cmucl/downloads/release/21a/cmucl-21a-armhf-linux.tar.bz2
Unhandled UIOP/RUN-PROGRAM:SUBPROCESS-ERROR:
  Subprocess with command "/usr/local/bin/ros roswell-internal-use download https://common-lisp.net/project/cmucl/downloads/release/21a/cmucl-21a-armhf-linux.tar.bz2 /home/pi/.roswell/archives/cmucl-21a-armhf-linux.tar.bz2"
 exited with error code 2

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {52D82811}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR {52A38E91}> #<unavailable argument>)
1: (SB-DEBUG::RUN-HOOK SB-EXT:*INVOKE-DEBUGGER-HOOK* #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR {52A38E91}>)
2: (INVOKE-DEBUGGER #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR {52A38E91}>)
3: (CERROR "IGNORE-ERROR-STATUS" UIOP/RUN-PROGRAM:SUBPROCESS-ERROR :COMMAND "/usr/local/bin/ros roswell-internal-use download https://common-lisp.net/project/cmucl/downloads/release/21a/cmucl-21a-armhf-linux.tar.bz2 /home/pi/.roswell/archives/cmucl-21a-armhf-linux.tar.bz2" :CODE 2 :PROCESS NIL)
4: (UIOP/RUN-PROGRAM::%CHECK-RESULT 2 :COMMAND "/usr/local/bin/ros roswell-internal-use download https://common-lisp.net/project/cmucl/downloads/release/21a/cmucl-21a-armhf-linux.tar.bz2 /home/pi/.roswell/archives/cmucl-21a-armhf-linux.tar.bz2" :PROCESS NIL :IGNORE-ERROR-STATUS NIL)
5: ((LAMBDA (UIOP/RUN-PROGRAM::REDUCED-INPUT #:G7867) :IN UIOP/RUN-PROGRAM::%USE-SYSTEM) :INTERACTIVE #<unavailable argument>)
6: (UIOP/RUN-PROGRAM::%USE-SYSTEM "/usr/local/bin/ros roswell-internal-use download https://common-lisp.net/project/cmucl/downloads/release/21a/cmucl-21a-armhf-linux.tar.bz2 /home/pi/.roswell/archives/cmucl-21a-armhf-linux.tar.bz2" :INPUT :INTERACTIVE :ERROR-OUTPUT :INTERACTIVE :IF-INPUT-DOES-NOT-EXIST :ERROR :IF-OUTPUT-EXISTS :OVERWRITE :IF-ERROR-OUTPUT-EXISTS :OVERWRITE :ELEMENT-TYPE :DEFAULT :EXTERNAL-FORMAT :UTF-8 :OUTPUT :INTERACTIVE :ERROR-OUTPUT :INTERACTIVE)
7: (ROS:ROSWELL ("roswell-internal-use" "download" "https://common-lisp.net/project/cmucl/downloads/release/21a/cmucl-21a-armhf-linux.tar.bz2" #P"/home/pi/.roswell/archives/cmucl-21a-armhf-linux.tar.bz2") :INTERACTIVE NIL)
8: (ROS.INSTALL::CMU-BIN-DOWNLOAD (:TARGET "cmu-bin" :VERSION "21a" :ARGV NIL))
9: (INSTALL-IMPL "cmu-bin" NIL NIL)
10: (INSTALL-IMPL-IF-PROBED "cmu-bin" NIL NIL)
11: (MAIN #<unused argument> "cmu-bin")
12: (SB-INT:SIMPLE-EVAL-IN-LEXENV (APPLY (QUOTE MAIN) ROS:*ARGV*) #<NULL-LEXENV>)
13: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ROS:QUIT (APPLY (QUOTE MAIN) ROS:*ARGV*)) #<NULL-LEXENV>)
14: (SB-EXT:EVAL-TLF (ROS:QUIT (APPLY (QUOTE MAIN) ROS:*ARGV*)) NIL NIL)
15: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (ROS:QUIT (APPLY (QUOTE MAIN) ROS:*ARGV*)) NIL)
16: (SB-INT:LOAD-AS-SOURCE #<CONCATENATED-STREAM :STREAMS NIL {52C0C2A1}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
17: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<CONCATENATED-STREAM :STREAMS NIL {52C0C2A1}> NIL)
18: (LOAD #<CONCATENATED-STREAM :STREAMS NIL {52C0C2A1}> :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
19: ((FLET ROS::BODY :IN ROS:SCRIPT) #<SB-SYS:FD-STREAM for "file /usr/local/etc/roswell/install.ros" {52C0C179}>)
20: (ROS:SCRIPT :SCRIPT "/usr/local/etc/roswell/install.ros" "install" "cmu-bin")
21: (ROS:RUN ((:SCRIPT "/usr/local/etc/roswell/install.ros" "install" "cmu-bin") (:QUIT NIL)))
22: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ROS:RUN (QUOTE ((:SCRIPT "/usr/local/etc/roswell/install.ros" "install" "cmu-bin") (:QUIT NIL)))) #<NULL-LEXENV>)
23: (EVAL (ROS:RUN (QUOTE ((:SCRIPT "/usr/local/etc/roswell/install.ros" "install" "cmu-bin") (:QUIT NIL)))))
24: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(progn #-ros.init(cl:load \"/usr/local/etc/roswell/init.lisp\"))") (:EVAL . "(ros:quicklisp)") (:EVAL . "(ros:run '((:script \"/usr/local/etc/roswell/install.ros\"\"install\"\"cmu-bin\")(:quit ())))")))
25: (SB-IMPL::TOPLEVEL-INIT)
26: ((FLET #:WITHOUT-INTERRUPTS-BODY-72 :IN SB-EXT:SAVE-LISP-AND-DIE))
27: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))

unhandled condition in --disable-debugger mode, quitting

ABCL

ros install abcl-bin
ros use abcl-bin
Invalid maximum heap size: -Xmx4g
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error: unable to use 'abcl-bin'

4G固定なのかな?

CLISP

ros install clisp
Installing clisp/2.49...
prefix: #P"/home/pi/.roswell/impls/armhf/linux/clisp/2.49/"
chdir /home/pi/.roswell/src/clisp-2.49/src/
Unhandled UIOP/RUN-PROGRAM:SUBPROCESS-ERROR:
  Subprocess with command "make install"
 exited with error code 2

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {52D85581}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR {514A8129}> #<unavailable argument>)
1: (SB-DEBUG::RUN-HOOK SB-EXT:*INVOKE-DEBUGGER-HOOK* #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR {514A8129}>)
2: (INVOKE-DEBUGGER #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR {514A8129}>)
3: (CERROR "IGNORE-ERROR-STATUS" UIOP/RUN-PROGRAM:SUBPROCESS-ERROR :COMMAND "make install" :CODE 2 :PROCESS NIL)
4: (UIOP/RUN-PROGRAM::%CHECK-RESULT 2 :COMMAND "make install" :PROCESS NIL :IGNORE-ERROR-STATUS NIL)
5: ((LAMBDA (UIOP/RUN-PROGRAM::REDUCED-INPUT #:G7867) :IN UIOP/RUN-PROGRAM::%USE-SYSTEM) NIL #<unavailable argument>)
6: ((FLET #:BEFORE7398 :IN UIOP/RUN-PROGRAM::%CALL-WITH-PROGRAM-IO) #P"/tmp/tmpZWLLOVAH.tmp")
7: (UIOP/STREAM:CALL-WITH-TEMPORARY-FILE #<CLOSURE (FLET #:BEFORE7398 :IN UIOP/RUN-PROGRAM::%CALL-WITH-PROGRAM-IO) {72593B95}> :WANT-STREAM-P NIL :WANT-PATHNAME-P T :DIRECTION :IO :KEEP NIL :AFTER NIL :DIRECTORY NIL :TYPE "tmp" :PREFIX NIL :SUFFIX NIL :ELEMENT-TYPE NIL :EXTERNAL-FORMAT NIL)
8: ((LABELS UIOP/RUN-PROGRAM::HARD-CASE :IN UIOP/RUN-PROGRAM::%CALL-WITH-PROGRAM-IO))
9: (UIOP/RUN-PROGRAM::%USE-SYSTEM "make install" :INPUT NIL :ERROR-OUTPUT NIL :IF-INPUT-DOES-NOT-EXIST :ERROR :IF-OUTPUT-EXISTS :OVERWRITE :IF-ERROR-OUTPUT-EXISTS :OVERWRITE :ELEMENT-TYPE :DEFAULT :EXTERNAL-FORMAT :UTF-8 :OUTPUT T)
10: (ROS.INSTALL::CLISP-INSTALL (:TARGET "clisp" :VERSION "2.49" :ARGV NIL))
11: (INSTALL-IMPL "clisp" NIL NIL)
12: (INSTALL-IMPL-IF-PROBED "clisp" NIL NIL)
13: (MAIN #<unused argument> "clisp")
14: (SB-INT:SIMPLE-EVAL-IN-LEXENV (APPLY (QUOTE MAIN) ROS:*ARGV*) #<NULL-LEXENV>)
15: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ROS:QUIT (APPLY (QUOTE MAIN) ROS:*ARGV*)) #<NULL-LEXENV>)
16: (SB-EXT:EVAL-TLF (ROS:QUIT (APPLY (QUOTE MAIN) ROS:*ARGV*)) NIL NIL)
17: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (ROS:QUIT (APPLY (QUOTE MAIN) ROS:*ARGV*)) NIL)
18: (SB-INT:LOAD-AS-SOURCE #<CONCATENATED-STREAM :STREAMS NIL {52C0B261}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
19: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<CONCATENATED-STREAM :STREAMS NIL {52C0B261}> NIL)
20: (LOAD #<CONCATENATED-STREAM :STREAMS NIL {52C0B261}> :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
21: ((FLET ROS::BODY :IN ROS:SCRIPT) #<SB-SYS:FD-STREAM for "file /usr/local/etc/roswell/install.ros" {52C0B139}>)
22: (ROS:SCRIPT :SCRIPT "/usr/local/etc/roswell/install.ros" "install" "clisp")
23: (ROS:RUN ((:SCRIPT "/usr/local/etc/roswell/install.ros" "install" "clisp") (:QUIT NIL)))
24: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ROS:RUN (QUOTE ((:SCRIPT "/usr/local/etc/roswell/install.ros" "install" "clisp") (:QUIT NIL)))) #<NULL-LEXENV>)
25: (EVAL (ROS:RUN (QUOTE ((:SCRIPT "/usr/local/etc/roswell/install.ros" "install" "clisp") (:QUIT NIL)))))
26: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(progn #-ros.init(cl:load \"/usr/local/etc/roswell/init.lisp\"))") (:EVAL . "(ros:quicklisp)") (:EVAL . "(ros:run '((:script \"/usr/local/etc/roswell/install.ros\"\"install\"\"clisp\")(:quit ())))")))
27: (SB-IMPL::TOPLEVEL-INIT)
28: ((FLET #:WITHOUT-INTERRUPTS-BODY-72 :IN SB-EXT:SAVE-LISP-AND-DIE))
29: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))

unhandled condition in --disable-debugger mode, quitting