[Haskell-cafe] Error in Installing Data.deriveTH

Daniel Fischer daniel.is.fischer at googlemail.com
Sat Sep 17 13:38:32 CEST 2011


On Saturday 17 September 2011, 12:41:17, mukesh tiwari wrote:
> 
> > Does there exist an unversioned ghc? What does
> > 
> > $ which ghc
> > 
> > print?
> 
>  It prints nothing .

Okay, since cabal defaults to looking for plain "ghc" when no compiler is 
explicitly passed, that explains why it didn't work without --with-compiler

Normally, when ghc is installed, it creates versionless symlinks to the 
actual scripts/binaries, so there should be symbolic links

ghc, ghci, ghc-pkg

to the versioned things (and haddock->haddock-ghc-7.2.1, 
runhaskell->runghc), many programmes expect unversioned tools by default.

It might be that your install is broken, but probably creating the symlinks 
yourself (read the ln man-page and be careful when you create them) will be 
enough.

> 
> ntro at ntro-HP-dx2480-MT-NA121PA:/usr/local/bin$ ls ghc*
> ghc-7.2.1  ghci-7.2.1  ghc-pkg-7.2.1

Those should be linked to.

> 
> ntro at ntro-HP-dx2480-MT-NA121PA:/usr/local/bin$ ls
> django-admin.py  eggy       eric4-compare    eric4-doc
> eric4-pluginrepository  eric4-re          eric4-trpreviewer
> eric4-webbrowser  ghc-pkg-7.2.1      hp2ps   runghc      spyder
> Editra           eric4      eric4-configure  eric4-editor
> eric4-pluginuninstall   eric4-sqlbrowser  eric4-uipreviewer
> ghc-7.2.1         haddock            hpc     runhaskell  UTscapy
> Editra.pyw       eric4-api  eric4-diff       eric4-plugininstall
> eric4-qregexp           eric4-tray        eric4-unittest
> ghci-7.2.1        haddock-ghc-7.2.1  hsc2hs  scapy
> 
> So should i delete ghc-6.12.1 from /var/lib

Optional. It shouldn't cause any problems (unless you need the space).

> and move the ghc-7.2.1 from
> /usr/local/lib to /var/lib to execute cabal install <pkg-name> -v
> --dry-run ?

No, leave /usr/local/lib where it is, moving it would cause massive 
breakage. For example, /usr/bin/ghc-7.2.1 expects the libraries and 
binaries there.

The only problem was that cabal looked for "ghc" which no longer exists on 
your path. That fact is somewhat dubious, as normally installing ghc 
creates the symlinks, but creating them is probably all that's needed if 
invoking ghc-7.2.1 works.

> As /usr/local/bin is already in the path i don't need to
> move any files from here. Am i correct  ?

Don't move anything. If your ghc-7.2.1 is broken, you will need to 
reinstall (that or another version), otherwise you can work with always 
using (and passing) the explicit version or, more conveniently, create the 
expected symlinks.

Cheers,
Daniel




More information about the Haskell-Cafe mailing list