all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Issues with Haskell's ghc
@ 2019-07-01 17:18 Vasilii Kolobkov
  2019-07-01 21:43 ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Vasilii Kolobkov @ 2019-07-01 17:18 UTC (permalink / raw)
  To: help-guix

Hello guix!

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.

Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues with Haskell's ghc
  2019-07-01 17:18 Vasilii Kolobkov
@ 2019-07-01 21:43 ` Ricardo Wurmus
  2019-07-02 12:50   ` Vasilii Kolobkov
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2019-07-01 21:43 UTC (permalink / raw)
  To: Vasilii Kolobkov; +Cc: help-guix


Hi Vasilii,

> 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`)

These two points sound like “gcc-toolchain” should be installed
alongside GHC.

--
Ricardo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues with Haskell's ghc
  2019-07-01 21:43 ` Ricardo Wurmus
@ 2019-07-02 12:50   ` Vasilii Kolobkov
  0 siblings, 0 replies; 6+ messages in thread
From: Vasilii Kolobkov @ 2019-07-02 12:50 UTC (permalink / raw)
  To: help-guix

Ricardo Wurmus <rekado@elephly.net> 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`)
>
> These two points sound like “gcc-toolchain” should be installed
> alongside GHC.

Much thanks, Ricardo, missing gcc-toolchain it was!

Does anybody know why ghc doesn't have gcc-toolchain among it's
dependencies?  In the unlikely case of it being an unintended situation,
i'd be up for fixing it.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues with Haskell's ghc
@ 2019-08-03 10:15 Prateem Mandal
  2019-08-04 12:35 ` Ricardo Wurmus
  0 siblings, 1 reply; 6+ messages in thread
From: Prateem Mandal @ 2019-08-03 10:15 UTC (permalink / raw)
  To: help-guix

Hi,

I could not figure out how to respond to an existing thread so I reused the
subject line and below is the copy of email body sent on July 1, 2019 by
Vasilii Kolobkov

> 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?

Thanks
Prateem

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues with Haskell's ghc
  2019-08-03 10:15 Issues with Haskell's ghc Prateem Mandal
@ 2019-08-04 12:35 ` Ricardo Wurmus
  2019-08-04 18:41   ` Prateem Mandal
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2019-08-04 12:35 UTC (permalink / raw)
  To: Prateem Mandal; +Cc: help-guix


Prateem Mandal <prateem@gmail.com> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Issues with Haskell's ghc
  2019-08-04 12:35 ` Ricardo Wurmus
@ 2019-08-04 18:41   ` Prateem Mandal
  0 siblings, 0 replies; 6+ messages in thread
From: Prateem Mandal @ 2019-08-04 18:41 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix

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 <rekado@elephly.net> wrote:

>
> Prateem Mandal <prateem@gmail.com> 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
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-04 18:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-03 10:15 Issues with Haskell's ghc Prateem Mandal
2019-08-04 12:35 ` Ricardo Wurmus
2019-08-04 18:41   ` Prateem Mandal
  -- strict thread matches above, loose matches on Subject: below --
2019-07-01 17:18 Vasilii Kolobkov
2019-07-01 21:43 ` Ricardo Wurmus
2019-07-02 12:50   ` Vasilii Kolobkov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.