LoginSignup
0
0

More than 5 years have passed since last update.

Ubuntu12.04 にHaskell GHCiをインストール

Posted at

Haskellをやってみようと思った。
環境:Ubuntu12.04 64bit

https://www.haskell.org/platform/linux.html" class="autolink">https://www.haskell.org/platform/linux.html">https://www.haskell.org/platform/linux.html
からGeneric Linux Binariesを落としてきて

$ cd /
$ sudo tar xvf ...downloaded-tarfile...
$ sudo /usr/local/haskell/ghc-7.8.3-x86-64/bin/activate-hs

とする。

すると以下のようにして対話式プログラミングできるプロンプトが出る。

$ ghci
...
Prelude>

はずだがエラーが出た。

GHCi, version 7.3.20111021: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... <command></command>: can't load .so/.DLL for: libgmp.so (libgmp.so: cannot open shared object file: No such file or directory

そこで以下のコマンドでlibgmp.soに静的リンクを張ったらうまく行くようになった。

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 /usr/lib/x86_64-linux-gnu/libgmp.so

ソースファイルを読み込ませるには

$ ghci Sample.hs

とするか、

GHCiを起動してから

Prelude> :l Sample.hs

とすればよい。
ファイルに変更を加えた時には

Prelude> :r

でリロードする。

0
0
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
0
0