[Haskell-cafe] Building NDP with latest GHC

Austin Seipp mad.one at gmail.com
Mon Jul 21 04:47:53 EDT 2008


Hi,

After my last issue with GHC's HEAD, I tried checking it out again and
getting the patches for the libraries and lo and behold, it worked. So
now I'm up to date with the latest libraries and the compiler, but it
appears that building NDP itself is proving to be troublesome.

(This is on GHC 6.9.20080720, btw)

I've pulled the latest ndp package from
http://darcs.haskell.org/packages/ndp into ./libraries.

Instructions that are listed in [1]:

> % cd libraries
> % darcs get http://darcs.haskell.org/packages/ndp/
> % make make.library.ndp
> % cd ndp/examples
> % make

This fails on step 3; the Makefile in the libraries subdirectory
doesn't recognize 'make.library.ndp' as a valid target.

Instructions in the actual README that comes with package ndp:

> cd ndp
> make boot
> make
> cd examples
> make

This fails on the 'make boot' step, because if you look at the
Makefile, it thinks the top of the GHC source tree is at '..', when
it's actually '../..' in relation to ./libraries/ndp:

> TOP=..
> include $(TOP)/mk/boilerplate.mk
> include ndp.mk
> ... rest of makefile ...

No big deal in this case, just a fix of changing TOP to '../..'
Having done that, however, now it fails because it it cannot correctly
parse bootstrapping.conf which is located in ./libraries:

> $ make boot
> ../../mk/target.mk:454: warning: overriding commands for target `libHSndp'
> ../../mk/package.mk:249: warning: ignoring old commands for target `libHSndp'
> ../../mk/target.mk:454: warning: overriding commands for target `ghc-prim.a'
> ../../mk/package.mk:249: warning: ignoring old commands for target `ghc-prim.a'
> /Users/austinseipp/src/ghc-head/ghc/stage1-inplace/bin/ghc -M
> -optdep-f -optdep.depend  -osuf o -package-conf
> /Users/austinseipp/src/ghc-head/libraries/bootstrapping.conf    -H32m
> -O -fasm -Rghc-timing -package-name ndp ghc-prim-0.1 -O -fgenerics
> -package base -XGenerics -fglasgow-exts -fbang-patterns -O2
> -funbox-strict-fields -fdicts-cheap -fno-method-sharing
> -fno-spec-constr-threshold -fmax-simplifier-iterations20 -threaded
> -XTypeFamilies -fcpr-off
> 
> ... lots of files trying to get compiled here ...
> 
> <no location info>:
>     Warning: -fgenerics is deprecated: Use the Generics language
>     instead
> 
> <no location info>:
>     Warning: -fbang-patterns is deprecated: Use the BangPatterns
>     language instead
> ghc:
> /Users/austinseipp/src/ghc-head/libraries/bootstrapping.conf:1:62:
>     parse error on input `"'
> <<ghc: 41436660 bytes, 4 GCs, 118784/118784 avg/max bytes residency (1
> samples), 31M in use, 0.00 INIT (0.00 elapsed), 0.08 MUT (0.12
> elapsed), 0.01 GC (0.02 elapsed) :ghc>>
> make: *** [depend] Error 1

For the record, the thing it fails on is the *first* occurance of a
quotation mark, and that's here in bootstrapping.conf:

> [InstalledPackageInfo {package = PackageIdentifier {pkgName =
> "filepath", pkgVersion = ...

So it's failing when it sees the quote at the start of "filepath"

I have also attempted to follow the instructions at the top
./libraries/Makefile, which are:

> # To do a fresh build:
> #
> #   make clean
> #   make boot
> #   make
> #
> # To rebuild a particular library <package>:
> #
> #   make clean.library.<package>
> #   make make.library.<package>
> #
> # or the following is equivalent:
> #
> #   make remake.library.<package>
> #
> # To add a new library to the tree, do
> #
> #   darcs get http://darcs.haskell.org/packages/foo
> #   [ -e foo/configure.ac ] && ( cd foo && autoreconf )
> #   make make.library.foo

As said above, 'make.library.ndp' does not work, doing a full clean,
boot and then make again doesn't pick up NDP either, and in the last
case (adding a new library,) it doesn't matter because there is no
configure.ac at the top level of ./libraries/ndp

I think I might simply have a *lot* of outdated information. For the
record, this is what I want to try and compile:

> {-# OPTIONS_GHC -fglasgow-exts -fparr -fvectorise #-}
> module Main where
> import GHC.PArr
> 
> dotp :: Num a => [:a:] -> [:a:] -> a
> dotp xs ys = sumP [:x * y | x <- xs, y <- ys :]
> 
> main = print $ dotp [:1..5:] [:6..10:]

Naturally when trying, it fails because DPH isn't there:

> $ ~/ghc-head/bin/ghc --make dotp.hs
> 
> <no location info>:
>     Warning: -fparr is deprecated: Use the PArr language instead
> [1 of 1] Compiling Main             ( dotp.hs, dotp.o )
> GHC error in desugarer lookup in main:Main:
>   Failed to load interface for `Data.Array.Parallel.Lifted.PArray':
>     no package matching dph-par was found
> ghc: panic! (the 'impossible' happened)
>   (GHC version 6.9.20080720 for i386-apple-darwin):
>   initDs user error (IOEnv failure)
> 
> Please report this as a GHC bug:
> http://www.haskell.org/ghc/reportabug

(This leads me to believe I actually want
http://darcs.haskell.org/packages/dph, but it's not mentioned. Anywhere.)

If I'm just doing everything wrong, I'd really appreciate knowing and
I'd be *more* than happy to update the wiki pages so that more people
can try it and have it build successfuly, because as it stands I'm
coming to the conclusion that basically all the information in [1] is
just old and flat-out wrong, and I'm completely of ideas on how to go
about this.

Thanks,
Austin

[1] http://haskell.org/haskellwiki/Data_Parallel_Haskell/PackageNDP


More information about the Haskell-Cafe mailing list