【Haskell in ubuntu-14.10-server-amd64 関連メモ】(2014/12/28 – )
ghcおよびhaskell-platform導入メモ
ghc-7.6.3導入
事前にシンボリックリンクlibgmp.so.3を作成する
12
$ cd /usr/lib/x86_64-linux-gnu/
$ sudo ln -s libgmp.so.10 libgmp.so.3
ghc-7.6.3本体の導入
1234567891011121314
$ cd /usr/local/src/
$ sudo wget http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-x86_64-unknown-linux.tar.bz2
$ sudo tar xvf ghc-7.6.3-x86_64-unknown-linux.tar.bz2
$ cd ghc-7.6.3
$ sudo ./configure
...(略)...
$ sudo make install
...(略)...
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
haskell-platform導入
・予め必要なパッケージを導入する
1
$ sudo aptitude install libgmp-dev
・haskell-platform本体の導入
123456789
$ cd /usr/local/src/
$ sudo wget https://downloads.haskell.org/~platform/2014.2.0.0/haskell-platform-2014.2.0.0-unknown-linux-x86_64.tar.gz
$ sudo tar xzvf haskell-platform-2014.2.0.0-unknown-linux-x86_64.tar.gz
展開された /usr/local/haskell 以下を /usr/local/ へ移動し、パスを通す
$ cabal --version
cabal-install version 1.18.0.5
using version 1.18.1.3 of the Cabal library
同様にruby公式サイトより DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe (For use with Ruby 2.0 (x64 64bits only))をダウンロードしインストールする。
次にインストール先ディレクトリにて以下のコマンドを実行すること。
123456789101112
$ ruby dk.rb init
[INFO] found RubyInstaller v2.0.0 at C:/Ruby200-x64
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.
$ ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/Ruby200-x64'
[INFO] Installing 'C:/Ruby200-x64/lib/ruby/site_ruby/devkit.rb'
$ wget http://downloads.typesafe.com/play/2.2.0/play-2.2.0.zip
$ unzip play-2.2.0.zip
$ sudo mv play-2.2.0 /usr/local
$ cd /usr/bin
$ sudo ln -s /usr/local/play-2.2.0/play play
■動作確認
12345678910111213141516171819202122232425
$ play
zsh: correct 'play' to 'aplay' [nyae]? n
Getting com.typesafe.play console_2.10 2.2.0 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
6 artifacts copied, 0 already retrieved (2012kB/93ms)
Getting Scala 2.10.2 (for console)...
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
5 artifacts copied, 0 already retrieved (24390kB/2078ms)
_
_ __ | | __ _ _ _
| '_ \| |/ _' | || |
| __/|_|\____|\__ /
|_| |__/
play 2.2.0 built with Scala 2.10.2 (running Java 1.6.0_18), http://www.playframework.com
This is not a play application!
Use `play new` to create a new Play application in the current directory,
or go to an existing application and launch the development console using `play`.
You can also browse the complete documentation at http://www.playframework.com.
$ play new testPlay
zsh: correct 'play' to 'aplay' [nyae]? n
_
_ __ | | __ _ _ _
| '_ \| |/ _' | || |
| __/|_|\____|\__ /
|_| |__/
play 2.2.0 built with Scala 2.10.2 (running Java 1.6.0_18), http://www.playframework.com
The new application will be created in /home/philippos/testPlay
What is the application name? [testPlay]
>
Which template do you want to use for this new application?
1 - Create a simple Scala application
2 - Create a simple Java application
> 1
OK, application testPlay is created.
Have fun!
$ tree testPlay
testPlay
|-- README
|-- app
| |-- controllers
| | `-- Application.scala
| `-- views
| |-- index.scala.html
| `-- main.scala.html
|-- build.sbt
|-- conf
| |-- application.conf
| `-- routes
|-- project
| |-- build.properties
| `-- plugins.sbt
|-- public
| |-- images
| | `-- favicon.png
| |-- javascripts
| | `-- jquery-1.9.0.min.js
| `-- stylesheets
| `-- main.css
`-- test
|-- ApplicationSpec.scala
`-- IntegrationSpec.scala
10 directories, 14 files
■playアプリケーションの実行
1234567891011121314151617
$ play run
[info] Loading project definition from /home/philippos/testPlay/project
[info] Set current project to testPlay (in build file:/home/philippos/testPlay/)
Cannot load the JNotify native library (/home/philippos/testPlay/target/native_libraries/64bits/libjnotify.so: /lib/libc.so.6: version `GLIBC_2.12' not found (required by /home/philippos/testPlay/target/native_libraries/64bits/libjnotify.so))
Play will check file changes for each request, so expect degraded reloading performace.
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
[info] Compiling 5 Scala sources and 1 Java source to /home/philippos/testPlay/target/scala-2.10/classes...
[info] play - Application started (Dev)
$ play console [21:19:14]
[info] Loading project definition from /home/philippos/testPlay/project
[info] Set current project to testPlay (in build file:/home/philippos/testPlay/)
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.10.2 (OpenJDK 64-Bit Server VM, Java 1.6.0_27).
Type in expressions to have them evaluated.
Type :help for more information.