Homebrew上のOctave更新
octave-forge の signal ライブラリを使うために,octaveを3.8にアップデートしようとした際の覚書.
問題
$ brew install octave
でインストールしようとするが,そのままだと .texi 関係でインストールできなかったりする.
他の人の情報によると,Homebrewでのoctaveのレシピである octave.rb において "--enable-docs=no" をつける (or --without-docs オプションを付ける) とインストールできるようになるが,octave 3.8 では少なくともhelpだけでなくpkg関係も使えなくなってしまう模様.
そのため --without-docsをつけずにインストールした取り組みを記載する.
方法
http://kjunichi.cocolog-nifty.com/misc/2014/02/homebrew--witho.html のエントリを参考にした.homebrewでtexinfoが,別途TeXがインストールされていることを前提とする.
$ export PATH=/usr/local/Cellar/texinfo/5.2/bin:$PATH
でtexinfoのパスを追加.texのbinフォルダへは既にパスが通っているとする.
このまま
$ brew install octave --without-fltk --env=std
でインストールできれば良いが,筆者の環境ではここでもエラーが発生(ログ3参照).
TeX側の容量制限があるらしく,上限を上げる.
$ kpsewhich texmf.cnf
で出てきたファイルパスをvim等で編集.
save_size = 5000
のところを 20000 などに増やしてoctaveをインストールするとできる.
ログ
$ brew update (中略) Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
久々のupdateでバグ.(もしくは前にoctaveインストール時に色々変更したせいか)
http://junko.hatenablog.com/entry/2013/08/13/000223 を参考に
$ cd /usr/local $ git fetch origin $ git reset --hard origin/master $ brew update
で基本部分は直ったが,homebrew/science については更新されていない…?
$ brew doctor Error: No available formula for qrupdate
というエラーが出るように.
$ brew untap homebrew/science $ brew tap homebrew/science
でoctave最新版(3.8)のformulaが出るように.
そのままoctave 3.8を入れようとすると,前のエントリであったようにエラーが出たので,octaveのformulaに "--enable-docs=no" オプションを付けることでインストールできるように.
ログ2
このままではplotができないことが判明.
pkg 関連の処理で .texi ファイルが読めないというエラーを吐くのだが,http://kjunichi.cocolog-nifty.com/misc/2014/02/homebrew--witho.html のエントリに近いので, -env=std オプションを付けて再インストールを試みる.
→ formulaの "--enable-docs=no" オプションなしではビルドできず
$ export PATH=/usr/local/Cellar/texinfo/5.2/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin $ brew install octave --with-fltk --env=std ==> Using Homebrew-provided fortran compiler. This may be changed by setting the FC environment variable. ==> Building with an alternative Fortran compiler This is unsupported. ==> Building with an alternative Fortran compiler This is unsupported. ==> Downloading http://ftpmirror.gnu.org/octave/octave-3.8.0.tar.bz2 Already downloaded: /Library/Caches/Homebrew/octave-3.8.0.tar.bz2 ==> autoreconf -ivf ==> ./configure --prefix=/usr/local/Cellar/octave/3.8.0 --with-blas=-Wl,-framewo ==> make all ==> make check 2>&1 | tee make-check.log ==> make install ==> Caveats Octave supports "native" plotting using OpenGL and FLTK. You can activate it for all future figures using the Octave command graphics_toolkit ("fltk") or for a specific figure handle h using graphics_toolkit (h, "fltk") Otherwise, gnuplot is still used by default, if available. When plotting with gnuplot, you should set "GNUTERM=x11" before running octave; if you are using Aquaterm, use "GNUTERM=aqua". GLPK functionality has been disabled due to API incompatibility. ==> Summary 🍺 /usr/local/Cellar/octave/3.8.0: 2074 files, 47M, built in 36.3 minutes
ならプロットできるように.(しかし求めるのは --without-fltk …)
ログ3
/usr/local/Cellar/texinfo/5.2/bin をPATHに加えて,--without-fltk --env=std オプションでインストールを試みた際のエラー↓
./octave.aux:4742: TeX capacity exceeded, sorry [save size=5000]. @otherbackslash ->@let \=@realbackslash @xrdef #1#2->{@indexnofonts @turnoffactive @xdef @safexrefname {#1}}@expanda... l.4742 ...exed Assignment-snt}{Section@tie 34.3.1} No pages of output. Transcript written on octave.log. /usr/local/opt/texinfo/bin/texi2dvi: pdfetex exited with bad status, quitting. make[3]: *** [octave.pdf] Error 1
確かに texinfo と tex は認識されているが,オーバーフロー?の模様.