[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues with Haskell's ghc

From: Prateem Mandal
Subject: Re: Issues with Haskell's ghc
Date: Sun, 4 Aug 2019 11:41:37 -0700

Initially gcc-toolchain was also in adhoc list. Now I have installed it as
well. Here are the steps I took

Haskell Steps (doesn't work)
0. Initial state
user@machine:~$ guix package -I
hello 2.10 out /gnu/store/md2plii4g5sk66wg9cgwc964l3xwhrm9-hello-2.10
emacs 26.2 out /gnu/store/fbf0h779z46cl55vdciv00m8s0ccfnyb-emacs-26.2
bash 4.4.23 out /gnu/store/qn1ax1fkj16x280m1rv7mcimfmn9l2pf-bash-4.4.23
guile 2.2.6 out /gnu/store/zp53jz14ql8syglh4nyrwmq2awvfirb8-guile-2.2.6
glibc-locales 2.28 out
gcc-toolchain 9.1.0 out
1. Create project folder
user@machine:~/programs/haskell/$ mkdir test
user@machine:~/programs/haskell/$ cd test
2. Create a simple Main.hs file
user@machine:~/programs/haskell/test$ cat <<EOF >> Main.hs
> main :: IO ()
> main = putStrLn "Hello"
3. Open a guix environment
user@machine:~/programs/haskell/test$ guix environment --ad-hoc
cabal-install coreutils gcc-toolchain ghc binutils glibc gmp libffi
[guix] user@machine:~/programs/haskell/test$
4. Set/Unset few env variables required to build haskell
[guix] user@machine:~/programs/haskell/test$ unset GHC_PACKAGE_PATH
[guix] user@machine:~/programs/haskell/test$ export
5. Create .cabal file using "cabal init"
[guix] user@machine:~/programs/haskell/test$ cabal init
6. Update cabal
[guix] user@machine:~/programs/haskell/test$ cabal update
7. Build project
[guix] user@machine:~/programs/haskell/test$ cabal new-build
8. Execute project
[guix] user@machine:~/programs/haskell/test$ cabal new-exec test
error while loading shared libraries: cannot open shared
object file: No such file or directory
[guix] user@machine:~/programs/haskell/test$ ldd
dist-newstyle/build/x86_64-linux/ghc-8.4.3/test- (0x00007ffda1196000) =>
(0x00007fc873fb7000) => not found =>
(0x00007fc873fad000) =>
(0x00007fc873fa8000) => not found =>
(0x00007fc873f85000) =>
(0x00007fc873f6c000) =>
[guix] user@machine:~/programs/haskell/test$ ls
[guix] user@machine:~/programs/haskell/test$ ls

On Sun, Aug 4, 2019 at 5:35 AM Ricardo Wurmus <address@hidden> wrote:

> Prateem Mandal <address@hidden> writes:
> >> I've run aground with Haskell's ghc (interpreter works fine) - running
> >> ghc on a basic hello world program fails.  I identified couple issues:
> >>
> >>  - Include directory for linux headers wasn't passed to gcc
> >>    (`C_INCLUDE_PATH=/gnu/... ghc` fixed it)
> >>  - Lib C's crti.o and crt1.o where not found during linking
> >>    (fixed with `LIBRARY_PATH=/gnu/... ghc`)
> >>  - libgmp and libffi aren't passed to linker's -rpath
> >>
> >> If anybody uses Haskell here, i'd appreciate any insights on what might
> >> be the root cause here.
> >
> > I am facing the same issue. I could resolve the second issue including
> > glibc in the ad-hoc list while creating the environment (and I never
> > hit the first issue). However I am now stuck with the third issue. In
> > the original thread there was no resolution to this issue. Any idea
> > how this can be fixed?
> Installing the “gcc-toolchain” package should be sufficient.  Have you
> tried that?
> --
> Ricardo

reply via email to

[Prev in Thread] Current Thread [Next in Thread]