LoginSignup
1
1

More than 5 years have passed since last update.

sourceからbuildして最新のJuliaをMacで使う話

Posted at

Juliaは高い頻度で更新が行われており、User GroupやIssuesでも「Updateしたら速くなった」的な話もされていることがあります。

ここでは、"Nightly builds"じゃダメだ!もっと新しいものをくれ!って人のために
Juliaをsourceからbuildしてdmgを作成する方法を紹介します。

方法

作業ディレクトリは各々の環境に合わせて変更して頂ければ幸いです。

各種必要なもののダウンロード/インストール

gccのインストール

brew install gcc

Platypus command line toolsのインストール

ダウンロードはこちらから

cd ~/Downloads
unzip platypus.zip
./Platypus-4.8/Platypus.app/Contents/Resources/InstallCommandLineTool.sh
rm -rf Platypus-4.8 platypus.zip

リポジトリをclone

cd ~
git clone https://github.com/JuliaLang/julia.git

Winstonのインストール

julia
julia> Pkg.add("Winston")
cp -r ~/.julia/v0.3/Cairo ~/.julia/v0.3/Tk ~/julia/contrib/mac/app

make

cd ~/julia/contrib/mac/app/
sudo make

SuiteSparseのダウンロードが失敗する場合

非常にダウンロード速度が遅く、404 Not Foundになる場合があります。

curl: (22) The requested URL returned error: 404 Not Found
make[5]: *** [SuiteSparse-4.4.1.tar.gz] Error 22
make[4]: *** [julia-release] Error 2
make[3]: *** [release] Error 2
make[2]: *** [install] Error 2
make[1]: *** [dist] Error 2
make: *** [dmg] Error 2

リポジトリをcloneして回避します。

cd ~
git clone https://github.com/jluttine/suitesparse.git
tar czvf SuiteSparse-4.4.1.tar.gz ~/suitesparse
sudo rm ~/julia/deps/SuiteSparse-4.4.1.tar.gz
mv SuiteSparse-4.4.1.tar.gz ~/julia/deps

このままだとCheck Sumを通過しないので書き換えます。

cd ~/julia/deps
mv checksums/SuiteSparse-4.4.1.tar.gz/sha512 checksums/SuiteSparse-4.4.1.tar.gz/sha512_OLD
shasum -a 512 SuiteSparse-4.4.1.tar.gz | cut -f 1 -d ' ' > checksums/SuiteSparse-4.4.1.tar.gz/sha512

成功すると~/julia/contrib/mac/app/Julia-0.4.0-dev-310986771a.dmgのようなdmgが作成されます。

で、肝心の速さは?

Julia-0.3.4-Current_Release
% time ./julia -e 'println("hello")'
hello
./julia -e 'println("hello")'  0.50s user 0.11s system 130% cpu 0.468 total
Julia-0.4.0-dev-b4fc1867d0-Nightly_builds
% time ./julia -e 'println("hello")'
hello
./julia -e 'println("hello")'  0.18s user 0.10s system 59% cpu 0.480 total
Julia-0.4.0-dev-310986771a
% time ./julia -e 'println("hello")'
hello
./julia -e 'println("hello")'  4.26s user 0.14s system 103% cpu 4.252 total

まぁこんなこともあるよねってことで。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1