2011年4月4日 星期一

[ghc] Upgrade to 7.0.3 !!

upgrade my ghc into 7.0.3 via homebrew.

1. updating homebrew
> brew update

2. upgrade all package you installed
> brew upgrade
or, install lastest ghc only
> brew install ghc
> brew cleanup ghc

3.
kill cabal .. XD
> cd ~/.cabal
> rm -R *
> cd ~/.ghc
> rm -R <path>
path is, for example, i386-darwin-7.0.3

restart cabal by
> cabal update

now, you could install any lastest package you want. XD
> cabal install <any package you want>



There was a weird problem when I want to install the bindings to the LLVM compiler toolkit. I got a error message about pattern matching:
..skipped..
/var/folders/KU/KUdrsAaeFWOIeZoa4Zhsqk+++TI/-Tmp-/llvm-0.9.0.145987/llvm-0.9.0.1/Setup.hs:102:70:
Couldn't match expected type `[PackageDB]'
with actual type `PackageDB'

Well, this problem is due to the error of source code...
so, the thing to do for salving it is to modify that code.

> cabal unpack llvm
> cd ~/.cabal/packages/hackage.haskell.org/llvm-<version>
for example my llvm source code is
~/.cabal/packages/hackage.haskell.org/llvm-0.9.0.1

and then, open Setup.hs with any editor, and replace packageDb by [packageDb] on the line#102 .

now, you must config, build and install by yourself:
> cabal config
> cabal build
> cabal copy

PS, if you cannot config this package
plz google for more info.
there is a big problem about 32/64-bit ghc and/or llvm...
(seems could be solved by rebuild ghc/llvm)

沒有留言:

張貼留言