Build Barrelfish operating system from scratch “Development Environment on Ubuntu 12.04 LTS”

Check out this page first from barrelfish Wiki to make sure you fulfill all required packages needed before going forward http://wiki.barrelfish.org/Getting_Started if you don’t know how to install gcc-4.5.X from scratch or you have a different version installed on your machine, just follow my post here https://ahegazi.wordpress.com/2013/11/28/build-gcc-from-scratch/ then keep going to get barrelfish built as follow:

1. Install ghc compiler (version 7.4.1) Check the working version of haskell used by barrelfish team first before proceeding, get the right working version at the moment barrelfish team use version 7.4.1

$ sudo apt-get install  ghc

If you can’t grab the requied version through apt-get just install it manually from this page. In my case, it’s ghc-7.4.1-x86_64-unknown-linux-n.tar.bz2. Then

1
2
3
4
$ tar xjvf ghc-7.4.1-x86_64-unknown-linux-n.tar.bz2
$ cd ghc-7.4.1
$ ./configure
$ sudo make install

This will install the ghc 7.4.1 executable system-widely. If you have no root access, then you should just install in your home folder and then tweak the PATH variable to make sure the ghc-7.4.1 executable will be first found.

2. Install cabal-install

1
$ sudo apt-get install cabal-install

4. Install ghc-paths using cabal

1
2
$ cabal update
$ cabal install cabal-install   ## This is very important step
$ cabal install ghc-paths

5. Install hg

1
$ sudo apt-get install mercurial

If you will boot Barrelfish on Intel SCC, two extra steps must be performed:

1. Install the patched crbif driver

1
2
3
4
5
6
$ wget http://www.dcl.hpi.uni-potsdam.de/research/scc/crbif-dkms-1.1.3-tty.tar.bz2
$ tar xjvf crbif-dkms-1.1.3-tty.tar.bz2
$ cd crbif-dkms-1.1.3
$ make -C /lib/modules/`uname -r`/build M=`pwd` modules
$ sudo rmmod crbif
$ sudo insmod crbif.ko

http://www.dcl.hpi.uni-potsdam.de/research/scc/serial.htm

http://communities.intel.com/message/140647#140647

2. Prepare the bin2obj executable
Grab the bin2obj.c from

http://marcbug.scc-dc.com/svn/repository/trunk/linuxkernel/bin2obj/bin2obj.c

Compile it and rename the executable as bin2obj and put it somewhere the shell can find.

 

Personally this is what I have done, on an x86_64 machine with Ubuntu 12.04 LTS

$ sudo apt-get update

$ sudo apt-get install mercurial m4 binutils (binutils should be the one needed by barrelfish)

$ hg clone http://hg.barrelfish.org/barrelfish
### To start Check out this http://wiki.barrelfish.org/Getting_Started

– To remove gcc, and all of these staff with the wrong version
$ sudo apt-get –purge remove binutils ### This will remove gcc
1) We need to install GCC 4.5-2 http://superuser.com/questions/236372/how-to-build-g-4-5-2-on-ubuntu-10-04
http://blog.erdemagaoglu.com/post/3444247672/compiling-gcc-4-5-on-debian-unstable

Order is important when installing these packages:

 

## Install gmp-5.0.1 ##
#######################

$ curl -O http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gmp/gmp-5.0.1.tar.gz
$ tar zxf gmp-5.0.1.tar.gz
$ cd gmp-5.0.1/
$ ./configure –prefix=/usr
$ sudo make
$ sudo make install
$ cd ..
## Install mpfr-3.0.0 ##
########################
$ wget http://www.mpfr.org/mpfr-3.0.0/mpfr-3.0.0.tar.gz
$ tar zxf mpfr-3.0.0.tar.gz
$ cd mpfr-3.0.0/
$ ./configure –prefix=/usr
$ sudo make
$ sudo make install
$ cd ..
## Install mpc-0.9 ##
#####################
$ wget http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz
$ tar zxf mpc-0.8.2.tar.gz
$ cd mpc-0.8.2/
$ ./configure –prefix=/usr
$ sudo make
$ sudo make install
$ cd ..
## Install ppl-0.11.1 ##
########################
$ wget wget http://bugseng.com/external/ppl/download/ftp/releases/0.11.1/ppl-0.11.1.tar.gz
$

 

## Install cloog-ppl-0.15.10 ##
###############################
$ wget http://www.mirrorservice.org/sites/sourceware.org/pub/gcc/infrastructure/cloog-ppl-0.15.10.tar.gz
## Install libelf-0.8.13 ##
###########################
$ wget http://fossies.org/linux/misc/libelf-0.8.13.tar.gz
$ tar xvzf libelf-0.8.13.tar.gz
$ cd libelf-0.8.13
$ ./configure –prefix=/usr
$ sudo make
$ sude make install
$ cd ..
## install gcc-4.5.2 ##
#######################
$ wget http://ftp.gnu.org/gnu/gcc/gcc-4.5.2/gcc-4.5.2.tar.gz
$ tar xvzf gcc-4.5.2.tar.gz
$ cd gcc-4.5.2
$ ./configure
$ sudo make
$ sudo make install

OR OR OR OR

$ sudo apt-get install gcc-4.5

After installation

$ sudo cp /usr/bin/gcc-4.5 /usr/bin/gcc >>
## Install Ghc latest one used by barrelfish team is 7.4.1 #
############################################################

$ cp /usr/lib/libgmp.so /usr/lib/libgmp.so.3 ## I installed it before but I just change the name
$ cp /usr/lib/x86_64-linux-gnu/libgmpxx.so /usr/lib/x86_64-linux-gnu/libgmpxx.so.3

Download it from http://www.haskell.org/ghc
tar
$ ./configure
$ sudo make install directly
$ ghc –version

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s