ubuntu下安装haskell

Haskell 是一种纯函数式编程语言。

Haskell Platform 是Haskell的一个整合的开发环境。

 

本文主要介绍Haskell Platform的安装过程。

操作系统:Ubuntu 12.04.1 LTS; Linux 3.2.0-29-generic-pae

 

1 下载Haskell Platform和GHC

http://www.haskell.org/platform/linux.html

上面的网页包含了下载地址和安装方法

 

2 安装ghc-7.4.1 

2.1 解压ghc-7.4.1-i386-unknown-linux.tar.bz2 

 

2.2 cd ghc-7.4.1

2.3 ./configure

给出错误信息:

 

checking for path to top of build tree... utils/ghc-pwd/dist/build/tmp/ghc-pwd: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
configure: error: cannot determine current directory

解决方法:

 

sudo apt-get install libgmp3-dev

sudo apt-get install libgmp3c2(注:缺少其他包也是一样的,找到并下载就OK)

 

./cofigure

这次没有错误了

 

2.4 sudo make install

 

2.5 ghc --version

这一步如果给出

"The Glorious Glasgow Haskell Compilation System, version 7.4.1"

就表示安装正确了。

 

3 安装Haskell-platform

3.1 解压 haskell-platform-2012.2.0.0.tar.gz

3.2 ./configure

给出错误信息:

configure: error: The OpenGL C library is required

解决方法:

sudo apt-get install libglc-dev

 

./configure

给出错误信息:

configure: error: The GLUT C library is required

解决方法:

sudo apt-get install freeglut3-dev

 

./configure

没有给出错误信息

 

3.2 sudo make

3.3 sudo make install

3.4 cabal update

 

总结:

1 安装的信赖包:libgmp3-dev libgmp3c2 libglc-dev freeglut3-dev

2    注意每一步命令执行后的反馈信息

 

参考资料:

1 Haskell简介及各种安装方法:http://blog.csdn.net/albert_lee/article/details/5469933

2 Haskell wiki:http://www.haskell.org/haskellwiki/Haskell

3 Haskell 中文社区:http://www.haskellcn.org/

 

posted @ 2013-02-08 15:12  rarator  阅读(1842)  评论(0)    收藏  举报