help-guix
[Top][All Lists]
Advanced

[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
/gnu/store/bb9alx1ap57pz0vmx7p1r8qk0lxxfg3x-glibc-locales-2.28
gcc-toolchain 9.1.0 out
/gnu/store/aqv6njg05w2yqh8krgrjy0wcbfxb4nn3-gcc-toolchain-9.1.0
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"
> EOF
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
GUIX_LD_WRAPPER_ALLOW_IMPURITIES=y
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
/home/user/programs/haskell/test/dist-newstyle/build/x86_64-linux/ghc-8.4.3/test-0.1.0.0/x/test/build/test/test:
error while loading shared libraries: libgmp.so.10: 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-0.1.0.0/x/test/build/test/test
linux-vdso.so.1 (0x00007ffda1196000)
libm.so.6 =>
/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/libm.so.6
(0x00007fc873fb7000)
libgmp.so.10 => not found
librt.so.1 =>
/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/librt.so.1
(0x00007fc873fad000)
libdl.so.2 =>
/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/libdl.so.2
(0x00007fc873fa8000)
libffi.so.6 => not found
libpthread.so.0 =>
/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/libpthread.so.0
(0x00007fc873f85000)
libgcc_s.so.1 =>
/gnu/store/cicj9bp1gvn318yakqv5g871m45xyr4d-gcc-5.5.0-lib/lib/libgcc_s.so.1
(0x00007fc873f6c000)
libc.so.6 =>
/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/libc.so.6
(0x00007fc873db3000)
/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib/ld-linux-x86-64.so.2
=>
/gnu/store/c43rbmzv1laxgbnkvf76hx4305n4206a-glibc-2.28/lib/ld-linux-x86-64.so.2
(0x00007fc87413a000)
[guix] user@machine:~/programs/haskell/test$ ls
$GUIX_ENVIRONMENT/lib/libgmp.so.10
/gnu/store/b3ylzbkq1wwn3vy5kj4ywridyd08dxvv-profile/lib/libgmp.so.10
[guix] user@machine:~/programs/haskell/test$ ls
$GUIX_ENVIRONMENT/lib/libffi.so.6
/gnu/store/b3ylzbkq1wwn3vy5kj4ywridyd08dxvv-profile/lib/libffi.so.6

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]