Showing posts with label haskell. Show all posts
Showing posts with label haskell. Show all posts

July 3, 2012

Installing Haskell ThreadScope on Ubuntu 12.04 precise

ThreadScope is a tool for performance profiling of parallel Haskell programs.

When I tried to install ThreadScope on Ubuntu 12.04 I ran into some problems. The following are the steps that allowed me to complete the installation.

Note that the haskell-platform package is already installed on the system.

First install the required GTK libraries.

sudo apt-get install libgtk2.0-dev libpango1.0-dev
sudo apt-get install libglib2.0-dev libcairo2-dev

Next install the gtk2hs-buildtools Haskell package.

sudo cabal update
sudo cabal install gtk2hs-buildtools

The following steps require running the gtk2hs tools. Although the ~/.cabal/bin directory is specified in my PATH variable, the setup process fails with the following message:

Cannot find gtk2hsC2hs Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin).

You can fix this error by creating links to the gtk2hs tools in the /usr/bin directory.

sudo ln ~/.cabal/bin/gtk2hsC2hs /usr/bin/gtk2hsC2hs
sudo ln ~/.cabal/bin/gtk2hsHookGenerator /usr/bin/gtk2hsHookGenerator
sudo ln ~/.cabal/bin/gtk2hsTypeGen /usr/bin/gtk2hsTypeGen

Once the links are created you can install the other required packages.

sudo cabal install gtk
sudo cabal install cairo

Finally you can install the threadscope package.

sudo cabal install threadscope

February 13, 2012

Building the text-icu Haskell package on MacOSX

Following are the instructions to compile the text-icu Haskell package on MacOSX (tested on MacOSX 10.7).

In order to compile the text-icu Haskell package we need to have the ICU libraries installed on the system.

We will use the MacPorts package manager to install the ICU libraries and header files.

If you don't have the MacPorts package manager installed on your system you should download and install it.

We update the port packages database and then we install the icu package. This step will install the required libraries and header files.

sudo port selfupdate

sudo port install icu

Finally, we update the cabal packages databases and we install the text-icu package specifying the locations of the include and lib directories.

sudo cabal update

sudo cabal install text-icu --extra-include-dirs=/opt/local/include --extra-lib-dirs=/opt/local/lib

July 2, 2011

Instalando Haskell Platform en Ubuntu 11.04

El paquete haskell-platform parece estar roto en Ubuntu 11.04 (Broken Haskell Platform in 11.04).

Podemos intentar reparar el paquete o realizar una instalación manual, esta última opción nos permite además instalar la versión más reciente de la plataforma.

Para instalar la versión 2011.2.0.1 de la Plataforma Haskell en Ubuntu 11.04 (Intel 32 bits) hemos seguido los pasos que se describen en el artículo Haskell Platform from Source on Unix-Like.

Hemos adoptado la siguiente configuración:

Directorio de construcción: ~/Software/Haskell/haskell-platform-2011.2.0.1

Directorio de instalación: /usr/local/haskell-patform-2011.2.0.1

El texto que aparece sobre fondo oscuro se debe introducir en una ventana de terminal.

Instalar las dependencias necesarias

sudo apt-get install libedit2 libedit-dev freeglut3-dev

sudo apt-get install libglu1-mesa-dev

sudo apt-get install libbsd-dev libgmp3-dev zlib1g-dev

Crear los directorios necesarios

mkdir ~/Software

mkdir ~/Software/Haskell

mkdir ~/Software/Haskell/haskell-platform-2011.2.0.1

sudo mkdir /usr/local/haskell-platform-2011.2.0.1

Descargar el compilador GHC

Vamos a descargar los archivos de la versión 7.0.3 del compilador GHC para Linux Intel 32 bits. Podemos consultar más información sobre otras plataformas en la página de distribución del compilador GHC.

cd ~/Software/Haskell/haskell-platform-2011.2.0.1

wget http://haskell.org/ghc/dist/7.0.3/ghc-7.0.3-i386-unknown-linux.tar.bz2

tar -xvf ghc-7.0.3-i386-unknown-linux.tar.bz2

Producir e instalar el compilador GHC

cd ~/Software/Haskell/haskell-platform-2011.2.0.1/ghc-7.0.3

./configure --prefix=/usr/local/haskell-platform-2011.2.0.1

make

sudo make install

Ajustar la variable de entorno PATH

Editar el archivo de perfil bash:

gedit ~/.bashrc

Agregar la línea siguiente, guardar y cerrar el editor:

export PATH=$PATH:/usr/local/haskell-platform-2011.2.0.1/bin

Después cerrar la ventana de terminal y abrir una nueva para cargar el perfil actualizado.

Comprobar acceso al compilador GHC

ghc --version

Descargar la Plataforma Haskell

cd ~/Software/Haskell/haskell-platform-2011.2.0.1

wget http://lambda.galois.com/hp-tmp/2011.2.0.1/haskell-platform-2011.2.0.1.tar.gz

tar -xvf haskell-platform-2011.2.0.1.tar.gz

Producir e instalar la Plataforma Haskell

cd ~/Software/Haskell/haskell-platform-2011.2.0.1

cd haskell-platform-2011.2.0.1

./configure --prefix=/usr/local/haskell-platform-2011.2.0.1

make

sudo make install

Finalmente preparar el gestor de paquetes Cabal

cabal update