all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* compile
@ 2022-04-02 18:46 marioBB via
  2022-05-02  9:30 ` compile zimoun
  0 siblings, 1 reply; 4+ messages in thread
From: marioBB via @ 2022-04-02 18:46 UTC (permalink / raw)
  To: help-guix@gnu.org

Hi Guix community,
I hope that someone here can help me.
I play around ghc compilation using guix ghc-* packages, but I've got a problem.
When I install some ghc package (guix install ghc-*)
I'd like to use it in this way 'ghc -o output HelloWorld.hs -package ghc-*
I've got an error `: cannot satisfy -package zstd` (in this example I've tried to use zstd)
'ghc-pkg list' and 'ghc-pkg describe ' show that the package is available for ghc.
Some suggestions?

Cheers
Mario

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

* Re: compile
  2022-04-02 18:46 compile marioBB via
@ 2022-05-02  9:30 ` zimoun
  2022-05-02 19:04   ` compile marioBB
  0 siblings, 1 reply; 4+ messages in thread
From: zimoun @ 2022-05-02  9:30 UTC (permalink / raw)
  To: marioBB, help-guix@gnu.org

Hi,

On Sat, 02 Apr 2022 at 18:46, marioBB via <help-guix@gnu.org> wrote:

> I play around ghc compilation using guix ghc-* packages, but I've got a problem.
> When I install some ghc package (guix install ghc-*)
> I'd like to use it in this way 'ghc -o output HelloWorld.hs -package ghc-*
> I've got an error `: cannot satisfy -package zstd` (in this example I've tried to use zstd)
> 'ghc-pkg list' and 'ghc-pkg describe ' show that the package is available for ghc.
> Some suggestions?

Could you be more precise about which ghc- packages you installed and
trying to use?


Cheers,
simon


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

* Re: compile
  2022-05-02  9:30 ` compile zimoun
@ 2022-05-02 19:04   ` marioBB
  2022-05-02 20:21     ` compile zimoun
  0 siblings, 1 reply; 4+ messages in thread
From: marioBB @ 2022-05-02 19:04 UTC (permalink / raw)
  To: zimoun; +Cc: help-guix@gnu.org

> On Sat, 02 Apr 2022 at 18:46, marioBB via help-guix@gnu.org wrote:
>
> > I play around ghc compilation using guix ghc-* packages, but I've got a problem.
> > When I install some ghc package (guix install ghc-)
> > I'd like to use it in this way 'ghc -o output HelloWorld.hs -package ghc-
> > I've got an error `: cannot satisfy -package zstd` (in this example I've tried to use zstd)
> > 'ghc-pkg list' and 'ghc-pkg describe ' show that the package is available for ghc.
> > Some suggestions?
>
>
> Could you be more precise about which ghc- packages you installed and
> trying to use?

Hi Simon,

thank you for answering to my issue.

I chose arbitrary package (here `zstd`)

I used manifest file with:

(specifications->manifest
  '("ghc@8.10.7"
    "ghc-zstd"))

$ guix shell
$ ghc-pkg list |grep zstd

I got:
 /gnu/store/gagi2sh0wma9vxbdl3dzgdwc64jfqd6r-profile/lib/ghc-8.10.7/ghc-zstd-0.1.3.0
    zstd-0.1.3.0

$ ghc -o output -package zstd Source.hs

where Source.hs is
--
import Codec.Compression.Zstd

main = pure ()
--

I got a message:

Loaded package environment from /home/ms/.ghc/x86_64-linux-8.10.7/environments/default
<command line>: cannot satisfy -package zstd
    (use -v for more information)

I don't have experience in invoking ghc directly maybe I missed something.

But the question is What do I try to achieve?

Use guix as building and packaging system for Haskell software without using Cabal, Stack.
Just pure execution ghc compiler using Guix.

Cheers,
Mario



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

* Re: compile
  2022-05-02 19:04   ` compile marioBB
@ 2022-05-02 20:21     ` zimoun
  0 siblings, 0 replies; 4+ messages in thread
From: zimoun @ 2022-05-02 20:21 UTC (permalink / raw)
  To: marioBB; +Cc: help-guix@gnu.org

Hi Mario,

On Mon, 02 May 2022 at 19:04, marioBB <marJobb@protonmail.com> wrote:

> I used manifest file with:
>
> (specifications->manifest
>   '("ghc@8.10.7"
>     "ghc-zstd"))
>
> $ guix shell

[...]

> Loaded package environment from /home/ms/.ghc/x86_64-linux-8.10.7/environments/default
> <command line>: cannot satisfy -package zstd
>     (use -v for more information)

Well, I do not know what is wrong with your Guix config but something is
wrong.  I guess you installed Haskell packages via another method
(stack?) and they are in ~/.ghc; and I guess ztsd is not part of the
ones you installed via this very method. ;-)

If you run ’guix shell --pure’ or ’cp Source.hs /tmp/; cp guix.scm
/tmp/; cd /tmp; guix shell -C -- ghc Source’, then you will see.


For instance, consider the snippet:

--8<---------------cut here---------------start------------->8---
$ cat Source.hs
import Codec.Compression.Zstd

main = pure ()

$ guix shell ghc ghc-zstd -C -- ghc Source
[1 of 1] Compiling Main             ( Source.hs, Source.o )

<no location info>: error:
    Warning: Couldn't figure out C compiler information!
             Make sure you're using GNU gcc, or clang
ghc: could not execute: gcc
--8<---------------cut here---------------end--------------->8---

Well, contrary to ’haskell-platform’ which provides a ready-to-use
computational environment, it is not the case with Guix.  Something to
improve. :-)

As you see, it also requires ’gcc-toolchain’.  However, I get,

--8<---------------cut here---------------start------------->8---
$ guix shell ghc ghc-zstd -C gcc-toolchain -- ghc Source
[1 of 1] Compiling Main             ( Source.hs, Source.o )
Linking Source ...
ld: cannot find -lHSzstd-0.1.3.0-4d3LhFnhVBND893zIj2UnM
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
--8<---------------cut here---------------end--------------->8---

which is unexpected.  I do not know what could be wrong.


Sorry, it does not help. :-(

Cheers,
simon


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

end of thread, other threads:[~2022-05-02 20:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-02 18:46 compile marioBB via
2022-05-02  9:30 ` compile zimoun
2022-05-02 19:04   ` compile marioBB
2022-05-02 20:21     ` compile zimoun

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.