Thursday, January 5, 2012

Haskell Platform 2011.4.0.0 from source

The Haskell Platform source file
haskell-platform-2011.4.0.0.tar.gz
is downloaded to <username>/Software and extracted to
<username>/Software/haskell-platform-2011.4.0.0

 Install the Haskell Platform to

/opt/haskell-platform-2011.4.0.0
The Haskell compiler is installed first from the directory
~/Software/ghc-7.0.4
to
/opt/haskell-platform-2011.4.0.0
As all needed libraries are in place already, everything goes easy:  

 
[prompt]:~/Software/ghc-7.0.4$ sudo ./configure --prefix=/opt/haskell-platform-2011.4.0.0
checking for path to top of build tree... /home/[user]/Software/ghc-7.0.4
Build platform inferred as: i386-unknown-linux
Host platform inferred as: i386-unknown-linux
Target platform inferred as: i386-unknown-linux
checking for perl... /usr/bin/perl

... ... ...

configure: creating ./config.status
config.status: creating extra-gcc-opts
config.status: creating mk/config.mk
config.status: creating mk/install.mk
****************************************************
Configuration done, ready to 'make install'
(see README and INSTALL files for more info.)
****************************************************
[prompt]:~/Software/ghc-7.0.4$ sudo make install
make -r --no-print-directory -f ghc.mk install BINDIST=YES NO_INCLUDE_DEPS=YES
/usr/bin/install -c -m 755 -d "/opt/haskell-platform-2011.4.0.0/share/man"
/usr/bin/install -c -m 755 -d "/opt/haskell-platform-2011.4.0.0/share/man/man1"
/usr/bin/install -c -m 644  docs/man/ghc.1 "/opt/haskell-platform-2011.4.0.0/share/man/man1"

... ... ...

/usr/bin/install -c -m 644  libraries/prologue.txt "/opt/haskell-platform-2011.4.0.0/share/doc/ghc/html/libraries/"
/usr/bin/install -c -m 755  libraries/gen_contents_index "/opt/haskell-platform-2011.4.0.0/share/doc/ghc/html/libraries/"
for i in docs/users_guide/users_guide libraries/Cabal/doc/Cabal utils/haddock/doc/haddock; do \
        /usr/bin/install -c -m 755 -d "/opt/haskell-platform-2011.4.0.0/share/doc/ghc/html/`basename $i`"; \
        /usr/bin/install -c -m 644  $i/* "/opt/haskell-platform-2011.4.0.0/share/doc/ghc/html/`basename $i`"; \
    done



[prompt]:~/Software/ghc-7.0.4$ cd ..
[prompt]:~/Software$ cd haskell-platform-2011.4.0.0


[prompt]:~/Software/haskell-platform-2011.4.0.0$ sudo ./configure --prefix=/opt/haskell-platform-2011.4.0.0 --with-ghc=/opt/haskell-platform-2011.4.0.0/bin/ghc --with-ghc-pkg=/opt/haskell-platform-2011.4.0.0/bin/ghc-pkg --with-hsc2hs=/opt/haskell-platform-2011.4.0.0/bin/hsc2hs
**************************************************
*
*     Haskell Platform Source Installer
*
*     For the Haskell Platform 2011.4.0.0 and GHC 7.0.4
*
**************************************************
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking version of ghc... 7.0.4
checking version of ghc-pkg matches... yes
checking ghc actually works... [1 of 1] Compiling Main             ( conftest.hs, conftest.o )
yes
checking the ghc core packages are all installed... yes

... ... ...

configure: creating ./config.status
config.status: creating scripts/config
**************************************************
* Configuration completed successfully.          
*                                                
*   Install prefix: /opt/haskell-platform-2011.4.0.0
*     Haskell packages will be registered into   
*     the global ghc package database            
*                                                
*   If you wish to change these settings then    
*   use --prefix= and/or --enable-user-install   
*                                                
* Now do "make" followed by "sudo make install"  
**************************************************

[prompt]:~/Software/haskell-platform-2011.4.0.0$ sudo make install
scripts/build.sh
**************************************************
Scanning system for any installed Haskell Platform components...

Found:None.

New packages to install: None! All done.

**************************************************
Building transformers-0.2.2.0
"/opt/haskell-platform-2011.4.0.0/bin/ghc" "--make" "Setup" "-o" "Setup" "-package" "Cabal-1.10.2.0"
[1 of 1] Compiling Main             ( Setup.hs, Setup.o )
Linking Setup ...
"./Setup" "configure" "--package-db=../../packages/package.conf.inplace" "--prefix=/opt/haskell-platform-2011.4.0.0" "--with-compiler=/opt/haskell-platform-2011.4.0.0/bin/ghc" "--with-hc-pkg=/opt/haskell-platform-2011.4.0.0/bin/ghc-pkg" "--with-hsc2hs=/
opt/haskell-platform-2011.4.0.0/bin/hsc2hs" "--enable-library-profiling" "--ghc-pkg-option=--package-conf=../../packages/package.conf.inplace"

... ... ...

*******************************************************
* Installation completed successfully.           
*
* Programs installed into:                       
*   /opt/haskell-platform-2011.4.0.0/bin
*
* Now do "cabal update" to initialize the package list                         
*
* Additional packages may be found at http://hackage.haskell.org
* or via "cabal list <pattern>"
*
* Use "cabal install <foo>" to install additional packages
*
*******************************************************

[prompt]:~/Software/haskell-platform-2011.4.0.0$ cabal update
Downloading the latest package list from hackage.haskell.org

============

CHANGES

In .bashrc:
# Path to Haskell ghc
PATH=$PATH:/opt/haskell-platform-2011.4.0.0/bin


In .emacs.el
(setq haskell-program-name "/opt/haskell-platform-2011.4.0.0/bin/ghci")

SLIME: there is no package with name "ASDF"

The known bug with

Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2010

Type :h and hit Enter for context help.

[1]> 
;; Loading file /usr/share/common-lisp/source/slime/swank-loader.lisp ...
*** - READ de
       #<INPUT BUFFERED FILE-STREAM CHARACTER
         #P"/usr/share/common-lisp/source/slime/swank-loader.lisp" @143>
      : there is no package with name "ASDF"

The following restarts are available:
ABORT          :R1      Abort main loop
Break 1 SWANK-LOADER[2]>  
 
seems not yet fixed (2012-01-05). 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640815
The solution proposed there worked for me:
 
Ok I realized that I had to manually setup ASDF in my ~/.clisprc:

  (load #P"/usr/share/common-lisp/source/cl-asdf/asdf.lisp")

Or, for SBCL, in my ~/.sbclrc

  (require 'asdf)

Mentionning this fact in the README.Debian would be useful for CL newbies
 

Wednesday, December 7, 2011

Ubuntu 11.10 GNOME

Several days ago I switched to Ubuntu 11.10, with GNOME desktop. I decided that it is better for me than Unity.

Some applications and configurations have gone, of course.

The following links are usefull:

How To Create Desktop Launchers in Ubuntu 11.10 Oneiric Ocelot
http://shuffleos.com/3274/how-to-create-desktop-launchers-in-ubuntu-11-10-oneiric-ocelot/

Docky
http://wiki.go-docky.com/index.php?title=Installing

Thursday, November 17, 2011

Goodnight Irene

Goodnight Irene

Irene goodnight, Irene goodnight
Goodnight Irene, goodnight Irene
I'll see you in my dreams 

 
Last saturday night I got married

Me and my love settled down
Now me and my love are parted
I'm gonna take another stroll downtown


Irene goodnight, Irene goodnight
Goodnight Irene, goodnight Irene
I'll see you in my dreams


Sometimes I live in the country
Sometimes I live in the town


Sometimes I have a great notion
To jump In the river and drown


Irene goodnight, Irene good night
Good night Irene, good night Irene
I'll see you in my dreams


Ramblin' stop your gamblin'
Stop stayin' out late at night


Go home to your wife and your family
Sit down by the fireside bright


Irene goodnight, Irene good night
Good night Irene, good night Irene
I'll see you in my dreams


Irene goodnight, Irene good night
Good night Irene, good night Irene
I'll see you in my dreams


http://wn.com/Irene_Goodnight# 
http://en.wikipedia.org/wiki/Goodnight,_Irene

Thursday, November 3, 2011

Haskell Plaform from source

The Haskell Platform source file
haskell-platform-2011.2.0.1.tar.gz
is downloaded to <username>/Software and extracted to
<username>/Software/haskell-platform-2011.2.0.1

I am going to install the Haskell Platform to
/opt/haskell-platform-2011.2.0.1

[prompt]:~/Software/haskell-platform-2011.2.0.1$ sudo ./configure --prefix=/opt/haskell-platform-2011.2.0.1
**************************************************
*
*     Haskell Platform Source Installer
*
*     For the Haskell Platform 2011.2.0.1 and GHC 7.0.3
*
**************************************************
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for ghc... notfound
configure: error:
  This installer for the Haskell Platform requires ghc to be installed first
  If ghc is installed not on the PATH then use --with-ghc= and --with-ghc-pkg=

[prompt]:~/Software/haskell-platform-2011.2.0.1$ sudo ./configure --prefix=/opt/haskell-platform-2011.2.0.1 --with-ghc=/opt/haskell-platform-2011.2.0.1/bin/ghc --with-ghc-pkg=/opt/haskell-platform-2011.2.0.1/bin/ghc-pkg

*** *** ***
checking for hsc2hs... notfound
configure: error: The hsc2hs program could not be found.
  It is usually installed along with ghc. You may need to specify --with-hsc2hs=

[prompt]:~/Software/haskell-platform-2011.2.0.1$ sudo ./configure --prefix=/opt/haskell-platform-2011.2.0.1 --with-ghc=/opt/haskell-platform-2011.2.0.1/bin/ghc --with-ghc-pkg=/opt/haskell-platform-2011.2.0.1/bin/ghc-pkg --with-hsc2hs=/opt/haskell-platform-2011.2.0.1/bin/hsc2hs

*** *** ***
configure: error: Your installation of ghc does not appear to work.
  It cannot compile a simple program (see config.log for the details).
  If you installed ghc from a generic binary tarball then it is worth
  checking that you have the 'gmp' C library and header files installed.
  (On Debian-based systems this package is called libgmp3-dev.)

*** libgmp3-dev is installed ***

[prompt]:~/Software/haskell-platform-2011.2.0.1$ sudo ./configure --prefix=/opt/haskell-platform-2011.2.0.1 --with-ghc=/opt/haskell-platform-2011.2.0.1/bin/ghc --with-ghc-pkg=/opt/haskell-platform-2011.2.0.1/bin/ghc-pkg --with-hsc2hs=/opt/haskell-platform-2011.2.0.1/bin/hsc2hs

*** *** ***
checking for zlib.h... noconfigure: error: The zlib C library is required

What is zlib C?

The answer is in
http://trac.haskell.org/haskell-platform/ticket/179
You need to install the developer headers for zlib.
On Ubuntu these are: zlib1g-dev

*** zlib1g-dev is installed ***

[prompt]:~/Software/haskell-platform-2011.2.0.1$ sudo ./configure --prefix=/opt/haskell-platform-2011.2.0.1 --with-ghc=/opt/haskell-platform-2011.2.0.1/bin/ghc --with-ghc-pkg=/opt/haskell-platform-2011.2.0.1/bin/ghc-pkg --with-hsc2hs=/opt/haskell-platform-2011.2.0.1/bin/hsc2hs
**************************************************
checking GL/gl.h usability... nochecking GL/gl.h presence... no
checking for GL/gl.h... no
configure: error: The OpenGL C library is required

What is The OpenGL library?

The answer is, for example, in
http://nathanwiegand.com/blog/2009/07/haskell-platform-on-ubuntu.html
The packages
libgl1-mesa-dev
libglc-dev
freeglut3-dev
libedit-dev
libglw1-mesa libglw1-mesa-dev
are to be installed.

A number of accompanying packages is installed, too.

The following message was displayed on terminal, but I missed it:

The following packages were automatically installed and are no longer required:
  libffi-dev libbsd-dev ghc6
Use 'apt-get autoremove' to remove them.

The final try (successful):

[prompt]:~/Software/haskell-platform-2011.2.0.1$ sudo ./configure --prefix=/opt/haskell-platform-2011.2.0.1 --with-ghc=/opt/haskell-platform-2011.2.0.1/bin/ghc --with-ghc-pkg=/opt/haskell-platform-2011.2.0.1/bin/ghc-pkg --with-hsc2hs=/opt/haskell-platform-2011.2.0.1/bin/hsc2hs

*** *** ***
...
configure: creating ./config.status
config.status: creating scripts/config
**************************************************
* Configuration completed successfully.         
*                                               
*   Install prefix: /opt/haskell-platform-2011.2.0.1
*     Haskell packages will be registered into  
*     the global ghc package database           
*                                               
*   If you wish to change these settings then   
*   use --prefix= and/or --enable-user-install  
*                                               
* Now do "make" followed by "sudo make install" 
**************************************************

[prompt]:~/Software/haskell-platform-2011.2.0.1$ sudo make install
scripts/build.sh
**************************************************
Scanning system for any installed Haskell Platform components...

Found:None.

New packages to install: None! All done.

**************************************************
Building ... ... ...

The following message appeared several times:
Setup: Haddock's internal GHC version must match the configured GHC version.
The GHC version is 7.0.3 but haddock is using GHC version 6.12.1
Generating the transformers-0.2.2.0 package documentation failed

Preprocessing library haskell-platform-2011.2.0.1...
Building haskell-platform-2011.2.0.1...
Registering haskell-platform-2011.2.0.1...
"./Setup" "register" "--inplace"
Registering haskell-platform-2011.2.0.1...

**************************************************
* Building Haskell Platform completed successfully.
*                                               
* Now do "sudo make install"                    
**************************************************
scripts/install.sh
Installing transformers-0.2.2.0...
Installing library in
/opt/haskell-platform-2011.2.0.1/lib/transformers-0.2.2.0/ghc-7.0.3
Creating package registration file: transformers-0.2.2.0.conf

...

*******************************************************
* Installation completed successfully.          
*
* Programs installed into:                      
*   /opt/haskell-platform-2011.2.0.1/bin
*
* Now do "cabal update" to initialize the package list                        
*
* Additional packages may be found at http://hackage.haskell.org
* or via "cabal list <pattern>"
*
* Use "cabal install <foo>" to install additional packages
*
*******************************************************

[prompt]:~/Software/haskell-platform-2011.2.0.1$ cabal update
Config file path source is default config file.
Config file /home/zigmas/.cabal/config not found.
Writing default configuration to /home/zigmas/.cabal/config
Downloading the latest package list from hackage.haskell.org

Testing if it works:

[prompt]:~/Software/haskell-platform-2011.2.0.1$ ghc --helpUsage:

    ghc [command-line-options-and-input-files]

... ... ...

------------------------------------------------------------------------
[prompt]:~/Software/haskell-platform-2011.2.0.1$ ghci
GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> 5+7
12
Prelude> :quit
Leaving GHCi.

[prompt]:~/Software/haskell-platform-2011.2.0.1$ ghci-7.0.3
GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude> :quit
Leaving GHCi.

[prompt]:~/Software/haskell-platform-2011.2.0.1$ cabal install hoogle
Resolving dependencies...
Downloading binary-0.5.0.2...
Configuring binary-0.5.0.2...
Preprocessing library binary-0.5.0.2...
Building binary-0.5.0.2...
Linking dist/build/hoogle/hoogle ...

Installing library in /home/zigmas/.cabal/lib/hoogle-4.2.7/ghc-6.12.1
Installing executable(s) in /home/zigmas/.cabal/bin
Registering hoogle-4.2.7...

[prompt]:~/Software/haskell-platform-2011.2.0.1$ cabal --versioncabal-install version 0.10.2
using version 1.10.1.0 of the Cabal library

[prompt]:~/Software/haskell-platform-2011.2.0.1$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1

I remembered that apt-get autoremove should be done, and did it.
After that:

[prompt]:~$ ghci
GHCi, version 7.0.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude>

Tuesday, November 1, 2011

TeX and LaTeX books

A remarkable finding: a thorough collection of books about TeX and LaTeX, in English and Russian:

http://karl-karlsson.narod2.ru/

All files are available for free download.
Including all four volumes of Bechtolsheim S. "TeX in Practice".
One can read the review of this unordinary book:
http://www.tug.org/TUGboat/tb15-1/tb42pappas.pdf

Wednesday, October 19, 2011

Eclipse 3.7.1 on Ubuntu 10.4

[0]
The installation file
eclipse-SDK-3.7.1-linux-gtk.tar.gz
is downloaded from the Eclipse site.

[1]
It extracts into the directory "eclipse". The directory "eclipse" is moved to /home/<username>/Applications/eclipse-3.7.1

[2]
The file Eclipse 3.7.1.desktop is created:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=gnome-panel-launcher
Name[en_US]=Eclipse 3.7.1
Exec=/home/<username>/Applications/eclipse-3.7.1/eclipse -data /home/<username>/works/workspace -vm /opt/java/jdk1.6.0_27/bin/java
Name=Eclipse 3.7.1
Icon=/home/<username>/Applications/eclipse-3.7.1/icon.xpm

The use of the options -data and -vm is well described in the documentation file readme_eclipse.html.
The workspace location /works/workspace can be chosen in any other way.