Question about ghc and cabal: finding packages

Hi everyone, I have installed ghc 6.12.3 and the Haskell platform; now, when I install packages from hackage using cabal install <package-name>, they get installed in ~/.cabal, which is fair enough. However, when I call a runhaskell Setup.lhs configure that used to work on a different computer with the same software setup, ghc (or is it cabal?) complains that it cannot find the packages I have just installed. Checking again revealed that they are indeed installed, just not in the ghc installation directory, but under ~/.cabal. How can I tell cabal and/or ghc where to look for libraries? Thanks, again, for any help! Christian

If you install a package through cabal install, it will automatically
register with GHC (it works the same way that gems works on ruby for
example)
Using runhaskell <commands> is whats used when manually building/configuring
packages (for example creating archlinux packages from cabal packages from
hackage) or when you are developing and creating cabal packages yourself
(in other words, when you do cabal install, cabal internally does all the
commands for configuring/checking dependencies/building and installing)
So you should be able to use use the package instantly after you install it
(you can also use ghc-pkg list to check all installed packages)
On Thu, Aug 19, 2010 at 7:12 AM, C Gosch
Hi everyone, I have installed ghc 6.12.3 and the Haskell platform; now, when I install packages from hackage using cabal install <package-name>, they get installed in ~/.cabal, which is fair enough. However, when I call a runhaskell Setup.lhs configure that used to work on a different computer with the same software setup, ghc (or is it cabal?) complains that it cannot find the packages I have just installed. Checking again revealed that they are indeed installed, just not in the ghc installation directory, but under ~/.cabal. How can I tell cabal and/or ghc where to look for libraries?
Thanks, again, for any help! Christian
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Thu, 19 Aug 2010 09:12:49 +0200, C Gosch
Hi everyone, I have installed ghc 6.12.3 and the Haskell platform; now, when I install packages from hackage using cabal install <package-name>, they get installed in ~/.cabal, which is fair enough. However, when I call a runhaskell Setup.lhs configure that used to work on a different computer with the same software setup, ghc (or is it cabal?) complains that it cannot find the packages I have just installed. Checking again revealed that they are indeed installed, just not in the ghc installation directory, but under ~/.cabal. How can I tell cabal and/or ghc where to look for libraries?
Thanks, again, for any help! Christian
The command "cabal install " installs a package locally by default, whereas "runhaskell Setup" installs globally. When installing globally, the local packages are ignored. Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html --

Try simply
cabal configure
in the directory where Setup.lhs (and your .cabal file) is located.
/J
On 19 August 2010 09:12, C Gosch
Hi everyone, I have installed ghc 6.12.3 and the Haskell platform; now, when I install packages from hackage using cabal install <package-name>, they get installed in ~/.cabal, which is fair enough. However, when I call a runhaskell Setup.lhs configure that used to work on a different computer with the same software setup, ghc (or is it cabal?) complains that it cannot find the packages I have just installed. Checking again revealed that they are indeed installed, just not in the ghc installation directory, but under ~/.cabal. How can I tell cabal and/or ghc where to look for libraries?
Thanks, again, for any help! Christian
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Thursday 19 August 2010 13:19:26, Jonas Almström Duregård wrote:
Try simply
cabal configure
in the directory where Setup.lhs (and your .cabal file) is located.
/J
Or, to configure, build and install in one go, just `cabal install' in that directory. If you want to go the runhaskell Setup.[l]hs road, however, you have to pass the --user flag to runhaskell Setup.[l]hs configure if you need packages from your user db. Or you have to reinstall the cabal-installed packages globally (surprise: pass the --global flag to cabal install), perhaps set `user-install: False' in ~/.cabal/config if you want to have global installs by default.
On 19 August 2010 09:12, C Gosch
wrote: Hi everyone, I have installed ghc 6.12.3 and the Haskell platform; now, when I install packages from hackage using cabal install <package-name>, they get installed in ~/.cabal, which is fair enough. However, when I call a runhaskell Setup.lhs configure that used to work on a different computer with the same software setup, ghc (or is it cabal?) complains that it cannot find the packages I have just installed. Checking again revealed that they are indeed installed, just not in the ghc installation directory, but under ~/.cabal. How can I tell cabal and/or ghc where to look for libraries?
Thanks, again, for any help! Christian

Thanks guys for the helpful comments!
I will try the "cabal configure" way tonight.
Cheers!
Christian
2010/8/19 Daniel Fischer
On Thursday 19 August 2010 13:19:26, Jonas Almström Duregård wrote:
Try simply
cabal configure
in the directory where Setup.lhs (and your .cabal file) is located.
/J
Or, to configure, build and install in one go, just `cabal install' in that directory. If you want to go the runhaskell Setup.[l]hs road, however, you have to pass the --user flag to runhaskell Setup.[l]hs configure if you need packages from your user db. Or you have to reinstall the cabal-installed packages globally (surprise: pass the --global flag to cabal install), perhaps set `user-install: False' in ~/.cabal/config if you want to have global installs by default.
On 19 August 2010 09:12, C Gosch
wrote: Hi everyone, I have installed ghc 6.12.3 and the Haskell platform; now, when I install packages from hackage using cabal install <package-name>, they get installed in ~/.cabal, which is fair enough. However, when I call a runhaskell Setup.lhs configure that used to work on a different computer with the same software setup, ghc (or is it cabal?) complains that it cannot find the packages I have just installed. Checking again revealed that they are indeed installed, just not in the ghc installation directory, but under ~/.cabal. How can I tell cabal and/or ghc where to look for libraries?
Thanks, again, for any help! Christian
participants (5)
-
C Gosch
-
Daniel Fischer
-
Henk-Jan van Tuyl
-
Jonas Almström Duregård
-
Mathew de Detrich