in reply to Installing Pugs via CPAN shell (How to call specific ghc version)

The "bug"/undocumented feature/behaviour is in the Pugs distribution, in the subroutine assert_ghc:

sub assert_ghc { my $self = shift; my $ghc = $self->can_run($ENV{GHC} || ( 'ghc' . $Config{_exe} ) ); ...

It tries to find the ghc executable, or whatever you export in your environment as GHC. So in theory, the installation should work for you if you do:

GHC=`which ghc-6.4.1` export GHC cpan Pugs

Replies are listed 'Best First'.
Re^2: Installing Pugs via CPAN shell (How to call specific ghc version)
by neversaint (Deacon) on Oct 18, 2006 at 10:56 UTC
    Corion,

    Thanks for the pointer. Now my machine can recognize the latest GHC. But I still encounter such problem. Any idea why?
    Writing Makefile for Span Writing Makefile for Test Writing Makefile for Test::Builder Writing Makefile for Text::Glob Writing Makefile for Tree Writing Makefile for URI Writing Makefile for WTemplate Writing Makefile for Perl6::Pugs *** Enter 'make' to build Pugs. If compilation is too slow, consider using 'make unoptimized' instead. cp lib/pugs/hack.pod /home/neversaint/.cpan/build/Perl6-Pugs-6.2.9/bli +b/lib/pugs/hack.pod cp lib/Perl6/Pugs.pm /home/neversaint/.cpan/build/Perl6-Pugs-6.2.9/bli +b/lib/Perl6/Pugs.pm cp lib/pugs/run.pod /home/neversaint/.cpan/build/Perl6-Pugs-6.2.9/blib +/lib/pugs/run.pod cp lib/Inline/Pugs.pm /home/neversaint/.cpan/build/Perl6-Pugs-6.2.9/bl +ib/lib/Inline/Pugs.pm cp lib/Perl6/MakeMaker.pm /home/neversaint/.cpan/build/Perl6-Pugs-6.2. +9/blib/lib/Perl6/MakeMaker.pm /usr/bin/perl -Iinc -Iutil -MPugsConfig -e "PugsConfig->write_config_m +odule" > src/Pugs/Config.hs /home/neversaint/.ghc/bin/ghc-6.4.1 -O0 -o src/gen_prelude src/gen_pre +lude.hs /home/neversaint/.ghc/bin/hsc2hs-6.4.1 -Isrc/syck src/Data/Yaml/Syck +.hsc make: /home/neversaint/.ghc/bin/hsc2hs-6.4.1: Command not found make: *** [src/Data/Yaml/Syck.hs] Error 127 make: *** Waiting for unfinished jobs.... /usr/bin/make -j3 -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible


    ---
    neversaint and everlastingly indebted.......

      The output is fairly clear:

      make: /home/neversaint/.ghc/bin/hsc2hs-6.4.1: Command not found

      So, there seems to be no file under the name /home/neversaint/.ghc/bin/hsc2hs-6.4.1, or the file is not executable. Most likely your installation of ghc is not complete or that tool needs to be built manually. I'm no expert in compiling and installing Pugs, so I recommend you take your problems to the maintainers of Pugs.

      wild guess, since I don't know about your environment and I'm also not proficient in building pugs... Seems like ghc is living in ~/.ghc/bin. You've set
      GHC=`which ghc-6.4.1` export GHC cpan Pugs

      according to Corion's advice. Now the building system is looking for hsc2hs-6.4.1 - provide it. Look for hsc2hs in ~/.ghc/bin and make a symlink to it as hsc2hs-6.4.1

      Or undefine the environment variable GHC and prepend your haskell directory to your path: PATH=~/.ghc/bin:$PATH so that the right haskell compiler is found (and the plain hsc2hs). Hope that's close to accurate and helpful ;-)

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
        Dear shmem,
        Look for hsc2hs in ~/.ghc/bin and make a symlink to it as hsc2hs-6.4.1
        What's the command with symlink to do that? Sorry, I'm not experienced with symlink.
        Or undefine the environment variable GHC and prepend your haskell directory to your path: PATH=~/.ghc/bin:$PATH so that the right haskell compiler is found (and the plain hsc2hs).
        I already have that in my .bash_profile:
        export PATH=$PATH:$HOME/.octave/bin:$HOME/.ghc/bin:
        And my ~/.ghc/bin directory has this:
        [neversaint@voyager bin]$ pwd /home/neversaint/.ghc/bin [neversaint@voyager bin]$ ll -h total 700K lrwxrwxrwx 1 neversaint neversaint 9 Oct 18 17:28 ghc -> ghc-6.4.1 -rwxr-xr-x 1 neversaint neversaint 334 Oct 18 17:28 ghc-6.4.1 lrwxrwxrwx 1 neversaint neversaint 10 Oct 18 17:28 ghci -> ghci-6.4 +.1 -rwxr-xr-x 1 neversaint neversaint 349 Oct 18 17:28 ghci-6.4.1 lrwxrwxrwx 1 neversaint neversaint 13 Oct 18 17:28 ghc-pkg -> ghc-p +kg-6.4.1 -rwxr-xr-x 1 neversaint neversaint 373 Oct 18 17:28 ghc-pkg-6.4.1 -rwxr-xr-x 1 neversaint neversaint 7.2K Oct 18 17:28 ghcprof -rwxr-xr-x 1 neversaint neversaint 33K Oct 18 17:28 hp2ps -rwxr-xr-x 1 neversaint neversaint 583 Oct 18 17:28 hsc2hs -rwxr-xr-x 1 neversaint neversaint 313K Oct 18 17:28 runghc -rwxr-xr-x 1 neversaint neversaint 313K Oct 18 17:28 runhaskell


        ---
        neversaint and everlastingly indebted.......
      make: /home/neversaint/.ghc/bin/hsc2hs-6.4.1: Command not found make: *** src/Data/Yaml/Syck.hs Error 127

      I got this same error when trying to build it manually. I fiddled around and finally gave up.

      I was going to ask when the version of Perl6 will be ready that builds as easily and well as Perl5, based just on 'c'.


      I'm not really a human, but I play one on earth. Cogito ergo sum a bum
        And I was going to answer that, based on my experience with Perl and C, it takes at least ten years of blood, sweat, and tearing your hair out to get to that point. So you can start complaining about the rough spots in, oh, make it another four years or so. :-)