Changes between Version 4 and Version 5 of Building/Preparation/FreeBSD


Ignore:
Timestamp:
Apr 14, 2013 7:51:05 PM (12 months ago)
Author:
pgj
Comment:

Add further notes

Legend:

Unmodified
Added
Removed
Modified
  • Building/Preparation/FreeBSD

    v4 v5  
    7979Here is a random list of thoughts about things that are good to know when working on FreeBSD. 
    8080 
    81  - binutils / gcc 
    82  - ncurses 
    83  - gmp 
    84  - tmpfs 
     81 - The FreeBSD base system contains GCC and the GNU toolchain (at least for the time being) but they are not or only slowly updated.  GCC is technically stuck at version 4.2.1 which may not be optimal for building GHC these days.  Hence it is highly recommended to use the toolchain (`devel/binutils`) and GCC (`lang/gcc`) from the Ports Collectiom instead. 
     82 
     83 - The FreeBSD base system is shipped with a version of `ncurses` but this may not be the latest.  Unfortunately, when `devel/ncurses` is installed one should add some extra lines to `mk/build.mk` to tell GNU make we want to use `ncurses` from `$LOCALBASE` (see above) instead, otherwise `terminfo` (which uses `ncurses`) becomes linked to `ncurses` in the base: 
     84 
     85 {{{ 
     86SRC_HC_OPTS += -I$LOCALBASE/include -L$LOCALBASE/lib 
     87libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes=$LOCALBASE/include --configure-option=--with-curses-libraries=$LOCALBASE/lib 
     88}}} 
     89 
     90 See #7472 for possible symptoms. 
     91 
     92 - The GHC source code have an in-tree version of `libffi` and `gmp` which may work by accident -- especially if the version of `libgmp.so` and `libffi.so` matches the version installed by the ports.  But using them is not recommended as they could result in various strange build and run-time errors.  See the `configure` options to work around them. 
     93 
     94 - Building GHC sources and Haskell sources in general could be sped up by setting up a `tmpfs(5)` partition.  (This is not created by the default install.)  Just replace the `/tmp` parition with a tmpfs-backed entry in `/etc/fstab`: 
     95 
     96 {{{ 
     97tmpfs /tmp tmpfs rw,mode=777 0 0 
     98}}} 
     99 
     100 and use your original `/tmp` partition as a swap device (substitute `ada0s1` with your device): 
     101 
     102 {{{ 
     103/dev/ada0s1d none swap sw 0 0 
     104}}}