Re: Glasgow-haskell-users Digest, Vol 212, Issue 5

2021-10-11 Thread Dominic Steinitz
Hi David

I am a long time user of ghc on OSX. I have seen that problem but never on 
native OSX only when using nix (and then I added it explicitly).

Two things spring to mind:
Add it explicitly on the compile command `-liconv`
Use nix and then you can control the build environment in a totally 
controllable and reproducible manner. This is actually easier than it sounds: 
`curl https://nixos.org/nix/install | sh` and `nix-env -I ghc`. If you get the 
same error with that then we can try adding `iconv` explicitly.
 Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.org
Twitter: @idontgetoutmuch

> 
> I have a conundrum on which advice would be appreciate. Does
> anyone know how to successfully install ghc on OSX
> I've tried various binary instalation routes:
> macports, brew, direct binary downloads from haskel.org
> All have the same result. when I try to compile a basic hello world program
> I get
> 
> Undefined symbols for architecture x86_64:
>  "_iconv", referenced from:
> 
> 
> I've triedgiong  through ghcup
> 
> 8.8.4
> 8.6.5.
> 8.10.2
> 8.10.7
> 9.0.1
> 
> all have the same problem.
> I'd be happy to build from source. Small problem: what Haskell compiler do
> I use?
> 
> Any advice on installs that works along with any changes to paths to avoid
> the iconv problems would be appreciated as currently my Haskell-related
> activities have come to a grinding halt. Switchig to a different OS would
> be nice but its not a
> feasible option a at present.Writing a compiler is starting to look
> attractive..
> 
> thanks
> David
> 
> -- 
> David Duke
> Emeritus Professor of Computer Science
> School of Computing University of Leeds UK
> E:duke.j.da...@gmail.com
> W:https://engineering.leeds.ac.uk/staff/334/Professor_David_Duke

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: accelerate-llvm problems

2017-03-03 Thread dominic
I created an issue here: https://github.com/bscarlet/llvm-general/issues/207

> On 3 Mar 2017, at 16:44, Dominic Steinitz  wrote:
> 
> Hi Trevor,
> 
> I installed llvm with shared libraries:
> 
>> brew install llvm --with-shared-libs
> 
> But I now get
> 
>> llvm-general/llvm-general $ git branch
>> git branch
>>   llvm-3.8
>> * llvm-3.9
>>   master
> 
> 
> 
>> cabal configure -fshared-llvm --extra-lib-dirs=/usr/local/opt/llvm/lib 
>> --extra-include-dirs=/usr/local/opt/llvm/include
>> Warning: The package list for 'hackage.haskell.org 
>> <http://hackage.haskell.org/>' is 30 days old.
>> Run 'cabal update' to get the latest list of available packages.
>> Resolving dependencies...
>> Configuring llvm-general-3.9.0.0...
>> Warning: Instead of 'cc-options: -I/usr/local/Cellar/llvm/3.9.1/include' use
>> 'include-dirs: /usr/local/Cellar/llvm/3.9.1/include'
>> setup: Missing dependency on a foreign library:
>> * Missing C library: LLVM-3.9.1
>> This problem can usually be solved by installing the system package that
>> provides this library (you may need the "-dev" version). If the library is
>> already installed but in a non-standard location then you can use the flags
>> --extra-include-dirs= and --extra-lib-dirs= to specify where it is.
> 
> Perhaps I should report this here: 
> https://github.com/bscarlet/llvm-general/issues? 
> <https://github.com/bscarlet/llvm-general/issues?>
> 
> 
>> On 21 Feb 2017, at 23:44, Trevor McDonell > <mailto:trevor.mcdon...@gmail.com>> wrote:
>> 
>> Hi Dominic,
>> 
>> You need to build/install LLVM with shared libraries.
>> 
>> Then, install llvm-general with -fshared-llvm (or, use my fork, which the 
>> stack.yaml files point to).
>> 
>> 
>> -Trev
>> 
>> P.S. On mobile, apologies for the terse reply.
>> On Wed, 22 Feb 2017 at 10:34 AM, Dominic Steinitz > <mailto:idontgetoutm...@gmail.com>> wrote:
>> I am trying to build accelerate-llvm but getting the ghc panics below. 
>> Here’s my config
>> 
>> > bash-3.2$ ghc-pkg list | grep llvm
>> > ghc-pkg list | grep llvm
>> > llvm-general-3.8.0.0
>> > llvm-general-pure-3.5.0.0
>> > llvm-general-pure-3.5.1.0
>> > llvm-general-pure-3.8.0.0
>> > bash-3.2$ ghc-pkg list | grep acc
>> > ghc-pkg list | grep acc
>> > accelerate-1.0.0.0
>> > bash-3.2$ ghc --version
>> > ghc --version
>> > The Glorious Glasgow Haskell Compilation System, version 7.10.2
>> 
>> If anyone has any ideas, I’d be very grateful.
>> 
>> > bash-3.2$ ~/Library/Haskell/bin/cabal build
>> > ~/Library/Haskell/bin/cabal build
>> > Building accelerate-llvm-1.0.0.0...
>> > Preprocessing library accelerate-llvm-1.0.0.0...
>> > ghc:
>> > lookupSymbol failed in relocateSection (RELOC_GOT)
>> > /usr/local/Cellar/llvm@3.8/3.8.1/lib/llvm-3.8/lib/libLLVMSupport.a: 
>> > unknown symbol `___dso_handle'
>> > [24 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, 
>> > dist/build/Data/Range/Range.o )
>> >
>> > :
>> > ghc: panic! (the 'impossible' happened)
>> >   (GHC version 7.10.2 for x86_64-apple-darwin):
>> >   Dynamic linker not initialised
>> >
>> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
>> > <http://www.haskell.org/ghc/reportabug>
>> >
>> > [31 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( 
>> > Data/Array/Accelerate/LLVM/Util.hs, 
>> > dist/build/Data/Array/Accelerate/LLVM/Util.o )
>> >
>> > :
>> > ghc: unable to load package `llvm-general-3.8.0.0'
>> > [32 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( 
>> > Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, 
>> > dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o )
>> >
>> > :
>> > ghc: panic! (the 'impossible' happened)
>> >   (GHC version 7.10.2 for x86_64-apple-darwin):
>> >   Dynamic linker not initialised
>> >
>> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
>> > <http://www.haskell.org/ghc/reportabug>
>> >
>> > [33 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Monad[boot] ( 
>> > Data/Array/Accelerate/LLVM/CodeGen/Monad.hs-boot, 
>> > dist/build/Data/Array/Accelerate/LLVM/CodeGen/Monad.o-boot )
>> > [34 of 52]

Fwd: accelerate-llvm problems

2017-03-03 Thread dominic


> Begin forwarded message:
> 
> From: Dominic Steinitz 
> Subject: Re: accelerate-llvm problems
> Date: 3 March 2017 at 16:44:59 GMT
> To: Trevor McDonell 
> Cc: GHC users , Ben Lippmeier 
> 
> 
> Hi Trevor,
> 
> I installed llvm with shared libraries:
> 
>> brew install llvm --with-shared-libs
> 
> But I now get
> 
>> llvm-general/llvm-general $ git branch
>> git branch
>>   llvm-3.8
>> * llvm-3.9
>>   master
> 
> 
> 
>> cabal configure -fshared-llvm --extra-lib-dirs=/usr/local/opt/llvm/lib 
>> --extra-include-dirs=/usr/local/opt/llvm/include
>> Warning: The package list for 'hackage.haskell.org 
>> <http://hackage.haskell.org/>' is 30 days old.
>> Run 'cabal update' to get the latest list of available packages.
>> Resolving dependencies...
>> Configuring llvm-general-3.9.0.0...
>> Warning: Instead of 'cc-options: -I/usr/local/Cellar/llvm/3.9.1/include' use
>> 'include-dirs: /usr/local/Cellar/llvm/3.9.1/include'
>> setup: Missing dependency on a foreign library:
>> * Missing C library: LLVM-3.9.1
>> This problem can usually be solved by installing the system package that
>> provides this library (you may need the "-dev" version). If the library is
>> already installed but in a non-standard location then you can use the flags
>> --extra-include-dirs= and --extra-lib-dirs= to specify where it is.
> 
> Perhaps I should report this here: 
> https://github.com/bscarlet/llvm-general/issues? 
> <https://github.com/bscarlet/llvm-general/issues?>
> 
> 
>> On 21 Feb 2017, at 23:44, Trevor McDonell > <mailto:trevor.mcdon...@gmail.com>> wrote:
>> 
>> Hi Dominic,
>> 
>> You need to build/install LLVM with shared libraries.
>> 
>> Then, install llvm-general with -fshared-llvm (or, use my fork, which the 
>> stack.yaml files point to).
>> 
>> 
>> -Trev
>> 
>> P.S. On mobile, apologies for the terse reply.
>> On Wed, 22 Feb 2017 at 10:34 AM, Dominic Steinitz > <mailto:idontgetoutm...@gmail.com>> wrote:
>> I am trying to build accelerate-llvm but getting the ghc panics below. 
>> Here’s my config
>> 
>> > bash-3.2$ ghc-pkg list | grep llvm
>> > ghc-pkg list | grep llvm
>> > llvm-general-3.8.0.0
>> > llvm-general-pure-3.5.0.0
>> > llvm-general-pure-3.5.1.0
>> > llvm-general-pure-3.8.0.0
>> > bash-3.2$ ghc-pkg list | grep acc
>> > ghc-pkg list | grep acc
>> > accelerate-1.0.0.0
>> > bash-3.2$ ghc --version
>> > ghc --version
>> > The Glorious Glasgow Haskell Compilation System, version 7.10.2
>> 
>> If anyone has any ideas, I’d be very grateful.
>> 
>> > bash-3.2$ ~/Library/Haskell/bin/cabal build
>> > ~/Library/Haskell/bin/cabal build
>> > Building accelerate-llvm-1.0.0.0...
>> > Preprocessing library accelerate-llvm-1.0.0.0...
>> > ghc:
>> > lookupSymbol failed in relocateSection (RELOC_GOT)
>> > /usr/local/Cellar/llvm@3.8/3.8.1/lib/llvm-3.8/lib/libLLVMSupport.a: 
>> > unknown symbol `___dso_handle'
>> > [24 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, 
>> > dist/build/Data/Range/Range.o )
>> >
>> > :
>> > ghc: panic! (the 'impossible' happened)
>> >   (GHC version 7.10.2 for x86_64-apple-darwin):
>> >   Dynamic linker not initialised
>> >
>> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
>> > <http://www.haskell.org/ghc/reportabug>
>> >
>> > [31 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( 
>> > Data/Array/Accelerate/LLVM/Util.hs, 
>> > dist/build/Data/Array/Accelerate/LLVM/Util.o )
>> >
>> > :
>> > ghc: unable to load package `llvm-general-3.8.0.0'
>> > [32 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( 
>> > Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, 
>> > dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o )
>> >
>> > :
>> > ghc: panic! (the 'impossible' happened)
>> >   (GHC version 7.10.2 for x86_64-apple-darwin):
>> >   Dynamic linker not initialised
>> >
>> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
>> > <http://www.haskell.org/ghc/reportabug>
>> >
>> > [33 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Monad[boot] ( 
>> > Data/Array/Accelerate/LLVM/CodeGen/Monad.hs-boot, 
>> >

Re: accelerate-llvm problems

2017-02-22 Thread Dominic Steinitz
No go at the moment - I am using my tiny macbook on holiday which is on too old 
a version of Xcode. When I try to upgrade it tells me I am out of space. I 
think rather than fight I will wait until I get back to a machine with more 
resources.

> On 22 Feb 2017, at 07:02, Dominic Steinitz  wrote:
> 
> Thanks - it seems I can only do this with home-brew for 3.9 - the flag is 
> ignored for 3.8 - I am building now and will report back.
> 
>> On 21 Feb 2017, at 15:44, Trevor McDonell > <mailto:trevor.mcdon...@gmail.com>> wrote:
>> 
>> Hi Dominic,
>> 
>> You need to build/install LLVM with shared libraries.
>> 
>> Then, install llvm-general with -fshared-llvm (or, use my fork, which the 
>> stack.yaml files point to).
>> 
>> 
>> -Trev
>> 
>> P.S. On mobile, apologies for the terse reply.
>> On Wed, 22 Feb 2017 at 10:34 AM, Dominic Steinitz > <mailto:idontgetoutm...@gmail.com>> wrote:
>> I am trying to build accelerate-llvm but getting the ghc panics below. 
>> Here’s my config
>> 
>> > bash-3.2$ ghc-pkg list | grep llvm
>> > ghc-pkg list | grep llvm
>> > llvm-general-3.8.0.0
>> > llvm-general-pure-3.5.0.0
>> > llvm-general-pure-3.5.1.0
>> > llvm-general-pure-3.8.0.0
>> > bash-3.2$ ghc-pkg list | grep acc
>> > ghc-pkg list | grep acc
>> > accelerate-1.0.0.0
>> > bash-3.2$ ghc --version
>> > ghc --version
>> > The Glorious Glasgow Haskell Compilation System, version 7.10.2
>> 
>> If anyone has any ideas, I’d be very grateful.
>> 
>> > bash-3.2$ ~/Library/Haskell/bin/cabal build
>> > ~/Library/Haskell/bin/cabal build
>> > Building accelerate-llvm-1.0.0.0...
>> > Preprocessing library accelerate-llvm-1.0.0.0...
>> > ghc:
>> > lookupSymbol failed in relocateSection (RELOC_GOT)
>> > /usr/local/Cellar/llvm@3.8/3.8.1/lib/llvm-3.8/lib/libLLVMSupport.a: 
>> > unknown symbol `___dso_handle'
>> > [24 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, 
>> > dist/build/Data/Range/Range.o )
>> >
>> > :
>> > ghc: panic! (the 'impossible' happened)
>> >   (GHC version 7.10.2 for x86_64-apple-darwin):
>> >   Dynamic linker not initialised
>> >
>> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
>> > <http://www.haskell.org/ghc/reportabug>
>> >
>> > [31 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( 
>> > Data/Array/Accelerate/LLVM/Util.hs, 
>> > dist/build/Data/Array/Accelerate/LLVM/Util.o )
>> >
>> > :
>> > ghc: unable to load package `llvm-general-3.8.0.0'
>> > [32 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( 
>> > Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, 
>> > dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o )
>> >
>> > :
>> > ghc: panic! (the 'impossible' happened)
>> >   (GHC version 7.10.2 for x86_64-apple-darwin):
>> >   Dynamic linker not initialised
>> >
>> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
>> > <http://www.haskell.org/ghc/reportabug>
>> >
>> > [33 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Monad[boot] ( 
>> > Data/Array/Accelerate/LLVM/CodeGen/Monad.hs-boot, 
>> > dist/build/Data/Array/Accelerate/LLVM/CodeGen/Monad.o-boot )
>> > [34 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.IR 
>> > <http://data.array.accelerate.llvm.codegen.ir/> ( 
>> > Data/Array/Accelerate/LLVM/CodeGen/IR.hs, 
>> > dist/build/Data/Array/Accelerate/LLVM/CodeGen/IR.o )
>> >
>> > :
>> > ghc: panic! (the 'impossible' happened)
>> >   (GHC version 7.10.2 for x86_64-apple-darwin):
>> >   Dynamic linker not initialised
>> >
>> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
>> > <http://www.haskell.org/ghc/reportabug>
>> >
>> > [44 of 52] Compiling Data.Array.Accelerate.LLVM.Execute.Environment ( 
>> > Data/Array/Accelerate/LLVM/Execute/Environment.hs, 
>> > dist/build/Data/Array/Accelerate/LLVM/Execute/Environment.o )
>> >
>> > :
>> > ghc: panic! (the 'impossible' happened)
>> >   (GHC version 7.10.2 for x86_64-apple-darwin):
>> >   Dynamic linker not initialised
>> >
>> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
>> > <http://www.haskell.org/ghc/reportabug>
>> 
> 

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: accelerate-llvm problems

2017-02-22 Thread Dominic Steinitz
Thanks - it seems I can only do this with home-brew for 3.9 - the flag is 
ignored for 3.8 - I am building now and will report back.

> On 21 Feb 2017, at 15:44, Trevor McDonell  wrote:
> 
> Hi Dominic,
> 
> You need to build/install LLVM with shared libraries.
> 
> Then, install llvm-general with -fshared-llvm (or, use my fork, which the 
> stack.yaml files point to).
> 
> 
> -Trev
> 
> P.S. On mobile, apologies for the terse reply.
> On Wed, 22 Feb 2017 at 10:34 AM, Dominic Steinitz  <mailto:idontgetoutm...@gmail.com>> wrote:
> I am trying to build accelerate-llvm but getting the ghc panics below. Here’s 
> my config
> 
> > bash-3.2$ ghc-pkg list | grep llvm
> > ghc-pkg list | grep llvm
> > llvm-general-3.8.0.0
> > llvm-general-pure-3.5.0.0
> > llvm-general-pure-3.5.1.0
> > llvm-general-pure-3.8.0.0
> > bash-3.2$ ghc-pkg list | grep acc
> > ghc-pkg list | grep acc
> > accelerate-1.0.0.0
> > bash-3.2$ ghc --version
> > ghc --version
> > The Glorious Glasgow Haskell Compilation System, version 7.10.2
> 
> If anyone has any ideas, I’d be very grateful.
> 
> > bash-3.2$ ~/Library/Haskell/bin/cabal build
> > ~/Library/Haskell/bin/cabal build
> > Building accelerate-llvm-1.0.0.0...
> > Preprocessing library accelerate-llvm-1.0.0.0...
> > ghc:
> > lookupSymbol failed in relocateSection (RELOC_GOT)
> > /usr/local/Cellar/llvm@3.8/3.8.1/lib/llvm-3.8/lib/libLLVMSupport.a: unknown 
> > symbol `___dso_handle'
> > [24 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, 
> > dist/build/Data/Range/Range.o )
> >
> > :
> > ghc: panic! (the 'impossible' happened)
> >   (GHC version 7.10.2 for x86_64-apple-darwin):
> >   Dynamic linker not initialised
> >
> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
> > <http://www.haskell.org/ghc/reportabug>
> >
> > [31 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( 
> > Data/Array/Accelerate/LLVM/Util.hs, 
> > dist/build/Data/Array/Accelerate/LLVM/Util.o )
> >
> > :
> > ghc: unable to load package `llvm-general-3.8.0.0'
> > [32 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( 
> > Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, 
> > dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o )
> >
> > :
> > ghc: panic! (the 'impossible' happened)
> >   (GHC version 7.10.2 for x86_64-apple-darwin):
> >   Dynamic linker not initialised
> >
> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
> > <http://www.haskell.org/ghc/reportabug>
> >
> > [33 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Monad[boot] ( 
> > Data/Array/Accelerate/LLVM/CodeGen/Monad.hs-boot, 
> > dist/build/Data/Array/Accelerate/LLVM/CodeGen/Monad.o-boot )
> > [34 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.IR 
> > <http://data.array.accelerate.llvm.codegen.ir/> ( 
> > Data/Array/Accelerate/LLVM/CodeGen/IR.hs, 
> > dist/build/Data/Array/Accelerate/LLVM/CodeGen/IR.o )
> >
> > :
> > ghc: panic! (the 'impossible' happened)
> >   (GHC version 7.10.2 for x86_64-apple-darwin):
> >   Dynamic linker not initialised
> >
> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
> > <http://www.haskell.org/ghc/reportabug>
> >
> > [44 of 52] Compiling Data.Array.Accelerate.LLVM.Execute.Environment ( 
> > Data/Array/Accelerate/LLVM/Execute/Environment.hs, 
> > dist/build/Data/Array/Accelerate/LLVM/Execute/Environment.o )
> >
> > :
> > ghc: panic! (the 'impossible' happened)
> >   (GHC version 7.10.2 for x86_64-apple-darwin):
> >   Dynamic linker not initialised
> >
> > Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
> > <http://www.haskell.org/ghc/reportabug>
> 

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


accelerate-llvm problems

2017-02-21 Thread Dominic Steinitz
I am trying to build accelerate-llvm but getting the ghc panics below. Here’s 
my config

> bash-3.2$ ghc-pkg list | grep llvm
> ghc-pkg list | grep llvm
>llvm-general-3.8.0.0
>llvm-general-pure-3.5.0.0
>llvm-general-pure-3.5.1.0
>llvm-general-pure-3.8.0.0
> bash-3.2$ ghc-pkg list | grep acc
> ghc-pkg list | grep acc
>accelerate-1.0.0.0
> bash-3.2$ ghc --version
> ghc --version
> The Glorious Glasgow Haskell Compilation System, version 7.10.2

If anyone has any ideas, I’d be very grateful.

> bash-3.2$ ~/Library/Haskell/bin/cabal build
> ~/Library/Haskell/bin/cabal build
> Building accelerate-llvm-1.0.0.0...
> Preprocessing library accelerate-llvm-1.0.0.0...
> ghc: 
> lookupSymbol failed in relocateSection (RELOC_GOT)
> /usr/local/Cellar/llvm@3.8/3.8.1/lib/llvm-3.8/lib/libLLVMSupport.a: unknown 
> symbol `___dso_handle'
> [24 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, 
> dist/build/Data/Range/Range.o )
> 
> :
>ghc: panic! (the 'impossible' happened)
>  (GHC version 7.10.2 for x86_64-apple-darwin):
>   Dynamic linker not initialised
> 
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
> 
> 
> [31 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( 
> Data/Array/Accelerate/LLVM/Util.hs, 
> dist/build/Data/Array/Accelerate/LLVM/Util.o )
> 
> :
>ghc: unable to load package `llvm-general-3.8.0.0'
> [32 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( 
> Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, 
> dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o )
> 
> :
>ghc: panic! (the 'impossible' happened)
>  (GHC version 7.10.2 for x86_64-apple-darwin):
>   Dynamic linker not initialised
> 
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
> 
> 
> [33 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Monad[boot] ( 
> Data/Array/Accelerate/LLVM/CodeGen/Monad.hs-boot, 
> dist/build/Data/Array/Accelerate/LLVM/CodeGen/Monad.o-boot )
> [34 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.IR ( 
> Data/Array/Accelerate/LLVM/CodeGen/IR.hs, 
> dist/build/Data/Array/Accelerate/LLVM/CodeGen/IR.o )
> 
> :
>ghc: panic! (the 'impossible' happened)
>  (GHC version 7.10.2 for x86_64-apple-darwin):
>   Dynamic linker not initialised
> 
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
> 
> 
> [44 of 52] Compiling Data.Array.Accelerate.LLVM.Execute.Environment ( 
> Data/Array/Accelerate/LLVM/Execute/Environment.hs, 
> dist/build/Data/Array/Accelerate/LLVM/Execute/Environment.o )
> 
> :
>ghc: panic! (the 'impossible' happened)
>  (GHC version 7.10.2 for x86_64-apple-darwin):
>   Dynamic linker not initialised
> 
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug 
> ___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Floating Point Exceptions

2016-12-07 Thread Dominic Steinitz
Hello again,

I removed my dependency on hmatrix and enabled floating point exceptions via 
`feenableexcept` hoping to get a call stack showing me where the exception was 
being raised but alas all I get is

> *Main> main
> ghc: ghc-iserv terminated (-8)
> Leaving GHCi.


My googling didn’t turn up much but as far as I can tell ghc does *not* handle 
sigfpe (googling "haskell sigfpe” turns up blog posts on Haskell by someone 
called “sigfpe”). I think it would be jolly useful to be able to get stack 
traces of floating point exceptions. How much work would this be? I’d be happy 
to have a go at it if someone could provide help and guidance.

There seems to have been some discussion of it on the ghc-devs mailing list in 
September 
(https://mail.haskell.org/pipermail/ghc-devs/2016-September/date.html) but not 
much in the way of write up.

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: Stack traces in ghci

2016-12-07 Thread dominic
Hi Simon,

Thanks for getting back.

1. Without -prof and -fexternal-interpreter, the program runs fine.

2. With just -prof, the program runs fine.

3. With just -fexternal-interpreter, I get the error below.

Dominic.

> On 7 Dec 2016, at 13:52, Simon Marlow  wrote:
> 
> Hi Dominic - this looks like a problem with loading hmatrix into GHCi.  Does 
> it load without -prof and -fexternal-interpreter?  How about with just 
> -fexternal-interpreter?
> 
> Cheers
> SImon
> 
> On 5 December 2016 at 12:20, Dominic Steinitz  <mailto:domi...@steinitz.org>> wrote:
> I am trying to debug a package in which there is a divide by 0 error and 
> attempting to use Simon Marlow’s stack traces: 
> https://simonmar.github.io/posts/2016-02-12-Stack-traces-in-GHCi.html 
> <https://simonmar.github.io/posts/2016-02-12-Stack-traces-in-GHCi.html>. 
> However ghci is complaining about  missing symbols. What do I need to add to 
> the command line to coax ghci into giving me a stack trace?
> 
> > ~/Dropbox/Private/Stochastic/demo $ ghci -fexternal-interpreter -prof 
> > fe-handling-example.o -i../../monad-bayes/src  
> > -package-db=.cabal-sandbox/x86_64-osx-ghc-8.0.1-packages.conf.d
> > GHCi, version 8.0.1: http://www.haskell.org/ghc/ 
> > <http://www.haskell.org/ghc/>  :? for help
> > Prelude> :l app/Main.hs
> > [ 1 of 16] Compiling Control.Monad.Bayes.LogDomain ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/LogDomain.hs, interpreted )
> > [ 2 of 16] Compiling Control.Monad.Bayes.Primitive ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Primitive.hs, interpreted )
> > [ 3 of 16] Compiling Control.Monad.Bayes.Class ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Class.hs, interpreted )
> > [ 4 of 16] Compiling Control.Monad.Bayes.Sampler ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Sampler.hs, interpreted )
> > [ 5 of 16] Compiling Control.Monad.Bayes.Sequential ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Sequential.hs, interpreted )
> > [ 6 of 16] Compiling Control.Monad.Bayes.Prior ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Prior.hs, interpreted )
> > [ 7 of 16] Compiling Control.Monad.Bayes.Rejection ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Rejection.hs, interpreted )
> > [ 8 of 16] Compiling Control.Monad.Bayes.Weighted ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Weighted.hs, interpreted )
> > [ 9 of 16] Compiling Control.Monad.Bayes.Population ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Population.hs, interpreted )
> > [10 of 16] Compiling Control.Monad.Bayes.Deterministic ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Deterministic.hs, interpreted )
> > [11 of 16] Compiling Control.Monad.Bayes.Conditional ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Conditional.hs, interpreted )
> > [12 of 16] Compiling Control.Monad.Bayes.Dist ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Dist.hs, interpreted )
> > [13 of 16] Compiling Control.Monad.Bayes.Coprimitive ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Coprimitive.hs, interpreted )
> > [14 of 16] Compiling Control.Monad.Bayes.Trace ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Trace.hs, interpreted )
> > [15 of 16] Compiling Control.Monad.Bayes.Inference ( 
> > ../../monad-bayes/src/Control/Monad/Bayes/Inference.hs, interpreted )
> > [16 of 16] Compiling Main ( app/Main.hs, interpreted )
> >
> > app/Main.hs:92:7: warning: [-Wunused-matches]
> > Defined but not used: ‘a’
> >
> > app/Main.hs:92:9: warning: [-Wunused-matches]
> > Defined but not used: ‘prevP’
> >
> > app/Main.hs:92:15: warning: [-Wunused-matches]
> > Defined but not used: ‘prevZ’
> >
> > app/Main.hs:106:5: warning: [-Wunused-do-bind]
> > A do-notation statement discarded a result of type ‘GHC.Prim.Any’
> > Suppress this warning by saying
> >   ‘_ <- ($)
> >   error (++) "You are here " (++) show state (++) " " show 
> > p_obs’
> > Ok, modules loaded: Main, Control.Monad.Bayes.LogDomain, 
> > Control.Monad.Bayes.Primitive, Control.Monad.Bayes.Class, 
> > Control.Monad.Bayes.Population, Control.Monad.Bayes.Conditional, 
> > Control.Monad.Bayes.Inference, Control.Monad.Bayes.Sampler, 
> > Control.Monad.Bayes.Rejection, Control.Monad.Bayes.Weighted, 
> > Control.Monad.Bayes.Sequential, Control.Monad.Bayes.Trace, 
> > Control.Monad.Bayes.Dist, Control.Monad.Bayes.Prior, 
> > Control.Monad.Bayes.Deterministic, Control.Monad.Bayes.Coprimitive.
> > *Main> main
> > ghc-iserv-prof:
> > lookupSymbol failed in relocateSection (relocate external)
> >

Stack traces in ghci

2016-12-05 Thread Dominic Steinitz
18zi0zi0zm7aYEqJARQEvKYNyM4UGAPZZ_InternalziVectorizzed_constantAux_closure'
> ghc-iserv-prof: Could not on-demand load symbol 
> '_hmatrixzm0zi18zi0zi0zm7aYEqJARQEvKYNyM4UGAPZZ_InternalziMatrix_Matrix_con_info'
> 
> ghc-iserv-prof: 
> lookupSymbol failed in relocateSection (relocate external)
> /Users/dom/Dropbox/Private/Stochastic/demo/.cabal-sandbox/lib/x86_64-osx-ghc-8.0.1/hmatrix-0.18.0.0-7aYEqJARQEvKYNyM4UGAPZ/libHShmatrix-0.18.0.0-7aYEqJARQEvKYNyM4UGAPZ_p.a:
>  unknown symbol 
> `_hmatrixzm0zi18zi0zi0zm7aYEqJARQEvKYNyM4UGAPZZ_InternalziMatrix_Matrix_con_info'
> ghc-iserv-prof: Could not on-demand load symbol 
> '_hmatrixzm0zi18zi0zi0zm7aYEqJARQEvKYNyM4UGAPZZ_InternalziElement_zgzl_info'
> 
> ghc-iserv-prof: 
> lookupSymbol failed in relocateSection (relocate external)
> /Users/dom/Dropbox/Private/Stochastic/demo/.cabal-sandbox/lib/x86_64-osx-ghc-8.0.1/hmatrix-0.18.0.0-7aYEqJARQEvKYNyM4UGAPZ/libHShmatrix-0.18.0.0-7aYEqJARQEvKYNyM4UGAPZ_p.a:
>  unknown symbol 
> `_hmatrixzm0zi18zi0zi0zm7aYEqJARQEvKYNyM4UGAPZZ_InternalziElement_zgzl_info'
> ghc-iserv-prof: Could not on-demand load symbol 
> '_hmatrixzm0zi18zi0zi0zm7aYEqJARQEvKYNyM4UGAPZZ_InternalziUtil_zdfIndexableVectorDouble_closure'
> 
> 
> ByteCodeLink.lookupCE
> During interactive linking, GHCi couldn't find the following symbol:
>   
> hmatrixzm0zi18zi0zi0zm7aYEqJARQEvKYNyM4UGAPZZ_InternalziUtil_zdfIndexableVectorDouble_closure
> This may be due to you not asking GHCi to load extra object files,
> archives or DLLs needed by your current session.  Restart GHCi, specifying
> the missing library using the -L/path/to/object/dir and -lmissinglibname
> flags, or simply by naming the relevant files on the GHCi command line.
> Alternatively, this link failure might indicate a bug in GHCi.
> If you suspect the latter, please send a bug report to:
>   glasgow-haskell-b...@haskell.org



Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: GHC Performance / Replacement for R?

2016-08-31 Thread Dominic Steinitz

Hi Iavor,

Thank you very much for this. It's nice to know that we have the ability 
in Haskell to be as frugal (or profligate) with memory as R when working 
with data frames. I should say this number of fields is quite low in the 
data science world. Data sets with 500 columns are not uncommon and I 
did have one with 10,000 columns!


I know other folks have worked on producing something like data frames 
e.g. https://github.com/acowley/Frames and 
http://stla.github.io/stlapblog/posts/HaskellFrames.html for example but 
I wanted to remain in the world of relatively simple types and I haven't 
looked at its performance in terms of memory. On the plus side it did 
manage to read in the 10,000 column data set although ghc took about 5 
minutes to do the typechecking (I should say within ghci).


Just to mention that R is not the only language that has nice facilities 
for data exploration; python has a package called pandas: 
http://pandas.pydata.org.


I feel we still have a way to go to make Haskell provide as easy an 
environment for data exploration as R or Python but I shall continue on 
my crusade.


Many thanks once again, Dominic.


On 30/08/2016 22:05, Iavor Diatchki wrote:

Hello,

when you parse the CSV fully, you end up creating a lot of small 
bytestring objects, and each of these adds some overhead.   The 
vectors themselves add up some additional overhead.  All of this adds 
up when you have as many fields as you do.   An alternative would be 
to use a different representation for the data, which recomputes 
things when needed.   While this might be a bit slower in some cases, 
it could have significant saving in terms of memory use.   I wrote up 
a small example to illustrate what I have in mind, which should be 
attached to this e-mail.


Basically, instead of parsing the CSV file fully, I just indexed where 
the lines are (ref. the "rows" field of "CSV"). This allows me to 
access each row quickly, and the when I need to get a specific field, 
I simply parse the bytes of the row.
One could play all kinds of games like that, and I imagine R does 
something similar, although I have never looked at how it works.   To 
test the approach I generated ~200Mb of sample data (generator is also 
in the attached file), and I was able to filter it using ~240Mb, which 
is comparable to what you reported about R.  One could probably 
package all this up in library that supports "R like" operations.


These are the stats I get from -s:

   4,137,632,432 bytes allocated in the heap
 925,200 bytes copied during GC
 200,104,224 bytes maximum residency (2 sample(s))
   6,217,864 bytes maximum slop
 246 MB total memory in use (1 MB lost due to fragmentation)

 Tot time (elapsed)  Avg pause 
 Max pause
  Gen  0  7564 colls, 0 par0.024s   0.011s   0.s   
 0.0001s
  Gen  1 2 colls, 0 par0.000s   0.001s   0.0003s   
 0.0006s


  INITtime0.000s  (  0.000s elapsed)
  MUT time0.364s  (  0.451s elapsed)
  GC  time0.024s  (  0.011s elapsed)
  EXITtime0.000s  (  0.001s elapsed)
  Total   time0.388s  (  0.463s elapsed)

  %GC time   6.2%  (2.5% elapsed)

  Alloc rate11,367,122,065 bytes per MUT second

  Productivity  93.8% of total user, 78.6% of total elapsed

-Iavor




On Thu, Aug 25, 2016 at 3:31 AM, Simon Peyton Jones via 
Glasgow-haskell-users <mailto:glasgow-haskell-users@haskell.org>> wrote:


Sounds bad.  But it'll need someone with bytestring expertise to
debug.  Maybe there's a GHC problem underlying; or maybe it's
shortcoming of bytestring.

Simon

|  -Original Message-
|  From: Glasgow-haskell-users [mailto:glasgow-haskell-users-
<mailto:glasgow-haskell-users->
    | boun...@haskell.org <mailto:boun...@haskell.org>] On Behalf Of
Dominic Steinitz
|  Sent: 25 August 2016 10:11
|  To: GHC users mailto:glasgow-haskell-users@haskell.org>>
|  Subject: GHC Performance / Replacement for R?
|
|  I am trying to use Haskell as a replacement for R but running
into two
|  problems which I describe below. Are there any plans to address the
|  performance issues I have encountered?
|
|   1. I seem to have to jump through a lot of hoops just to be
able to
|  select the data I am interested in.
|
|  {-# LANGUAGE ScopedTypeVariables #-}
|
|  {-# OPTIONS_GHC -Wall #-}
|
|  import Data.Csv hiding ( decodeByName )
|  import qualified Data.Vector as V
|
|  import Data.ByteString ( ByteString )
|  import qualified Data.ByteString.Char8 as B
|
|  import qualified Pipes.Prelude as P
|  import qualified Pipes.ByteString as Bytes import Pipes import
|  qualified Pipes.Csv as Csv import System.IO
|
|  import qualified Control.Foldl as L
|
|  ma

GHC Performance / Replacement for R?

2016-08-25 Thread Dominic Steinitz
I am trying to use Haskell as a replacement for R but running into two
problems which I describe below. Are there any plans to address the
performance issues I have encountered?

 1. I seem to have to jump through a lot of hoops just to be able to
select the data I am interested in.

{-# LANGUAGE ScopedTypeVariables #-}

{-# OPTIONS_GHC -Wall #-}

import Data.Csv hiding ( decodeByName )
import qualified Data.Vector as V

import Data.ByteString ( ByteString )
import qualified Data.ByteString.Char8 as B

import qualified Pipes.Prelude as P
import qualified Pipes.ByteString as Bytes
import Pipes
import qualified Pipes.Csv as Csv
import System.IO

import qualified Control.Foldl as L

main :: IO ()
main = withFile "examples/787338586_T_ONTIME.csv" ReadMode $ \h -> do
  let csvs :: Producer (V.Vector ByteString) IO ()
  csvs = Csv.decode HasHeader (Bytes.fromHandle h) >-> P.concat
  uvectors :: Producer (V.Vector ByteString) IO ()
  uvectors = csvs  >-> P.map (V.foldr V.cons V.empty)
  vec_vec <- L.impurely P.foldM  L.vector uvectors
  print $ (vec_vec :: V.Vector (V.Vector ByteString)) V.! 17
  print $ V.length vec_vec
  let rockspring = V.filter (\x -> x V.! 8 == B.pack "RKS") vec_vec
  print $ V.length rockspring

Here's the equivalent R:

df <- read.csv("787338586_T_ONTIME.csv")
rockspring <- df[df$ORIGIN == "RKS",]

 2. Now I think I could improve the above to make an environment that
is more similar to the one my colleagues are used to in R but more
problematical is the memory usage.

 * 112.5M file
 * Just loading the source into ghci takes 142.7M
 * > foo <- readFile "examples/787338586_T_ONTIME.csv" > length foo
   takes me up to 4.75G. But we probably don't want to do this!
 * Let's try again.
 * > :set -XScopedTypeVariables
 * > h <- openFile "examples/787338586_T_ONTIME.csv" ReadMode
 * > let csvs :: Producer (V.Vector ByteString) IO () = Csv.decode HasHeader 
(Bytes.fromHandle h) >-> P.concat
 * > let uvectors :: Producer (V.Vector ByteString) IO () = csvs  >-> P.map 
(V.map id) >-> P.map (V.foldr V.cons V.empty)
 * > vec_vec :: V.Vector (V.Vector ByteString) <- L.impurely P.foldM  L.vector 
uvectors
 * Now I am up at 3.17G. In R I am under 221.3M.
 * > V.length rockspring takes a long time to return 155 and now I am
   at 3.5G!!! In R > rockspring <- df[df$ORIGIN == "RKS",] seems
   instantaneous and now uses only 379.5M.
 * > length(rockspring) 37 > length(df$ORIGIN) 471949 i.e. there are
   37 columns and 471,949 rows.

Running this as an executable gives

~/Dropbox/Private/labels $ ./examples/BugReport +RTS -s
["2014-01-01","EV","20366","N904EV","2512","10747","1074702","30747",
 "BRO","Brownsville, TX","Texas","11298","1129803","30194",
  "DFW","Dallas/Fort Worth, TX","Texas","0720","0718",
  "-2.00","8.00","0726","0837","7.00","0855","0844","-11.00","0.00",
  "","0.00","482.00","","","","","",""]
471949
155
  14,179,764,240 bytes allocated in the heap
   3,378,342,072 bytes copied during GC
 786,333,512 bytes maximum residency (13 sample(s))
  36,933,976 bytes maximum slop
1434 MB total memory in use (0 MB lost due to fragmentation)

 Tot time (elapsed)  Avg pause  Max pause
  Gen  0 26989 colls, 0 par1.423s   1.483s 0.0001s0.0039s
  Gen  113 colls, 0 par1.005s   1.499s 0.1153s0.6730s

  INITtime0.000s  (  0.003s elapsed)
  MUT time3.195s  (  3.193s elapsed)
  GC  time2.428s  (  2.982s elapsed)
  EXITtime0.016s  (  0.138s elapsed)
  Total   time5.642s  (  6.315s elapsed)

  %GC time  43.0%  (47.2% elapsed)

  Alloc rate4,437,740,019 bytes per MUT second

  Productivity  57.0% of total user, 50.9% of total elapsed

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: CMM-to-ASM: Register allocation wierdness

2016-06-16 Thread Dominic Steinitz
>  Hi, I am implementing unicode normalization in Haskell. I
> challenged myself to match the performance with the best C/C++
> implementation, the best being the ICU library. I am almost there,
> beating it in one of the benchmarks and within 30% for others. I am
> out of all application level tricks that I could think of and now
> need help from the compiler.

I can't answer your question but I am very happy that someone is
looking at performance issues.

I am sad that no-one has responded.

More generally, is there a story around what is happening to improve
performance?

Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: SIMD

2015-04-13 Thread Dominic Steinitz
Hi Geoff,

Thanks for the update. I found this 
https://ghc.haskell.org/trac/ghc/blog/weekly20141020

> Geoff Mainland stepped up and fixed Data Parallel Haskell to work with a new 
> version of vector and GHC. Austin had disabled DPH a few weeks prior due to 
> its difficulty to upgrade, and divergent source trees. With 7.10, GHC will 
> hopefully ship a more modern vector and dph to boot.

From what you say this has been superseded?

Also seems that this page  https://ghc.haskell.org/trac/ghc/wiki/SIMD 
<https://ghc.haskell.org/trac/ghc/wiki/SIMD> should be updated and if I knew 
what it should say I would volunteer to update it.

A bit of background on why I am asking these questions: I am working on a Monte 
Carlo simulation and performance is a key issue. We are using parallelisation 
to good effect (after some interesting issues with thread affinity 
https://ghc.haskell.org/trac/ghc/ticket/10229 
<https://ghc.haskell.org/trac/ghc/ticket/10229>) but I am trying to understand 
what other options might be available to speed things up.

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

> On 13 Apr 2015, at 13:37, Geoffrey Mainland  wrote:
> 
> SIMD support was merged to HEAD before the 7.8 release, so any version
> of GHC after 7.8 has SIMD support built-in.
> 
> If you want a branch that compiles with DPH, I'm afraid you are out of
> luck. DPH no longer builds at all, and I believe Austin actually deleted
> the simd branch mentioned on the Wiki.
> 
> Geoff
> 
> On 04/13/2015 02:54 AM, Simon Peyton Jones wrote:
>> 
>> Geoff Mainland is the originator of the SIMD instruction set work. 
>> Let’s see what he says.
>> 
>> 
>> 
>> Simon
>> 
>> 
>> 
>> *From:*Glasgow-haskell-users
>> [mailto:glasgow-haskell-users-boun...@haskell.org] *On Behalf Of
>> *Dominic Steinitz
>> *Sent:* 11 April 2015 17:45
>> *To:* GHC users
>> *Subject:* SIMD
>> 
>> 
>> 
>> What’s the story with this? I tried to follow the instructions
>> here: https://ghc.haskell.org/trac/ghc/wiki/SIMD but I get
>> 
>> 
>> 
>>~ $ git clone -b simd http://git.haskell.org/ghc.git
>><http://git.haskell.org/ghc.git <http://git.haskell.org/ghc.git>>
>> 
>>Cloning into 'ghc'...
>> 
>>fatal: Remote branch simd not found in upstream origin
>> 
>> 
>> 
>> Dominic Steinitz
>> 
>> domi...@steinitz.org <mailto:domi...@steinitz.org> 
>> <mailto:domi...@steinitz.org <mailto:domi...@steinitz.org>>
>> 
>> http://idontgetoutmuch.wordpress.com <http://idontgetoutmuch.wordpress.com/>
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


SIMD

2015-04-11 Thread Dominic Steinitz
What’s the story with this? I tried to follow the instructions here: 
https://ghc.haskell.org/trac/ghc/wiki/SIMD 
<https://ghc.haskell.org/trac/ghc/wiki/SIMD> but I get

> ~ $ git clone -b simd http://git.haskell.org/ghc.git
> Cloning into 'ghc'...
> fatal: Remote branch simd not found in upstream origin


Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Parallel Profiling

2015-04-01 Thread Dominic Steinitz
Hi Amos,

Thanks very much - I am taking a look.

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

On 30 Mar 2015, at 22:05, Amos Robinson  wrote:

> Hi Dominic,
> 
> A few years ago we wrote a program for analysing DPH runs, dph-event-seer. It 
> provides a few general analyses like percent of time with N threads running, 
> time between wake-ups etc. You might find it interesting, but I haven't 
> actually looked at ghc-events-analyse, so I don't know what it provides.
> 
> I'm sorry, but to compile it without DPH you'd have to modify it to remove 
> DphOps*.
> 
> https://github.com/ghc/packages-dph/blob/master/dph-event-seer/src/Main.hs
> 
> Amos
> 
> On Tue, 31 Mar 2015 at 04:38 Dominic Steinitz  wrote:
> Does anyone know of any tools for analysing parallel program performance?
> 
> I am trying to use threadscope but it keeps crashing with my 100M log file 
> and ghc-events-analyze is not going to help as I have many hundreds of 
> threads all carrying out the same computation. I think I’d like a library 
> that would allow me to construct my own analyses rather than display them via 
> GTK. There is ghc-events but that seems to be just for parsing the logs and I 
> couldn’t find anything that used it in the way I would like to (apart from 
> threadscope and ghc-events-analyze of course).
> 
> Thanks
> 
> Dominic Steinitz
> domi...@steinitz.org
> http://idontgetoutmuch.wordpress.com
> 
> ___
> Haskell-Cafe mailing list
> haskell-c...@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Parallel Profiling

2015-03-30 Thread Dominic Steinitz
Does anyone know of any tools for analysing parallel program performance?

I am trying to use threadscope but it keeps crashing with my 100M log file and 
ghc-events-analyze is not going to help as I have many hundreds of threads all 
carrying out the same computation. I think I’d like a library that would allow 
me to construct my own analyses rather than display them via GTK. There is 
ghc-events but that seems to be just for parsing the logs and I couldn’t find 
anything that used it in the way I would like to (apart from threadscope and 
ghc-events-analyze of course).

Thanks

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Equality Constraints (a ~ b)

2015-01-11 Thread Dominic Steinitz
Hi,

I am trying to find more background on these. They don’t exist in the Haskell 
2010 Language Report, they didn’t exist in ghc 6.8.2 but make an appearance in 
7.0.1. The documentation in the manual is rather sparse and doesn’t contain a 
reference: https://downloads.haskell.org/~ghc/latest/docs/users_guide.pdf 
section 7.11. Folk on #ghc referred me to 
http://research.microsoft.com/en-us/um/people/simonpj/papers/ext-f/. I can find 
papers that refer to ~ in F_C (aka FC?) but as far as I can tell not in the 
Haskell language itself.

Many thanks

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


RE: ANNOUNCE: GHC 7.10.1 Release Candidate 1

2014-12-29 Thread Dominic Steinitz
I counted about 10 people (including me) who appear to be actively keen on it 
on reddit: 
http://www.reddit.com/r/haskell/comments/2pnjdk/is_overloadedrecordfields_getting_it_into_7101/.
 I would guess there are others.

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

On 29 Dec 2014, at 12:00, glasgow-haskell-users-requ...@haskell.org wrote:

> 
> Message: 3
> Date: Mon, 29 Dec 2014 10:29:23 +
> From: Simon Peyton Jones 
> To: Kazu Yamamoto , "ghc-d...@haskell.org"
>   , "glasgow-haskell-users@haskell.org"
>   
> Subject: RE: ANNOUNCE: GHC 7.10.1 Release Candidate 1
> Message-ID:
>   
> <618be556aadd624c9c918aa5d5911bef5628e...@db3prd3001mb020.064d.mgd.msft.net>
>   
> Content-Type: text/plain; charset="us-ascii"
> 
> | If I understand correctly, OverloadedRecordFields has not been merged
> | yet. Are there any chances to merge it into GHC 7.10.1?
> 
> I'm afraid not.  The situation is that Adam has a fairly complete patch for 
> overloaded record fields, but neither he nor I are happy with it. It makes 
> some fairly complicated and pervasive changes, and feels like a sledgehammer 
> to crack a nut. We'd scheduled for Adam to spend a day at MSR for us to work 
> on it together, but Adam had to cancel.  We'll hopefully re-arrange.
> 
> Meanwhile it'd be motivating to know who, if anyone, is actively keen on it.  
> Kazu is presumably one.  I expect there are others, but I couldn't list them.
> 

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-24 Thread Dominic Steinitz
Thank you very much everyone. I now have a version of yarr which compiles under 
ghc 7.8.3. I have yet to do the conditional compilation hackery to support back 
versions but then I can make a release.

What a great community :-)

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-23 Thread Dominic Steinitz
> $ cabal --version
> cabal-install version 1.19.1
> using version 1.19.1 of the Cabal library 

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

On 23 Dec 2014, at 15:54, Carter Schonwald  wrote:

> what version of cabal-install are you using?
> 
> On Tue, Dec 23, 2014 at 10:46 AM, Dominic Steinitz  
> wrote:
> Ok I have a cut down version of the problem and am cross posting to 
> glasgow-haskell-users.
> 
> To restate the problem: this is from code that has not been changed for 2 
> years. I get
> 
> > Examples.hs:42:42: Parse error in pattern: con
> > Failed, modules loaded: none.
> 
> Any help would be very gratefully received.
> 
> > {-# LANGUAGE TypeFamilies, MultiParamTypeClasses, 
> > FunctionalDependencies #-}
> > {-# LANGUAGE FlexibleContexts #-}
> > {-# LANGUAGE EmptyDataDecls #-}
> > {-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
> > {-# LANGUAGE UndecidableInstances, OverlappingInstances #-}
> > {-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving #-}
> > {-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
> > {-# LANGUAGE MagicHash, BangPatterns, UnboxedTuples #-}
> > {-# LANGUAGE TemplateHaskell, CPP #-}
> >
> > module Examples where
> >
> > import GHC.Prim
> > import GHC.Exts
> > import GHC.Types
> > import GHC.Word
> > import GHC.Int
> >
> > class Touchable a where
> > touch :: a -> IO ()
> >
> > instance Touchable Bool where
> > touch b = IO (\s -> case touch# b s of s' -> (# s', () #))
> > {-# INLINE touch #-}
> >
> > #define TOUCHABLE_INST(ty,con)  \
> > instance Touchable ty where {   \
> > touch (con x#) = IO (\s -> case touch# x# s of s' -> (# s', () #)); \
> > {-# INLINE touch #-};   \
> > }
> >
> > TOUCHABLE_INST(Int, I#)
> >
> > #define PRIM_COMP_INST(ty,con,le,ge) \
> > instance PrimitiveOrd ty where { \
> > minM' (con a#) (con b#) =        \
> > IO (\s ->    \
> > let r# = if le a# b# then a# else b# \
> > in case touch# r# s of s' -> (# s', (con r#) #));\
> > }
> >
> > PRIM_COMP_INST(Int, I#, (<=#), (>=#))
> 
> Dominic Steinitz
> domi...@steinitz.org
> http://idontgetoutmuch.wordpress.com
> 
> On 23 Dec 2014, at 15:06, Dominic Steinitz  wrote:
> 
> > Hi Erik,
> >
> > Thank you very much. With that clue the compilation now doesn’t fail at 
> > that particular point.
> >
> > The bad news is it now fails to compile this module
> >
> > https://hackage.haskell.org/package/yarr-1.3.2/docs/src/Data-Yarr-Utils-Primitive.html#clampM%27
> >
> > with a parse error(!). Not only do I not have much experience with TH but 
> > this has now exposed my ignorance of CPP.
> >
> >> Data/Yarr/Utils/Primitive.hs:119:126: Parse error in pattern: con
> >
> > If I comment out the last four lines
> >
> >> PRIM_COMP_INST(Int, I#, (<=#), (>=#))
> >> PRIM_COMP_INST(Char, C#, leChar#, geChar#)
> >> PRIM_COMP_INST(Word, W#, leWord#, geWord#)
> >> PRIM_COMP_INST(Double, D#, (<=##), (>=##))
> >> PRIM_COMP_INST(Float, F#, leFloat#, geFloat#)
> >
> > then the module compiles but of course then the whole package does *not* 
> > compile.
> >
> > Did something change in 7.8.3 with regard to CPP (this code has not been 
> > modified for at least two years)?
> >
> > Thanks once again.
> >
> > Dominic Steinitz
> > domi...@steinitz.org
> > http://idontgetoutmuch.wordpress.com
> >
> > On 23 Dec 2014, at 13:42, Erik Hesselink  wrote:
> >
> >> Hi Dominic,
> >>
> >> It looks like just a representation change: a TySynEqn is a data type
> >> containing a [Type] and a Type, and those were the original two
> >> arguments. So it looks like with a little bit of CPP, you could
> >> support both versions. Something like
> >>
> >> #if MIN_VERSION_template_haskell(2,9,0)
> >> ...
> >> #else
> >> ...
> >> #endif
> >>
> >> In general, I think each major release of template haskell has quite
> >> some bre

Re: CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-23 Thread Dominic Steinitz
How very clever of you and thank you very much. Changing ‘ to 1 does fix the 
problem.

I would have thought this would work

> cabal install --with-gcc=gcc-4.9

But sadly I still got the same error.

Do I need a special version of cpphs?

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

On 23 Dec 2014, at 15:58, Brandon Allbery  wrote:

> On Tue, Dec 23, 2014 at 10:46 AM, Dominic Steinitz  
> wrote:
> To restate the problem: this is from code that has not been changed for 2 
> years. I get
> 
> > Examples.hs:42:42: Parse error in pattern: con
> > Failed, modules loaded: none.
> 
> I think I see the problem. Are you by any chance on a machine which has clang 
> as its default C compiler (OS X, FreeBSD 9.3?/10.x/STABLE/CURRENT, possibly 
> others)? cpp will in that case malfunction because it won't substitute macro 
> parameters after the single quote:
> 
> > minM' (con a#) (con b#) =\
> 
> -- 
> brandon s allbery kf8nh   sine nomine associates
> allber...@gmail.com  ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


CPP Help (was Re: Latest Template Haskell Breaks Package)

2014-12-23 Thread Dominic Steinitz
Ok I have a cut down version of the problem and am cross posting to 
glasgow-haskell-users.

To restate the problem: this is from code that has not been changed for 2 
years. I get

> Examples.hs:42:42: Parse error in pattern: con
> Failed, modules loaded: none.

Any help would be very gratefully received.

> {-# LANGUAGE TypeFamilies, MultiParamTypeClasses, 
> FunctionalDependencies #-}
> {-# LANGUAGE FlexibleContexts #-}
> {-# LANGUAGE EmptyDataDecls #-}
> {-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
> {-# LANGUAGE UndecidableInstances, OverlappingInstances #-}
> {-# LANGUAGE GeneralizedNewtypeDeriving, StandaloneDeriving #-}
> {-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
> {-# LANGUAGE MagicHash, BangPatterns, UnboxedTuples #-}
> {-# LANGUAGE TemplateHaskell, CPP #-}
> 
> module Examples where
> 
> import GHC.Prim
> import GHC.Exts
> import GHC.Types
> import GHC.Word
> import GHC.Int
> 
> class Touchable a where
> touch :: a -> IO ()
> 
> instance Touchable Bool where
> touch b = IO (\s -> case touch# b s of s' -> (# s', () #))
> {-# INLINE touch #-}
> 
> #define TOUCHABLE_INST(ty,con)  \
> instance Touchable ty where {   \
> touch (con x#) = IO (\s -> case touch# x# s of s' -> (# s', () #)); \
> {-# INLINE touch #-};   \
> }
> 
> TOUCHABLE_INST(Int, I#)
> 
> #define PRIM_COMP_INST(ty,con,le,ge) \
> instance PrimitiveOrd ty where { \
> minM' (con a#) (con b#) =\
> IO (\s ->\
> let r# = if le a# b# then a# else b# \
> in case touch# r# s of s' -> (# s', (con r#) #));\
> }
> 
> PRIM_COMP_INST(Int, I#, (<=#), (>=#))

Dominic Steinitz
domi...@steinitz.org
http://idontgetoutmuch.wordpress.com

On 23 Dec 2014, at 15:06, Dominic Steinitz  wrote:

> Hi Erik,
> 
> Thank you very much. With that clue the compilation now doesn’t fail at that 
> particular point.
> 
> The bad news is it now fails to compile this module
> 
> https://hackage.haskell.org/package/yarr-1.3.2/docs/src/Data-Yarr-Utils-Primitive.html#clampM%27
> 
> with a parse error(!). Not only do I not have much experience with TH but 
> this has now exposed my ignorance of CPP.
> 
>> Data/Yarr/Utils/Primitive.hs:119:126: Parse error in pattern: con
> 
> If I comment out the last four lines
> 
>> PRIM_COMP_INST(Int, I#, (<=#), (>=#))
>> PRIM_COMP_INST(Char, C#, leChar#, geChar#)
>> PRIM_COMP_INST(Word, W#, leWord#, geWord#)
>> PRIM_COMP_INST(Double, D#, (<=##), (>=##))
>> PRIM_COMP_INST(Float, F#, leFloat#, geFloat#)
> 
> then the module compiles but of course then the whole package does *not* 
> compile.
> 
> Did something change in 7.8.3 with regard to CPP (this code has not been 
> modified for at least two years)?
> 
> Thanks once again.
> 
> Dominic Steinitz
> domi...@steinitz.org
> http://idontgetoutmuch.wordpress.com
> 
> On 23 Dec 2014, at 13:42, Erik Hesselink  wrote:
> 
>> Hi Dominic,
>> 
>> It looks like just a representation change: a TySynEqn is a data type
>> containing a [Type] and a Type, and those were the original two
>> arguments. So it looks like with a little bit of CPP, you could
>> support both versions. Something like
>> 
>> #if MIN_VERSION_template_haskell(2,9,0)
>> ...
>> #else
>> ...
>> #endif
>> 
>> In general, I think each major release of template haskell has quite
>> some breaking changes, but I don't know of any place where they're
>> enumerated. The GHC changelog only has a couple of high level bullet
>> points.
>> 
>> Regards,
>> 
>> Erik
>> 
>> On Tue, Dec 23, 2014 at 2:20 PM, Dominic Steinitz  
>> wrote:
>>> I realise I should have sent this to the libraries list.
>>> 
>>> Dominic Steinitz
>>> domi...@steinitz.org
>>> http://idontgetoutmuch.wordpress.com
>>> 
>>> Begin forwarded message:
>>> 
>>> From: Dominic Steinitz 
>>> Subject: Latest Template Haskell Breaks Package
>>> Date: 23 December 2014 13:14:26 GMT
>>> To: Haskell-Cafe 
>>> 
>>> Hello Fellow Haskellers,
>>> 
>>> I have become a maintainer for yarr
>>> (https://hackage.haskell.o

Re: Problems installing 7.6.2 on MACOS

2013-03-27 Thread Dominic Steinitz
Answering my own question: it seems I made a rookie mistake and specified 
--prefix=/Library/Haskell which is where 7.4.1 lives. I just specified 
--prefix=/usr/lib and as far as I can tell everything works.

On 27 Mar 2013, at 11:40, Dominic Steinitz  wrote:

> Hi,
> 
> I followed the instructions pointed to from here: 
> http://www.haskell.org/ghc/download_ghc_7_6_2#macosx_x86_64
> 
>> bash-3.2$ ./configure --prefix=/Library/Haskell
> 
> 
>> bash-3.2$ sudo make install
> 
> 
> But sadly I get:
> 
>> bash-3.2$ ghc-pkg list
>> ghc-pkg: missing --global-package-db option, location of global package 
>> database unknown
> 
> 
> and
> 
>> bash-3.2$ ghc --make nnClassifier.lhs -O2
>> ghc: missing -B option
> 
> 
> Any advice on how to get 7.6.2 working would be much appreciated.
> 
> Dominic.
> 
> Here's some more information:
> 
>> bash-3.2$ which ghc-pkg
>> /Library/Haskell/lib/ghc-7.6.2/ghc-pkg
>> bash-3.2$ which ghc
>> /Library/Haskell/lib/ghc-7.6.2/ghc
> 
> 7.4.1 still works fine:
> 
>> bash-3.2$ ghc-pkg-7.4.1 list
>> /Library/Frameworks/GHC.framework/Versions/7.4.1-x86_64/usr/lib/ghc-7.4.1/package.conf.d:
>>Cabal-1.14.0
>>GLUT-2.1.2.1
> 
> 
>> bash-3.2$ ghc-7.4.1 --make nnClassifier.lhs -O2 -fforce-recomp
>> [1 of 6] Compiling MatrixPlus   ( MatrixPlus.hs, MatrixPlus.o )
>> [2 of 6] Compiling NeuralNet( NeuralNet.hs, NeuralNet.o )
>> [3 of 6] Compiling Backprop ( Backprop.hs, Backprop.o )
>> [4 of 6] Compiling MarineExplore( MarineExplore.hs, MarineExplore.o )
>> [5 of 6] Compiling Runner   ( Runner.hs, Runner.o )
>> [6 of 6] Compiling Main ( nnClassifier.lhs, nnClassifier.o )
>> Linking nnClassifier ...
>> ld: warning: directory not found for option '-L/opt/local/lib/'
>> bash-3.2$ ./nnClassifier 
>> Reading training labels...
>> Read 100 labels[(1,0),(2,1),(3,0),(4,1),(5,0),(6,0),(7,1),(8,0),(9,1),(10,0)]
>> Reading training images...
>> 9:9
>> 9:9
> 
> 


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Problems installing 7.6.2 on MACOS

2013-03-27 Thread Dominic Steinitz
Hi,

I followed the instructions pointed to from here: 
http://www.haskell.org/ghc/download_ghc_7_6_2#macosx_x86_64

> bash-3.2$ ./configure --prefix=/Library/Haskell


> bash-3.2$ sudo make install


But sadly I get:

> bash-3.2$ ghc-pkg list
> ghc-pkg: missing --global-package-db option, location of global package 
> database unknown


and

> bash-3.2$ ghc --make nnClassifier.lhs -O2
> ghc: missing -B option


Any advice on how to get 7.6.2 working would be much appreciated.

Dominic.

Here's some more information:

> bash-3.2$ which ghc-pkg
> /Library/Haskell/lib/ghc-7.6.2/ghc-pkg
> bash-3.2$ which ghc
> /Library/Haskell/lib/ghc-7.6.2/ghc

7.4.1 still works fine:

> bash-3.2$ ghc-pkg-7.4.1 list
> /Library/Frameworks/GHC.framework/Versions/7.4.1-x86_64/usr/lib/ghc-7.4.1/package.conf.d:
> Cabal-1.14.0
> GLUT-2.1.2.1


> bash-3.2$ ghc-7.4.1 --make nnClassifier.lhs -O2 -fforce-recomp
> [1 of 6] Compiling MatrixPlus   ( MatrixPlus.hs, MatrixPlus.o )
> [2 of 6] Compiling NeuralNet( NeuralNet.hs, NeuralNet.o )
> [3 of 6] Compiling Backprop ( Backprop.hs, Backprop.o )
> [4 of 6] Compiling MarineExplore( MarineExplore.hs, MarineExplore.o )
> [5 of 6] Compiling Runner   ( Runner.hs, Runner.o )
> [6 of 6] Compiling Main ( nnClassifier.lhs, nnClassifier.o )
> Linking nnClassifier ...
> ld: warning: directory not found for option '-L/opt/local/lib/'
> bash-3.2$ ./nnClassifier 
> Reading training labels...
> Read 100 labels[(1,0),(2,1),(3,0),(4,1),(5,0),(6,0),(7,1),(8,0),(9,1),(10,0)]
> Reading training images...
> 9:9
> 9:9



___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Is there a workaround for this bug?

2013-01-01 Thread Dominic Steinitz
Thanks - I'll probably wait for the next release.

On 1 Jan 2013, at 19:48, Simon Peyton-Jones  wrote:

> I think the patch did get into 7.6.2 (which is about to be released) though.
> 
> I don't think there's a workaround, except by not using External Core, or not 
> using Integer literals (use Ints?).  Sorry.
> 
> Simon
> 
> |  -Original Message-
> |  From: glasgow-haskell-users-boun...@haskell.org 
> [mailto:glasgow-haskell-users-
> |  boun...@haskell.org] On Behalf Of Dominic Steinitz
> |  Sent: 26 December 2012 18:14
> |  To: glasgow-haskell-users@haskell.org
> |  Subject: Is there a workaround for this bug?
> |  
> |  AFAICT this bug fix http://hackage.haskell.org/trac/ghc/ticket/7239 did 
> not make
> |  it into 7.6.1. Also I am happily working on the Haskell Platform with 
> 7.4.1 and I'd
> |  rather avoid upgrading if possible.
> |  
> |  Is there a workaround? I've attached my code below along with the error 
> message
> |  (which is the same as in the above bug report). I'm rather hoping I won't 
> have to
> |  build HEAD.
> |  
> |  Thanks, Dominic.
> |  
> |  bash-3.2$ ghc -fext-core --make Test.hs
> |  [1 of 1] Compiling Main ( Test.hs, Test.o )
> |  ghc: panic! (the 'impossible' happened)
> |   (GHC version 7.4.1 for x86_64-apple-darwin):
> | MkExternalCore died: make_lit
> |  
> |  {-# LANGUAGE FlexibleContexts #-}
> |  
> |  {-# OPTIONS_GHC -Wall -fno-warn-name-shadowing -fno-warn-type-defaults #-}
> |  
> |  import Data.Array.Repa as Repa
> |  import Data.Array.Repa.Eval
> |  import Control.Monad
> |  
> |  r, sigma, k, t, xMax, deltaX, deltaT :: Double
> |  m, n :: Int
> |  r = 0.05
> |  sigma = 0.2
> |  k = 50.0
> |  t = 3.0
> |  m = 80
> |  xMax = 150
> |  deltaX = xMax / (fromIntegral m)
> |  n = 800
> |  deltaT = t / (fromIntegral n)
> |  
> |  data PointedArrayU a = PointedArrayU Int (Array U DIM1 a)
> |   deriving Show
> |  
> |  f :: PointedArrayU Double -> Double
> |  f (PointedArrayU j _x) | j == 0 = 0.0
> |  f (PointedArrayU j _x) | j == m = xMax - k
> |  f (PointedArrayU j  x)  = a * x! (Z :. j-1) +
> |   b * x! (Z :. j) +
> |   c * x! (Z :. j+1)
> |   where
> | a = deltaT * (sigma^2 * (fromIntegral j)^2 - r * (fromIntegral j)) / 2
> | b = 1 - deltaT * (r  + sigma^2 * (fromIntegral j)^2)
> | c = deltaT * (sigma^2 * (fromIntegral j)^2 + r * (fromIntegral j)) / 2
> |  
> |  priceAtT :: PointedArrayU Double
> |  priceAtT = PointedArrayU 0 (fromListUnboxed (Z :. m+1)
> |[ max 0 (deltaX * (fromIntegral j) - k) | j <- 
> [0..m] ])
> |  
> |  coBindU :: (Source U a, Source U b, Target U b, Monad m) =>
> |PointedArrayU a -> (PointedArrayU a -> b) -> m (PointedArrayU  b)
> |  coBindU (PointedArrayU i a) f = computeP newArr >>= return . PointedArrayU 
> i
> |   where
> |   newArr = traverse a id g
> | where
> |   g _get (Z :. j) = f $ PointedArrayU j a
> |  
> |  testN :: Int -> IO (PointedArrayU Double)
> |  testN n =  h priceAtT
> |where
> |h = foldr (>=>) return
> |(take n $ Prelude.zipWith flip (repeat coBindU) (repeat f))
> |  
> |  main :: IO ()
> |  main = do r <- testN n
> |   putStrLn $ show r
> |  
> |  
> |  ___
> |  Glasgow-haskell-users mailing list
> |  Glasgow-haskell-users@haskell.org
> |  http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Is there a workaround for this bug?

2012-12-26 Thread Dominic Steinitz
AFAICT this bug fix http://hackage.haskell.org/trac/ghc/ticket/7239 did not 
make it into 7.6.1. Also I am happily working on the Haskell Platform with 
7.4.1 and I'd rather avoid upgrading if possible.

Is there a workaround? I've attached my code below along with the error message 
(which is the same as in the above bug report). I'm rather hoping I won't have 
to build HEAD.

Thanks, Dominic.

bash-3.2$ ghc -fext-core --make Test.hs
[1 of 1] Compiling Main ( Test.hs, Test.o )
ghc: panic! (the 'impossible' happened)
 (GHC version 7.4.1 for x86_64-apple-darwin):
MkExternalCore died: make_lit

{-# LANGUAGE FlexibleContexts #-}

{-# OPTIONS_GHC -Wall -fno-warn-name-shadowing -fno-warn-type-defaults #-}

import Data.Array.Repa as Repa
import Data.Array.Repa.Eval
import Control.Monad

r, sigma, k, t, xMax, deltaX, deltaT :: Double
m, n :: Int
r = 0.05
sigma = 0.2
k = 50.0
t = 3.0
m = 80
xMax = 150
deltaX = xMax / (fromIntegral m)
n = 800
deltaT = t / (fromIntegral n)

data PointedArrayU a = PointedArrayU Int (Array U DIM1 a)
 deriving Show

f :: PointedArrayU Double -> Double
f (PointedArrayU j _x) | j == 0 = 0.0
f (PointedArrayU j _x) | j == m = xMax - k
f (PointedArrayU j  x)  = a * x! (Z :. j-1) +
 b * x! (Z :. j) +
 c * x! (Z :. j+1)
 where
   a = deltaT * (sigma^2 * (fromIntegral j)^2 - r * (fromIntegral j)) / 2
   b = 1 - deltaT * (r  + sigma^2 * (fromIntegral j)^2)
   c = deltaT * (sigma^2 * (fromIntegral j)^2 + r * (fromIntegral j)) / 2

priceAtT :: PointedArrayU Double
priceAtT = PointedArrayU 0 (fromListUnboxed (Z :. m+1) 
  [ max 0 (deltaX * (fromIntegral j) - k) | j <- [0..m] 
])

coBindU :: (Source U a, Source U b, Target U b, Monad m) =>
  PointedArrayU a -> (PointedArrayU a -> b) -> m (PointedArrayU  b)
coBindU (PointedArrayU i a) f = computeP newArr >>= return . PointedArrayU i
 where
 newArr = traverse a id g
   where
 g _get (Z :. j) = f $ PointedArrayU j a

testN :: Int -> IO (PointedArrayU Double)
testN n =  h priceAtT
  where
  h = foldr (>=>) return
  (take n $ Prelude.zipWith flip (repeat coBindU) (repeat f))

main :: IO ()
main = do r <- testN n
 putStrLn $ show r


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


hp2ps Bug?

2011-08-17 Thread Dominic Steinitz
If I use profiling on windows with relative path names e.g. the first line in 
the .hp file is something like:

JOB "ScriptUsage.exe -t ..\FPF\TradeDesc\TradesTags.txt -f ..\out\FPOs -
u ..\Data\LogStarted090511c +RTS -H256M -hc"

then hp2ps produces nonsense.

If I replace this line with:

JOB "ScriptUsage.exe +RTS -H256M -hc"

then it works.

Is this a known bug or should I try to raise one?

Thanks, Dominic.


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: HPC gives spurious results if sources are compiled with -cpp

2009-07-18 Thread Dominic Steinitz
Ian Lynagh wrote:
> On Wed, Jul 15, 2009 at 04:05:14PM +0000, Dominic Steinitz wrote:
>> Simon Marlow  gmail.com> writes:
>>
>>> On 14/07/2009 10:08, Dominic Steinitz wrote:
>>>> Trac doesn't seem to work for us so I'm sending this bug report by email.
>>> What's the symptom?
>>>
>>> Cheers,
>>> Simon
>>>
>> I hit "New Bug" and get
>>
>> TICKET_CREATE privileges are required to perform this operation
>>
>> If I then hit "login" I get a Create New Ticket screen.
>>
>> I then fill in the details and hit submit and I get
>>
>> TICKET_CREATE privileges are required to perform this operation 
>>
>> and all my details are lost :-(
> 
> I've explicitly added "dominic" and "Dominic" to group "user", but I
> don't think that should be necessary.
> 
> If that doesn't fix it then my guess would be that you have some sort of
> firewall or HTTP proxy that is fiddling with the cookie data.
> 
> When you log in, does trac say "logged in as ...", or does it still look
> like you are not logged in?
> 
> 
> Thanks
> Ian
> 
> 
> 
Ian,

We are behind a proxy and a firewall so that's the most likely
explanation. I don't think I have a problem logging in to other sites
(I'm sure I would have noticed). I'm not in work now so I can't try
anything out. I know I have to set up various darcs environment
variables at work to get darcs to work (DARCS_PROXYUSERPWD is one and
there may be another).

Thanks for investigating, Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: HPC gives spurious results if sources are compiled with -cpp

2009-07-15 Thread Dominic Steinitz
Simon Marlow  gmail.com> writes:

> 
> On 14/07/2009 10:08, Dominic Steinitz wrote:
> > Trac doesn't seem to work for us so I'm sending this bug report by email.
> 
> What's the symptom?
> 
> Cheers,
>   Simon
> 
I hit "New Bug" and get

TICKET_CREATE privileges are required to perform this operation

If I then hit "login" I get a Create New Ticket screen.

I then fill in the details and hit submit and I get

TICKET_CREATE privileges are required to perform this operation 

and all my details are lost :-(


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



HPC gives spurious results if sources are compiled with -cpp

2009-07-14 Thread Dominic Steinitz
Trac doesn't seem to work for us so I'm sending this bug report by email.

ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.10.1

ghc.exe -fhpc -cpp --make CommonHPC.hs -o CommonHPC

commonHPC

hpc markup CommonHPC --fun-entry-count

This gives no entry counts for fact in Common.hs. With more complex modules, 
you get spurious red, yellow and green over expressions.

Dominic.

CommonHPC.hs:

module Main (main) where

import Common

main = do
  test
  test

test = do
  putStrLn $ show $ fact 4
  putStrLn $ show $ fact 5

Common.hs:

module Common (
   fact
)
where

fact 0 = 1
fact n = n * fact (n-1)



___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GADT Strangeness

2009-01-10 Thread Dominic Steinitz
Simon Peyton-Jones wrote:

> | Is it worth noting it here
> | http://haskell.org/haskellwiki/Upgrading_packages#Changes_to_GADT_matching
> | or is it something that has always existed with GADTs and I just didn't
> | trip over it?
> 
> I've added a para.  Good idea.

Thanks very much. I'm slightly embarassed: what I meant was that I would
add the paragraph if you thought it was worth doing.

> OK.  let's see if anyone else comments.  Do ping me in a while to action it 
> if I forget.

I suppose its priority depends on how many people start to get tripped
up. I'm guessing there aren't that many GADT users who don't know (by
now at any rate) how to understand the error messages. I'm sure there
are plenty of higher priority items.

Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GADT Strangeness

2009-01-03 Thread Dominic Steinitz
Simon Peyton-Jones wrote:
> | If I remove -XScopedTypeVariables from this http://hpaste.org/13230
> then | I get the following error message: | | >
> Asn1cTestNew.hs:55:27: | > GADT pattern match in non-rigid
> context for `INTEGER' | >   Solution: add a type signature | >
> In the pattern: INTEGER | > In the definition of
> `referenceTypeAndValAux2': | > referenceTypeAndValAux2 ns
> INTEGER x | >   = lhs ns <> text " =
> " <> text (show x) <> semi | > Failed, modules loaded: Language.ASN1,
> ASNTYPE. | | At the very least the message is unhelpful. It was only
> by accident I | decided to put in -XScopedTypeVariables.
> 
> This one had me puzzled for a while too! Here is what's happening.
> 
> You have three mutually recursive functions: referenceTypeAndValAux1 
> referenceTypeAndValAux2 cSEQUENCE In Haskell 98, typechecking
> mutually recursive functions is done *together*, with each having a
> momomorphic type in the other RHSs.  That leads to an annoying
> problem, that of figuring out how their polymorphic type variables
> "match up".  As a result, even the type variables in the type
> signature look non-rigid.
> 
> The solution is to use -XRelaxedPolyRec, which compiles
> mutually-recursive definitions that each have a type signature one by
> one.  Precisely because of the above infelicity, both -XGADTs and
> -XScopedTypeVariables imply -XRelaxedPolyRec.

Thanks very much for this. I would never have guessed to use
-XRelaxedPolyRec given the error message.

Is it worth noting it here
http://haskell.org/haskellwiki/Upgrading_packages#Changes_to_GADT_matching
or is it something that has always existed with GADTs and I just didn't
trip over it?

> 
> This is a nasty corner I agree.  GHC requires -XGADTs for you to
> *define* a GADT. Perhaps it should also require -XGADTs for you to
> *match against* one (as you are doing here).  That would avoid this
> particular hole.  If you think that would be a step forward, do put
> forward a Trac feature request, and encourage others to support it.

I would vote for this. In fact I was mildly surprised I could use GADTs
without specifying -XGADTs.

I noticed that Isaac Dupree has already raised a ticket
http://permalink.gmane.org/gmane.comp.lang.haskell.glasgow.user/16109 so
I will add my support to it.

Many thanks and a happy new year, Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


GADT Strangeness

2008-12-21 Thread Dominic Steinitz
If I remove -XScopedTypeVariables from this http://hpaste.org/13230 then
I get the following error message:

> Asn1cTestNew.hs:55:27:
> GADT pattern match in non-rigid context for `INTEGER'
>   Solution: add a type signature
> In the pattern: INTEGER
> In the definition of `referenceTypeAndValAux2':
> referenceTypeAndValAux2 ns INTEGER x
>   = lhs ns <> text " = " <> text (show x) <> 
> semi
> Failed, modules loaded: Language.ASN1, ASNTYPE.

At the very least the message is unhelpful. It was only by accident I
decided to put in -XScopedTypeVariables.

Can anyone offer an explanation as to what is happening?

Dominic.


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GADT Type Checking GHC 6.10 versus older GHC

2008-11-28 Thread Dominic Steinitz
Simon Peyton-Jones wrote:
> | > arbitrarySeq :: Sequence a -> Gen RepSeqVal
> | > arbitrarySeq Nil =
> | >return (RepSeqVal Nil Empty)
> | > arbitrarySeq (Cons (CTMandatory (NamedType n i t)) ts) =
> | >do u <- arbitraryType t
> | >   us <- arbitrarySeq ts
> | >   case u of
> | >  RepTypeVal a v ->
> | > case us of
> | >RepSeqVal bs vs ->
> | >   return (RepSeqVal (Cons (CTMandatory (NamedType n i a)) 
> bs) (v:*:vs))
> |
> |
> | > QuickTest.lhs:240:13:
> | > GADT pattern match in non-rigid context for `Nil'
> | >   Solution: add a type signature
> | > In the pattern: Nil
> | > In the definition of `arbitrarySeq':
> | > arbitrarySeq Nil = return (RepSeqVal Nil Empty)
> 
> That looks odd to me.  But it's hard to help without having the code. If you 
> send it I'll try to help.
> 
> | > Did you try giving a type signature to the (entire) case expression,
> | > as I suggested?  That should do it.
> | >
> |
> | I'm not sure what this means or how to do it. Can you give an example or
> | is it buried in some earlier email? I will go and have another look.
> 
> I mean replace
> (case blah of { ... })
> by
> (case blah of { ... }) :: type-sig
> 
> That is, attach a type signature to the case expression itself.  Does that 
> help at least explain what the sentence means? If so would you like to 
> clarify the wiki advice?
> 
> Thanks
> 
> Simon
> 
> 
Simon,

I'm sorry to have put you to so much trouble by accidentally using an
old version of ghc I must have had lying around. As penance, I will go
and update the wiki with what I have learnt.

Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GADT Type Checking GHC 6.10 versus older GHC

2008-11-28 Thread Dominic Steinitz
Simon Peyton-Jones wrote:
> | > I also feel that the type errors given when working with existential
> | > types, especially GADTs with existentials, are confusing.  I think
> |
> | I am using existential types to test GADT code. See
> | http://www.haskell.org/haskellwiki/QuickCheck_/_GADT which no longer
> | works with 6.10.1.
> 
> Really?  I've just compiled that entire page with 6.10.1, and it was fine, 
> except that I had to add a type signature for prettyRep.  No problems there.
> 
> Simon
> 
> 
Sorry I inadvertently used an old copy of ghc.

Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GADT Type Checking GHC 6.10 versus older GHC

2008-11-28 Thread Dominic Steinitz
Ignore my last email. I was accidentally using

> The Glorious Glasgow Haskell Compilation System, version 6.9.20080616

Mind you I am still having problems just not the same ones. I'll report
back later.

Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


GADT Type Checking GHC 6.10 versus older GHC

2008-11-27 Thread Dominic Steinitz
> In my case, we had rigid type signatures all over the place.  The
> wiki document says that the type must be rigid at the point of the
> match.  I guess that's what we were violating.  If the code I posted
> isn't supposed to type check then I would like to report, as user
> feedback, that GADTs have become unwieldy.

I'm now running into this problem big time on my existing test harness
(I'd previously checked the main code and that worked - see
http://www.haskell.org/pipermail/glasgow-haskell-users/2008-November/016160.html).

> 
> I grant that it's less convenient than one would like.  The
> difficulty is that GADTs get you into territory where it's easy to
> write programs that  have multiple *incomparable* types.   That is,
> there is no "best" type (unlike Hindley-Milner).  So we pretty much
> have to ask the programmer to express the type.
> 
> Once we are in that territory, we need to give simple rules that say
> when a type signature is needed.   I know that I have not yet found a
> way to express these rules -- perhaps GHC's users can help.  My
> initial shot is
> http://haskell.org/haskellwiki/Upgrading_packages%23Changes_to_GADT_matching#Changes_to_GADT_matching
> 
> I couldn't figure out how to fix that code by just adding a type
> signature.

I've read this and I couldn't figure it out either. I've tried the
heuristic and it works fine for some cases but not others:

> arbitrarySeq :: Sequence a -> Gen RepSeqVal
> arbitrarySeq Nil =
>return (RepSeqVal Nil Empty)
> arbitrarySeq (Cons (CTMandatory (NamedType n i t)) ts) =
>do u <- arbitraryType t
>   us <- arbitrarySeq ts
>   case u of
>  RepTypeVal a v ->
> case us of
>RepSeqVal bs vs ->
>   return (RepSeqVal (Cons (CTMandatory (NamedType n i a)) bs) 
> (v:*:vs))


> QuickTest.lhs:240:13:
> GADT pattern match in non-rigid context for `Nil'
>   Solution: add a type signature
> In the pattern: Nil
> In the definition of `arbitrarySeq':
> arbitrarySeq Nil = return (RepSeqVal Nil Empty)

> *Rename> :t Nil
> Nil :: Sequence Nil

So this fixes the first case:

> arbitrarySeq :: Sequence a -> Gen RepSeqVal
> arbitrarySeq (Nil :: Sequence Nil) =
>return (RepSeqVal Nil Empty)

But not the second case:

> QuickTest.lhs:242:14:
> GADT pattern match in non-rigid context for `Cons'
>   Solution: add a type signature
> In the pattern: Cons (CTMandatory (NamedType n i t)) ts
> In the definition of `arbitrarySeq':
> arbitrarySeq (Cons (CTMandatory (NamedType n i t)) ts)
>= do u <- arbitraryType t
> us <- arbitrarySeq ts
> case u of RepTypeVal a v -> ...

And now I'm stuck:

> *Rename> :t Cons
> Cons :: ComponentType a -> Sequence l -> Sequence (a :*: l)

What type should I give the Cons pattern? If I try the heuristic:

> arbitrarySeq ((Cons (CTMandatory (NamedType n i t)) ts) :: Int) =

the the compiler suggests

> QuickTest.lhs:242:14:
> Couldn't match expected type `Sequence a'
>against inferred type `Int'

but trying

> arbitrarySeq ((Cons (CTMandatory (NamedType n i t)) ts) :: Sequence a) =

gives

> QuickTest.lhs:242:68: Not in scope: type variable `a'


> 
> Did you try giving a type signature to the (entire) case expression,
> as I suggested?  That should do it.
> 

I'm not sure what this means or how to do it. Can you give an example or
is it buried in some earlier email? I will go and have another look.

> I urge you to consider designing a modified or new syntactic form for
> working with GADT pattern matches.  The quasi-dependent typing that
> GADTs give developers is very powerful and it would seem that GHC
> Haskell with GADTs is as close to dependent typing that developers
> writing "real-world" software can get.  I know of no other production
> ready compilers that provide dependent or close to dependent typing.
> Dependent typing seems to be a growing area of interest.  For these
> reasons I think it's important for GHC to focus on making them
> pleasanter to work with again; even if it means adding to the
> language again.
> 
> If I knew how to do that, I'd love to.  Here's one idea you might not
> like: restrict GADT matching to function definitions only (not case
> expressions), and require a type signature for such pattern matches.
> That wouldn't require adding new stuff.  But GHC's current story is a
> bit more flexible.
> 
> I also feel that the type errors given when working with existential
> types, especially GADTs with existentials, are confusing.  I think

I am using existential types to test GADT code. See
http://www.haskell.org/haskellwiki/QuickCheck_/_GADT which no longer
works with 6.10.1.

> mostly because the types of the sub-expressions in the program are
> not visible to the user.  More introspection into the inferred types
> would help users.  I have some ideas on how to improve this, what the
> output shoul

Re: GADT Type Checking GHC 6.10 versus older GHC

2008-11-22 Thread Dominic Steinitz
Dominic Steinitz  blueyonder.co.uk> writes:

>
> packaged form for my flavour of linux. I will put some work into doing this
> today and report back.
> 
> Dominic.
> 

Phew - I installed the windows 6.10.1 package and everything to do with GADTs
still seems to work.

Dominic.


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GADT Type Checking GHC 6.10 versus older GHC

2008-11-22 Thread Dominic Steinitz
Jason Dagit  codersbase.com> writes:

> 
> 
> On Fri, Nov 21, 2008 at 8:57 AM, Simon Peyton-Jones 
microsoft.com> wrote:
> You need a type signature for the case expression.  As Daniel says, this is
worth a
readhttp://haskell.org/haskellwiki/Upgrading_packages%23Changes_to_GADT_matching#Changes_to_GADT_matching
> 
> 
> Thanks Simon.  I had read that several times in the past and I've pointed it
out to others.  It's still relevant but, my question was about whether or not
examples like the one posted are really in error or if GHC is just being overly
strict now.
> 
> In my case, we had rigid type signatures all over the place.  The wiki
document says that the type must be rigid at the point of the match.  I guess
that's what we were violating.  If the code I posted isn't supposed to type
check then I would like to report, as user feedback, that GADTs have become
unwieldy.

This is really worrying. I have spent some considerable time using GADTs to
structure a library. I haven't tried 6.10 yet because it's not available in a
packaged form for my flavour of linux. I will put some work into doing this
today and report back.

Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: 6.10.1 Bug?

2008-11-18 Thread Dominic Steinitz
Dominic Steinitz wrote:
> According to the hackage page, the Haskell Cryptography Library has a
> build failure. I couldn't find a bug reference when I searched for
> milestone 6.10.1 on trac. Should I report it? Has it been fixed?
> 
> Thanks, Dominic.
> 
> http://hackage.haskell.org/packages/archive/Crypto/4.1.0/logs/failure/ghc-6.10
> 
>> [4 of 4] Compiling Main ( SHA1Test.hs, 
>> dist/build/SHA1Test/SHA1Test-tmp/Main.o )
>> ghc: panic! (the 'impossible' happened)
>>   (GHC version 6.10.1 for i386-unknown-linux):
>>  RegAllocLinear.getStackSlotFor: out of stack slots, try -fregs-graph
>>
>> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
> 
> 

I found it. It was filed under milestone 6.10.2 (clearly I don't
understand milestones).

http://hackage.haskell.org/trac/ghc/ticket/2753

It seems a bit vague on what's happening. Is it going to be fixed? Has
it been fixed?

Thanks, Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


6.10.1 Bug?

2008-11-17 Thread Dominic Steinitz
According to the hackage page, the Haskell Cryptography Library has a
build failure. I couldn't find a bug reference when I searched for
milestone 6.10.1 on trac. Should I report it? Has it been fixed?

Thanks, Dominic.

http://hackage.haskell.org/packages/archive/Crypto/4.1.0/logs/failure/ghc-6.10

> [4 of 4] Compiling Main ( SHA1Test.hs, 
> dist/build/SHA1Test/SHA1Test-tmp/Main.o )
> ghc: panic! (the 'impossible' happened)
>   (GHC version 6.10.1 for i386-unknown-linux):
>   RegAllocLinear.getStackSlotFor: out of stack slots, try -fregs-graph
> 
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Rebuilding ghc

2008-06-16 Thread Dominic Steinitz
Ian Lynagh wrote:
> On Mon, Jun 16, 2008 at 08:12:49AM +0100, Dominic Steinitz wrote:
>> Thanks. I put the flag in the right place and got further but see below.
>>
>>> ../compiler/ghc-inplace -H32m -O2 -fasm -Rghc-timing -optc-O2 -I../includes 
>>> -I. -Iparallel -Ism -DCOMPILING_RTS -package-name rts -fvia-C -static  
>>> -I../gmp/gmp uild -I../libffi/build/include -I. -dcmm-lint -c 
>>> PrimOps.cmm -o PrimOps.o
>>> PrimOps.cmm:945:0: unknown macro: RET_
> 
> RET_ is a relatively recent addition to compiler/cmm/CmmParse.y by
> the patch
> [Fix conversions between Double/Float and simple-integer
> Ian Lynagh <[EMAIL PROTECTED]>**20080614152337] {
> I suspect that for some reason something didn't rebuild properly after
> you pulled that patch.
> 
> 
> Thanks
> Ian
> 
> 
Success!

> [EMAIL PROTECTED]:~/ghc> ghc --version
> The Glorious Glasgow Haskell Compilation System, version 6.9.20080616

Thanks, Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Rebuilding ghc

2008-06-16 Thread Dominic Steinitz
Simon Peyton-Jones wrote:
> | Where do I put -fno-ds-multi-tyvar so that the build system knows
> to use | it? I'm going to try build.mk. | | Ok that didn't work and I
> couldn't find anything about | -fno-ds-multi-tyvar in the
> documentation.
> 
> Yes, in GhcLibHcOpts in build.mk is a good place.  The flag isn't
> documented because it's a debug-only flag that I threw in so that I
> can measure the effect of this particular desugaring change.  It's
> not really intended for users -- hard to explain just what it does.
> 
> In any case I'm just about to push a patch which fixes the original
> problem and makes the flag unnecessary for your purposes.
> 

Thanks. I put the flag in the right place and got further but see below.

Dominic.

PS I appreciate all the help I'm getting.

> ../compiler/ghc-inplace -H32m -O2 -fasm -Rghc-timing -optc-O2 -I../includes 
> -I. -Iparallel -Ism -DCOMPILING_RTS -package-name rts -fvia-C -static  
> -I../gmp/gmp uild -I../libffi/build/include -I. -dcmm-lint -c PrimOps.cmm 
> -o PrimOps.o
> PrimOps.cmm:945:0: unknown macro: RET_
> < samples)  32M in use, 0.00 INIT (0.00 elapsed), 0.09 MUT (0.13 elapsed), 0.01 
> GC (0.01 e apsed) :ghc>>
> make[1]: *** [PrimOps.o] Error 1
> make: *** [stage1] Error 1

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Rebuilding ghc

2008-06-13 Thread Dominic Steinitz
Simon Peyton-Jones wrote:
> Sorry about this -- it's my fault.  I did validate a fix to the
> desugarer, but ndp isn't part of 'validate'.  Turns out that the
> change to the desugarer provoked quite subtle and longstanding bug in
> the simplifier.
> 
> To get rolling again, use -fno-ds-multi-tyvar. Or just don't compile
> NDP. I'll commit a patch shortly.
> 

The reason I'm compiling rather than installing is because I want to use
NDP.

Where do I put -fno-ds-multi-tyvar so that the build system knows to use
it? I'm going to try build.mk.

Ok that didn't work and I couldn't find anything about
-fno-ds-multi-tyvar in the documentation.

Thanks, Dominic.

> ../utils/mkdependC/mkdependC -f .depend-I. -Iinclude -I../includes  -- -O 
> -I. -Iinclude -D__GHC_PATCHLEVEL__=20080517 -I../libraries/base/cbits 
> -I../libraries/base/include-- cbits/directory.c cbits/rawSystem.c 
> cbits/unicode.c
> /usr/local/bin/ghc -M -optdep-f -optdep.depend  -osuf o-H32m -O2 -fasm 
> -Rghc-timing -fno-ds-multi-tyvar -w -I. -Iinclude -Rghc-timing -O0 -W 
> -package directory -package pretty -I../libraries -fglasgow-exts -no-recomp 
> Compat/Unicode.hs Distribution/Compat/Exception.hs 
> Distribution/Compat/ReadP.hs Distribution/Compat/TempFile.hs 
> Distribution/Compiler.hs Distribution/GetOpt.hs 
> Distribution/InstalledPackageInfo.hs Distribution/License.hs 
> Distribution/Package.hs Distribution/ParseUtils.hs Distribution/ReadE.hs 
> Distribution/Simple/Program.hs Distribution/Simple/Utils.hs 
> Distribution/System.hs Distribution/Text.hs Distribution/Verbosity.hs 
> Distribution/Version.hs Language/Haskell/Extension.hs System/FilePath.hs 
> System/FilePath/Posix.hs System/FilePath/Windows.hs Trace/Hpc/Mix.hs 
> Trace/Hpc/Tix.hs Trace/Hpc/Util.hs
> ghc-6.9.20080517: unrecognised flags: -fno-ds-multi-tyvar
> Usage: For basic information, try the `--help' option.
> < samples), 31M in use, 0.00 INIT (0.00 elapsed), 0.03 MUT (0.04 elapsed), 0.01 
> GC (0.01 elapsed) :ghc>>
> make[1]: *** [depend] Error 1
> make: *** [stage1] Error 1

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Rebuilding ghc

2008-06-12 Thread Dominic Steinitz
This is becoming a bit of an odyssey ("a series of vicissitudes"). I now
get a bug in ghc. Should I report it?

Dominic.

> /home/dom/ghc/compiler/stage1/ghc-inplace -package-name ndp-0.2 
> -hide-all-packag
> es -i -idist/build -i. -idist/build/autogen -Idist/build -Iinclude -odir 
> dist/bu
> ild -hidir dist/build -stubdir dist/build -package array-0.1 -package 
> base-3.0 -
> package ghc-prim-0.1 -package random-1.0 -O -O2 -funbox-strict-fields 
> -fdicts-ch
> eap -fno-method-sharing -fno-spec-constr-threshold 
> -fmax-simplifier-iterations10
>  -haddock -fcpr-off -package-name ndp -XTypeFamilies -XGADTs -XRankNTypes 
> -XBang
> Patterns -XMagicHash -XUnboxedTuples -XTypeOperators -idist/build  -H32m -O2 
> -fa
> sm -Rghc-timing -O -fgenerics  -c Data/Array/Parallel/Base/Rebox.hs -o 
> dist/buil
> d/Data/Array/Parallel/Base/Rebox.o  -ohi 
> dist/build/Data/Array/Parallel/Base/Reb
> ox.hi
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sjZ} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sjY} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sk5} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sk4} [lid]
> WARNING: file coreSyn/CoreSubst.lhs line 182
> CoreSubst.lookupIdSubst dseq{v sk4} [lid]
> WARNING: file coreSyn/CoreSubst.lhs line 182
> CoreSubst.lookupIdSubst rebox{v sk5} [lid]
> WARNING: file coreSyn/CoreSubst.lhs line 182
> CoreSubst.lookupIdSubst dseq{v sjY} [lid]
> WARNING: file coreSyn/CoreSubst.lhs line 182
> CoreSubst.lookupIdSubst rebox{v sjZ} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sjZ} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sjY} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sk5} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sk4} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sjZ} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sjY} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sk5} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sk4} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sjZ} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sjY} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sk5} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sk4} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sjZ} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sjY} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sk5} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sk4} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sjZ} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sjY} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 rebox{v sk5} [lid]
> WARNING: file simplCore/SimplEnv.lhs line 470 dseq{v sk4} [lid]
> WARNING: file stgSyn/CoreToStg.lhs line 217
> ndp:Data.Array.Parallel.Base.Rebox.$f2{v rfZ} [gid]
> ghc-6.9.20080612: panic! (the 'impossible' happened)
>   (GHC version 6.9.20080612 for i386-unknown-linux):
> ASSERT failed! file stgSyn/CoreToStg.lhs line 184
> ndp:Data.Array.Parallel.Base.Rebox.$f2{v rfZ} [gid]
> \ (@ a{tv ae0} [sk] :: ghc-prim:GHC.Prim.*{(w) tc 34d}) ->
>   ndp:Data.Array.Parallel.Base.Rebox.:DRebox{v rf4} [gid]
> @ (ndp:Data.Array.Parallel.Base.Rebox.Box{tc rdA}
>  a{tv ae0} [sk])
> (rebox{v sjZ} [lid] @ a{tv ae0} [sk])
> (dseq{v sjY} [lid] @ a{tv ae0} [sk])
> ndp:Data.Array.Parallel.Base.Rebox.$f2{v rfZ} [gid] =
> NO_CCS ndp:Data.Array.Parallel.Base.Rebox.:DRebox{d reZ}! [rebox{v sjZ} 
> [lid   ]
>dseq{v sjY} 
> [lid]   ];
> 
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
> 
> < samples)   , 35M in 
> use, 0.00 INIT (0.00 elapsed), 0.22 MUT (0.25 elapsed), 0.02 GC (0.02 e   
> lapsed) :ghc>>
> make[2]: *** [dist/build/Data/Array/Parallel/Base/Rebox.o] Error 1
> make[2]: Leaving directory `/home/dom/ghc/libraries/ndp'
> make[1]: *** [make.library.ndp] Error 2
> make[1]: Leaving directory `/home/dom/ghc/libraries'
> make: *** [stage1] Error 2


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Rebuilding ghc

2008-06-12 Thread Dominic Steinitz
>>> Configuring editline-0.2...
>>> Setup: Version mismatch between ghc and ghc-pkg:
>>> /home/dom/ghc/compiler/stage1/ghc-inplace is version 6.9.20080606
>>> /home/dom/ghc/utils/ghc-pkg/ghc-pkg-inplace is version 6.9.20080612
> 
> From the above error, I suspect that you need to run "make distclean"
> in the root of the source tree, then try building again.  (I usually
> run that command every time before/after pulling from darcs.)
> 
> Let me know if that helps,
> -Judah
> 
> 

Ok but doesn't that rebuild everything not just the bits that have changed?

BTW it's still running.

Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Rebuilding ghc

2008-06-12 Thread Dominic Steinitz
Judah Jacobson wrote:
> On Tue, Jun 10, 2008 at 1:39 PM, Dominic Steinitz
> <[EMAIL PROTECTED]> wrote:
>> I've built ghc previously and I assumed to keep it up to date I just did

> 
> From that error, I suspect you have a conflict in the editline
> package, and the compiler is barfing on the marker "vv" which is
> inserted by darcs.  Strange...
> 
> If you weren't planning on hacking editline, it's probably easiest to
> just rm -rf the libraries/editline directory and do another "darcs-all
> get" to replace it with a consistent version.  Otherwise, send me the
> darcs --changes of that repo and I can take a look at it.
> 
> Hope that helps,
> -Judah
> 
>

Judah,

Thanks for your help but now I'm getting a mismatch between ghc and
ghc-pkg. I'm not sure how to fix this.

Dominic.

> Preprocessing library template-haskell-2.2...
> Generating Makefile template-haskell-2.2...
> make[2]: Entering directory `/home/dom/ghc/libraries/template-haskell'
> make[2]: Leaving directory `/home/dom/ghc/libraries/template-haskell'
> Registering template-haskell-2.2...
> Reading package info from "dist/inplace-pkg-config" ... done.
> Saving old package config file... done.
> Writing new package config file... done.
> rm -f -f stamp/configure.library.*.editline editline/unbuildable
> ../utils/mkdirhier/mkdirhier `dirname stamp/configure.library.build.editline`
> ( cd editline && setup/Setup configure  --prefix=/NONEXISTENT 
> --bindir=/NONEXIST
> ENT --libdir=/NONEXISTENT --libsubdir='$pkgid' --libexecdir=/NONEXISTENT 
> --datad
> ir=/NONEXISTENT --docdir=/NONEXISTENT --haddockdir=/NONEXISTENT 
> --htmldir=/NONEX
> ISTENT --with-compiler=/home/dom/ghc/compiler/stage1/ghc-inplace 
> --with-hc-pkg=/
> home/dom/ghc/utils/ghc-pkg/ghc-pkg-inplace 
> --with-hsc2hs=/home/dom/ghc/utils/hsc
> 2hs/hsc2hs-inplace --with-ld=/usr/bin/ld 
> --haddock-options="--use-contents=../in
> dex.html --use-index=../doc-index.html"--configure-option=--with-cc=gcc ) 
> \
>   && touch stamp/configure.library.build.editline || touch 
> editline/
> unbuildable
> Warning: defaultUserHooks in Setup script is deprecated.
> Configuring editline-0.2...
> Setup: Version mismatch between ghc and ghc-pkg:
> /home/dom/ghc/compiler/stage1/ghc-inplace is version 6.9.20080606
> /home/dom/ghc/utils/ghc-pkg/ghc-pkg-inplace is version 6.9.20080612
> if ifBuildable/ifBuildable /home/dom/ghc/libraries/boot-packages editline; 
> then
> \
>   cd editline && \
>   cmp -s /home/dom/ghc/libraries/Makefile.local Makefile.local || cp 
> /ho
> me/dom/ghc/libraries/Makefile.local .; \
>   mv GNUmakefile GNUmakefile.tmp; \
>   setup/Setup makefile -f GNUmakefile; \
>   cmp -s GNUmakefile GNUmakefile.tmp && mv GNUmakefile.tmp 
> GNUmakefile;
> \
>   make -wr && \
>   setup/Setup register --inplace; \
> fi
> Warning: Package is unbuildable
> rm -f -f stamp/configure.library.*.Cabal Cabal/unbuildable
> ../utils/mkdirhier/mkdirhier `dirname stamp/configure.library.build.Cabal`
> ( cd Cabal && setup/Setup configure  --prefix=/NONEXISTENT 
> --bindir=/NONEXISTENT
>  --libdir=/NONEXISTENT --libsubdir='$pkgid' --libexecdir=/NONEXISTENT 
> --datadir=
> /NONEXISTENT --docdir=/NONEXISTENT --haddockdir=/NONEXISTENT 
> --htmldir=/NONEXIST
> ENT --with-compiler=/home/dom/ghc/compiler/stage1/ghc-inplace 
> --with-hc-pkg=/hom
> e/dom/ghc/utils/ghc-pkg/ghc-pkg-inplace 
> --with-hsc2hs=/home/dom/ghc/utils/hsc2hs
> /hsc2hs-inplace --with-ld=/usr/bin/ld 
> --haddock-options="--use-contents=../index
> .html --use-index=../doc-index.html"--configure-option=--with-cc=gcc ) \
>   && touch stamp/configure.library.build.Cabal || touch 
> Cabal/unbuil
> dable
> Configuring Cabal-1.5.1...
> Setup: Version mismatch between ghc and ghc-pkg:
> /home/dom/ghc/compiler/stage1/ghc-inplace is version 6.9.20080606
> /home/dom/ghc/utils/ghc-pkg/ghc-pkg-inplace is version 6.9.20080612
> if ifBuildable/ifBuildable /home/dom/ghc/libraries/boot-packages Cabal; then \
>   cd Cabal && \
>   cmp -s /home/dom/ghc/libraries/Makefile.local Makefile.local || cp 
> /ho
> me/dom/ghc/libraries/Makefile.local .; \
>   mv GNUmakefile GNUmakefile.tmp; \
>   setup/Setup makefile -f GNUmakefile; \
>   cmp -s GNUmakefile GNUmakefile.tmp && mv GNUmakefile.tmp 
> GNUmakefile;\
>   make -wr && \
>   setup/Setup register --inplace; \
>   

Rebuilding ghc

2008-06-10 Thread Dominic Steinitz
I've built ghc previously and I assumed to keep it up to date I just did

darcs pull

followed by

make

but I got errors and according to the rebuilding instructions
http://hackage.haskell.org/trac/ghc/wiki/Building/Rebuilding I shouldn't
have done that.

I therefore followed the instructions but got the following error. By
the way darcs-pull all seemed to require a lot of manual intervention.
Is there a way of getting the latest patches automatically and building
overnight without intervention?

Thanks, Dominic.

> if ifBuildable/ifBuildable /home/dom/ghc/libraries/boot-packages editline; 
> then \
>   cd editline && \
>   cmp -s /home/dom/ghc/libraries/Makefile.local Makefile.local || cp 
> /home/dom/ghc/libraries/Makefile.local .; \
>   mv GNUmakefile GNUmakefile.tmp; \
>   setup/Setup makefile -f GNUmakefile; \
>   cmp -s GNUmakefile GNUmakefile.tmp && mv GNUmakefile.tmp 
> GNUmakefile; \
>   make -wr && \
>   setup/Setup register --inplace; \
> fi
> mv: cannot stat `GNUmakefile': No such file or directory
> Preprocessing library editline-0.2...
> In file included from Editline.hsc:52:
> include/HsEditline.h:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
> ‘__attribute__’ before ‘v’
> compiling dist/build/System/Console/Editline_hsc_make.c failed
> command was: gcc -c -D__GLASGOW_HASKELL__=609 -I/home/dom/ghc/includes 
> -I/home/dom/ghc/gmp/gmpbuild -D__GLASGOW_HASKELL__=609 -Iinclude 
> dist/build/System/Console/Editline_hsc_make.c -o 
> dist/build/System/Console/Editline_hsc_make.o
> make[2]: Entering directory `/home/dom/ghc/libraries/editline'
> make[2]: *** No targets specified and no makefile found.  Stop.
> make[2]: Leaving directory `/home/dom/ghc/libraries/editline'
> make[1]: *** [make.library.editline] Error 2
> make[1]: Leaving directory `/home/dom/ghc/libraries'
> make: *** [stage1] Error 2


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Building ndp Problem

2008-06-07 Thread Dominic Steinitz
Manuel M T Chakravarty wrote:
> Dominic Steinitz:
>> I wanted to try out data parallel haskell. I followed the instructions
>> on http://haskell.org/haskellwiki/Data_Parallel_Haskell/PackageNDP but I
>> get the following error:
>>
>>> [EMAIL PROTECTED]:~/ghc/libraries> make make.library.ndp
>>> make: *** No rule to make target `build.library.ndp', needed by
>>> `make.library.ndp'.  Stop.
> 
> The ndp libraries are currently undergoing a fundamental restructure. 
> We'll update the instructions once matters settle down.  Sorry for the
> inconvenience.
> 
> Manuel
> 
> 
> 
Manuel,

I think I have things working now but the "make" system seems to have
problems. I followed the instructions here:

http://www.haskell.org/haskellwiki/Data_Parallel_Haskell/PackageNDP

but got the messages below.

On the other hand this worked:

ghc --make -o dotp dotp.hs -package ndp -i../lib -threaded

and then running

[EMAIL PROTECTED]:~/ghc/libraries/ndp/examples/dotp> ./dotp 10
--threads=1 --runs=10 +RTS -N1
N = 10: 125/124 126/126 129/132
[EMAIL PROTECTED]:~/ghc/libraries/ndp/examples/dotp> ./dotp 10
--threads=2 --runs=10 +RTS -N2
N = 10: 80/116 86/142 96/156

which seemed to indicate I was getting a performance improvement on my
dual core machine.

Would you like me to raise a ticket?

Dominic.

[EMAIL PROTECTED]:~/ghc/libraries/ndp/examples> make
Makefile:14: warning: overriding commands for target `bench'
mk/test.mk:28: warning: ignoring old commands for target `bench'
Makefile:17: warning: overriding commands for target `clean'
mk/test.mk:10: warning: ignoring old commands for target `clean'
make -C lib
make[1]: Entering directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/lib'
for i in concomp dotp primes smvm qsort barneshut primespj ; do \
  make -C $i;\
done
make[1]: Entering directory `/home/dom/ghc/libraries/ndp/examples/concomp'
cd ../lib && make
make[2]: Entering directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[1]: *** No rule to make target `Graph.hi', needed by `mkg.o'.  Stop.
make[1]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/concomp'
make[1]: Entering directory `/home/dom/ghc/libraries/ndp/examples/dotp'
cd ../lib && make
make[2]: Entering directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[1]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/dotp'
make[1]: Entering directory `/home/dom/ghc/libraries/ndp/examples/primes'
cd ../lib && make
make[2]: Entering directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[1]: *** No rule to make target `H98.hi', needed by `primes.o'.  Stop.
make[1]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/primes'
make[1]: Entering directory `/home/dom/ghc/libraries/ndp/examples/smvm'
cd ../lib && make
make[2]: Entering directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[1]: *** No rule to make target `SMVMPar.hi', needed by `smvm.o'.  Stop.
make[1]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/smvm'
make[1]: Entering directory `/home/dom/ghc/libraries/ndp/examples/qsort'
cd ../lib && make
make[2]: Entering directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[1]: *** No rule to make target `QSortPar.hi', needed by `QSort.o'.
 Stop.
make[1]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/qsort'
make: *** barneshut: No such file or directory.  Stop.
make[1]: Entering directory `/home/dom/ghc/libraries/ndp/examples/primespj'
cd ../lib && make
make[2]: Entering directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/lib'
make[1]: *** No rule to make target `PrimesVect.hi', needed by
`PrimesPJ.o'.  Stop.
make[1]: Leaving directory `/home/dom/ghc/libraries/ndp/examples/primespj'
make: *** [all] Error 2

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Building ndp Problem

2008-05-25 Thread Dominic Steinitz
I wanted to try out data parallel haskell. I followed the instructions
on http://haskell.org/haskellwiki/Data_Parallel_Haskell/PackageNDP but I
get the following error:

> [EMAIL PROTECTED]:~/ghc/libraries> make make.library.ndp
> make: *** No rule to make target `build.library.ndp', needed by 
> `make.library.ndp'.  Stop.

BTW when I built ghc, I had the following problem with happy (and alex).
It kept telling me I needed dvips but dvips is already installed. In the
end I used --nodeps.

> [EMAIL PROTECTED]:~/happy> rpmbuild -ta happy-1.17.tar.gz
> error: Failed build dependencies:
> dvips is needed by happy-1.17-1.i586

> [EMAIL PROTECTED]:~/happy> rpmlocate dvips

> /usr/bin/dvips

> [EMAIL PROTECTED]:~/happy> rpm --query -f /usr/bin/dvips
> texlive-2007-69

> [EMAIL PROTECTED]:~/happy> dvips --version
> dvips(k) 5.96
> kpathsea version 3.5.6
> Copyright (C) 2005 Radical Eye Software.
> There is NO warranty.  You may redistribute this software
> under the terms of the GNU General Public License
> and the Dvips copyright.
> For more information about these matters, see the files
> named COPYING and dvips.h.
> Primary author of Dvips: T. Rokicki; -k maintainer: T. Kacvinsky/ S. Rahtz.

> rpmbuild -ta --nodeps happy-1.17.tar.gz   





___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Building GHC

2008-05-16 Thread Dominic Steinitz
When I look at the instructions

http://hackage.haskell.org/trac/ghc/wiki/Building/GettingTheSources

they say the distribution is split in two but when I look at

http://darcs.haskell.org/

it seems to be split in three

ghc-HEAD-2007-12-16-..> 16-Dec-2007 14:25  102M
ghc-HEAD-2007-12-16-..> 16-Dec-2007 14:20   92M
ghc-HEAD-2007-12-16-..> 16-Dec-2007 14:12   57M

I'm assuming I unpack these on top of each other but I'd be grateful if
someone could confirm this.

Thanks, Dominic.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


ghc-split accepts building 6.0 on Windows

2003-05-30 Thread Dominic Cooney
My environment's TEMP and TMP are C:\temp, but for some reason, my recent
Cygwin install makes 'TEMP' and 'TMP' /cygdrive/c/temp/4; this duly gets
passed to ghc-inplace as C:\temp\4.

Then, in libraries\base, ghc-split complains that \4 mentions a non-existent
group in a regexp:

../../ghc/compiler/ghc-inplace -H16m -O -fglasgow-exts -cpp -Iinclude
-#include HsBase.h -Icbits/regex -funbox-strict-fields -package-name base -O
-Rghc-timing -split-objs-c GHC/Base.lhs -o GHC/Base.o  -ohi GHC/Base.hi
Reference to nonexistent group in regex; marked by <-- HERE in m/"c:\temp\4
<--HERE \ghc936.split\.c"/ at
d:\\users\\cooney\\ghc\\ghc-6.0\ghc\driver\split\ghc-split line 51, 
line 23.
make[2]: *** [GHC/Base.o] Error 255 

All I needed to do was editing ghc\driver\split\ghc-split so

$Tmp_prefix = $ARGV[1]

was instead

($Tmp_prefix = $ARGV[1]) =~ s/\\//g;

I don't know whether this habit of appending \4 is a delightful quirk of my
Cygwin install, but FWIW for other Windows Server 2k3/Cygwin users out
there...

Dominic Cooney


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: 5.04.2 RPM Dependencies

2003-03-11 Thread Dominic Steinitz
I tried the RPM for 7.2 and it seemed to work with --force and --nodeps (it
asked for libreadline.so.4 which was already there).

Dominic Steinitz
- Original Message -
From: "Simon Marlow" <[EMAIL PROTECTED]>
To: "Jon Fairbairn" <[EMAIL PROTECTED]>; "Dominic Steinitz"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, March 11, 2003 11:59 AM
Subject: RE: 5.04.2 RPM Dependencies


> On 2003-03-10 at 20:57GMT "Dominic Steinitz" wrote:
> > Can anyone help? I downloaded the latest rpm for ghc but
> got the following
> > errors on installation:
> >
> > error: failed dependencies:
> >  libc.so.6(GLIBC_2.3)   is needed by ghc-5.04.2-1
> >  libreadline.so.4   is needed by ghc-5.04.2-1
> >
> > I guess I need to update libc and libreadline. Can anyone
> point me at the
> > rpms to do this?
>
> If you go to http://fr2.rpmfind.net > and type
> libc.so.6 into the search box, it says there are 233 rpms
> that provide it.  You can constrain the search to the
> distribution you are using, which would narrow things down a
> bit.

Upgrading libc is not something I'd recommend.  Instead, get the right
RPM for your distribution: we have separate RPMs for RedHat 8.0 and 7.2
these days (using the wrong one leads to strange problems).  The 8.0 RPM
is rumoured to work with 7.3.

I'm afraid we don't do a great job of supporting non-RedHat Linux
systems at the moment, except for Debian which I believe does its own
packaging of GHC.  We do have a .tar.bz2 "binary distribution" which
*might* work for you, but it is also reliant on you having the right
libraries installed.

Cheers,
Simon

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


5.04.2 RPM Dependencies

2003-03-10 Thread Dominic Steinitz
Can anyone help? I downloaded the latest rpm for ghc but got the following
errors on installation:

error: failed dependencies:
 libc.so.6(GLIBC_2.3)   is needed by ghc-5.04.2-1
 libreadline.so.4   is needed by ghc-5.04.2-1

I guess I need to update libc and libreadline. Can anyone point me at the
rpms to do this?

By the way I didn't have this problem with 5.04.1.

Dominic Steinitz

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


ghc-inplace exiting with "error 1" foolishness

2002-09-23 Thread Dominic Cooney

Hi,

I complained late last week that GHC failed to build because ghc-inplace
couldn't do anything more complicated than print its version number.

I tried again on a clean machine, this time remembering to replace
Cygwin's sh.exe with bash.exe, and mounting C:\mingw as /mingw and
C:\mingw\include as /mingw/mingw32/include.

GHC apparently builds now (although the build hasn't finished... I've
only 256 MB RAM and serious thrashing goes on when the build is doing
this xargs ar thing!).

Thanks for your help and patience!

Dominic Cooney

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Newbie building GHC

2002-09-21 Thread Dominic Cooney

Hi,

I have been trying to build GHC, but the ghc.exe that gets built for 
ghc-inplace always exits with "Error 1". It *can* print its version 
number and the help, but building anything fails. The build fails 
making Adjustor.o from Adjustor.c.

I'm trying to build a cvs checkout fpconfig ghc hslibs on Win XP Pro, 
bootstrapping with the provided GHC 5.04.1 binary and Happy 1.13 binary.

I mentioned this to a colleague and he said he had exactly the same 
problem (ghc exits with error 1), on Windows and Linux, when building 
from source tarballs and CVS. We don't normally have any problems 
running the haskell.org GHC binaries.

Can any of you suggest what we might be doing wrong? We are in the 
southern hemisphere, so our electrons may be orbiting backwards.

Ultimately, we are keen to play around with Meta Haskell, as our 
journal club is reading Template Metaprogramming in Haskell soon.

Thanks,

Dominic Cooney

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Dynamic linker problems on Jaguar

2002-09-21 Thread Dominic Cooney

Hi,

I get the following with the package for Mac OS X 10.2:

[Dominic-Cooneys-Computer:~] dominic% ghc --make Main.lhs
dyld: /usr/local/lib/ghc-5.04/ghc-5.04 Undefined symbols:
/usr/local/lib/ghc-5.04/ghc-5.04 undefined reference to _BC expected to 
be defined in /usr/lib/libSystem.B.dylib
/usr/local/lib/ghc-5.04/ghc-5.04 undefined reference to _PC expected to 
be defined in /usr/lib/libSystem.B.dylib
/usr/local/lib/ghc-5.04/ghc-5.04 undefined reference to _UP expected to 
be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap

I get the impression from Google Groups that rebuilding from the source 
will fix this. Is there a Jaguar binary, source drop, or should I 
rebuild?

Thanks,

Dominic Cooney

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



GHCI Can't Find Module But GHC Can

2002-06-25 Thread Dominic Steinitz

When I run ghc, everything works fine.

ghc -o test1 test1.hs -i../lib -I../lib SVG-part1.o SVG-part2.o
../lib/*.o -package lang

But when I run ghci it tells me it can't find a module. Is there anything I
can do to stop
this?

Dominic.

ghci test1.hs -i../lib -I../lib SVG-part1.o SVG-part2.o ../lib/*.o -package
lang
   ___ ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 5.02.3, for Haskell 98.
/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package std ... linking ... done.
Loading package lang ... linking ... done.
Loading object (static) SVG-part1.o ... done.
Loading object (static) SVG-part2.o ... done.
Loading object (static) ../lib/Haskell2Xml.o ... done.
Loading object (static) ../lib/ParseSTLib.o ... done.
Loading object (static) ../lib/Pretty.o ... done.
Loading object (static) ../lib/Xml2Haskell.o ... done.
Loading object (static) ../lib/XmlCombinators.o ... done.
Loading object (static) ../lib/XmlHtmlGen.o ... done.
Loading object (static) ../lib/XmlHtmlParse.o ... done.
Loading object (static) ../lib/XmlLex.o ... done.
Loading object (static) ../lib/XmlLib.o ... done.
Loading object (static) ../lib/XmlPP.o ... done.
Loading object (static) ../lib/XmlParse.o ... done.
Loading object (static) ../lib/XmlTypes.o ... done.
final link ... done.
can't find module `IOMisc'
Prelude>
Dominic Steinitz

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Updating the net package

2002-06-11 Thread Dominic Steinitz

I need to update the net package so that I can pass setSocketOption IP_TTL.
This is a one line change. I'm using 5.02.2. There weren't any versions of
Socket.hsc tagged as 5.02.2 in the CVS repository but there was one tagged

Revision 1.2 / (download) - annotate - [select for diffs] , Fri Aug 17
12:51:08 2001 UTC (9 months, 3 weeks ago) by simonmar
Branch: MAIN
CVS Tags: ghc-5-02-branch, ghc-5-02-3, ghc-5-02-1, ghc-5-02
Changes since 1.1: +18 -12 lines
Diff to previous 1.1
Track updates to hslibs/net

I downloaded this and tried to compile but it has the following in it:

instance Show Socket where
  ...

and quite rightly the compiler complains. I'm going to take the latest
version (although it would be nice to know which one was included in
5.02.2).

1. Should I be using

Revision 1.11.2.2 / (download) - annotate - [select for diffs] , Wed Jun 5
16:36:59 2002 UTC (6 days, 3 hours ago) by simonpj
Branch: meta-haskell-branch
Changes since 1.11.2.1: +6 -4 lines
Diff to previous 1.11.2.1 to branchpoint 1.11 next main 1.12
Merge from HEAD up to meta-haskell-merge3

or should I be using

Revision 1.18 / (download) - annotate - [select for diffs] , Fri May 31
14:50:40 2002 UTC (11 days, 5 hours ago) by sof
Branch: MAIN
CVS Tags: HEAD
Changes since 1.17: +3 -3 lines
Diff to previous 1.17
cygwin: let's give UNIX domain sockets a go..

2. Is my naive approach of just recompiling the relevant module going to
work? I'd rather avoid having to build the whole of ghc if I can.

Many thanks, Dominic Steinitz

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: Raw Sockets

2002-03-06 Thread dominic . j . steinitz


Simon,

Thanks. On Linux I get

[dom@lhrtba8fd85 ping]$ test5
Protocol name: icmp
Protocol aliases: ["ICMP"]
Protocol number: 1

Fail: permission denied
Action: socket
Reason: privileged operation

as expected but on W98 I get

C:\Dom\haskell\ping>main
Protocol name: icmp
Protocol aliases: ["ICMP"]
Protocol number: 1398538241

Fail: failed
Action: socket
Reason: No error

I would have expected success. I haven't got access to C tools so I can't
see if I would get the same if I used the C sockets API.

Dominic.




"Simon Marlow" <[EMAIL PROTECTED]>@haskell.org on 04/03/2002 16:24:44

Sent by:  [EMAIL PROTECTED]


To:It looks like you want SOCK_RAW, not AF_RAW.  GHC does support this,
> with the 'Raw' socket type, something like this:
>
>   proto <- getProtocolByName "icmp"
>s <- socket AF_INT Raw proto

should be:

 s <- socket AF_INET Raw (protoNumber proto)

and of course you have to be root to send raw packets to the network.

Cheers,
 Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users







  
-

  Save time by using an eTicket and our Self-Service Check-in Kiosks.
  For more information go to http://www.britishairways.com/eservice1


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: Raw Sockets

2002-03-04 Thread dominic . j . steinitz


Simon,

Thanks for the reply.

I wanted to send ICMP packets. Linux does support AF_RAW. This compiles and
runs on my linux system.

 /*
   * Create the socket.
  */
 if ( (proto = getprotobyname("icmp")) == NULL)
  err_quit("unknown protocol: icmp");
  if ( (sockfd = socket(AF_INET, SOCK_RAW, proto->p_proto)) < 0)
err_sys("can't create raw socket");

Dominic.





"Simon Marlow" <[EMAIL PROTECTED]>@haskell.org on 04/03/2002 12:00:33

Sent by:  [EMAIL PROTECTED]


To:   "Dominic Steinitz"  How do I use raw sockets? According to the documentation I
> can use AF_RAW.
> It also refers the user to the implementation in
> fptools/hslibs/net/SocketPrim.lhs. Do I really need to do
> this and if so
> how do I get it?

The SocketPrim library (aka Network.Socket) really only supports AF_INET
and AF_UNIX.  Many of the other AF_ things are quite system-dependent;
eg. Linux doesn't have AF_RAW.

The documentation is a bit slack, although it does mention at the top of
the Family(..) definition that "your mileage may vary depending on the
OS you use".

Do you really want a raw socket, or will a datagram (UDP) socket do?  If
so, you can just pass Datagram as the SocketType argument to
SocketPrim.socket.

Cheers,
 Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users







  
-

  Save time by using an eTicket and our Self-Service Check-in Kiosks.
  For more information go to http://www.britishairways.com/eservice1


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Raw Sockets

2002-03-03 Thread Dominic Steinitz

How do I use raw sockets? According to the documentation I can use AF_RAW.
It also refers the user to the implementation in
fptools/hslibs/net/SocketPrim.lhs. Do I really need to do this and if so
how do I get it?

This compiles and runs as expected:

module Main(main) where

import SocketPrim (Family(AF_INET))

main = putStrLn (show AF_INET)

but this

module Main(main) where

import SocketPrim (Family(AF_RAW))

main = putStrLn (show AF_RAW)

gives the following

C:\Dom\haskell\ping>"c:\program files\glasgow haskell
compiler\ghc-5.02\bin\ghc"
 -o main test.hs -package net

test.hs:3: Module `SocketPrim' does not export `Family(AF_RAW)'

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Dumb Windows Question

2001-10-15 Thread Steinitz, Dominic J

How do I actually use ghc in Windows (98)? When I installed Hugs, my .hs files got 
associated with Hugs and if I left-click on a .hs file I have various options to run 
with.

So do I open a DOS box and invoke ghc or ghci? If so how, what do I have to change to 
get the path to point to ghc? I tried autoexec.bat but this seemed to have no effect.

Also, how do I tell ghci where to find packages?

C:\Program Files\Glasgow Haskell Compiler\ghc-5.02\bin>ghci -package lang
C:\PROGRA~1\GLASGO~1\GHC-5.02\BIN\GHC.EXE: no input files
Usage: For basic information, try the `--help' option.

I did look through the documentation. If I missed the relevant sections, perhaps 
someone could point me at them.

Many thanks, Dominic.

-
To receive our special fares directly by email, register at 
http://www.britishairways.com/registration

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Good Error Message

2001-10-15 Thread Steinitz, Dominic J

Can I just say thank you for the good error message. I'm sure I have used compilers 
(not Haskell) which would tell you that you have a problem but leave you to find where 
the two defintions are.

Dominic.

Encode.hs:8:
Ambiguous occurrence `Octet'
It could refer to either `Encode.Octet', defined at Encode.hs:7
  or `ASNBaseTypes.Octet', imported from ASNBaseTypes at E
ncode.hs:5
 (at ./ASNBaseTypes.hi:34)
make: *** [Encode.o] Error 1

-
To receive our special fares directly by email, register at 
http://www.britishairways.com/registration

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



catchAllIO

2001-10-12 Thread Steinitz, Dominic J

Can anyone help? catchAllIO seems to live in Exception but I can't find it in the 
documentation "4.12. Exception".

Dominic.

-
To receive our special fares directly by email, register at 
http://www.britishairways.com/registration

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: Dependency Generation

2001-08-07 Thread Steinitz, Dominic J

I didn't realise I also had to put this on the line that works out the dependencies. 
In hindsight it's obvious. Perhaps the documentation could be updated with a note? I'd 
be happy to supply some text. Dominic.




[EMAIL PROTECTED] on 07/08/2001 10:07:00
To: Dominic Steinitz
glasgow-haskell-users
cc: 
bcc:
Subject:RE: Dependency Generation

> I'm getting the following error using the instructions in
> 4.9.5.1 Dependency
> Generation.
>
> [dominic@r341-02 webldap]$ make depend
> ghc -M -cpp Add.hs EnvPassed.hs ParseError.hs Search.hs
> ASNv1.hs Counter.hs GetO
> pt.hs ParseExpr.hs StdTokenDef.hs Basev1.hs DecodeAll.hs
> Hello.hs ParseLib.hs Ta
> gsv1.hs CGI.hs Decode.hs HTML.hs Parser.hs TokenDef.hs
> CGISystem.hs Delete.hs HT
> MLWizard.hs ParseToken.hs UrlEncoded.hs Classv1.hs DoAdd.hs
> ldapHTML.hs Pretty.h
> s WebSite.hs CL.hs DoDelete.hs LdapTypesv2.hs QL.hs
> X690Utilsv2.hs Client2.hs Do
> Modify.hs Mime.hs query.hs client.hs DoSearch.hs Modify.hs
> Request.hs Client.hs
> Env.hs oldDecodeAll.hs Response.hs
> Basev1.hs: can't find one of the following: `Word.hi'
> `Word.hs' `Word.lhs'
> make: *** [depend] Error 1
> [dominic@r341-02 webldap]$

Just add the same -package options when you use ghc -M as you would when
compiling any of the modules.  i.e. in this case adding -package lang
will help GHC find the Word module (but it won't be included in the
dependency output).

Cheers,
Simon




-
21st century air travel http://www.britishairways.com

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Dependency Generation

2001-08-07 Thread Steinitz, Dominic J

I'm getting the following error using the instructions in 4.9.5.1 Dependency
Generation.

[dominic@r341-02 webldap]$ make depend
ghc -M -cpp Add.hs EnvPassed.hs ParseError.hs Search.hs ASNv1.hs Counter.hs GetO
pt.hs ParseExpr.hs StdTokenDef.hs Basev1.hs DecodeAll.hs Hello.hs ParseLib.hs Ta
gsv1.hs CGI.hs Decode.hs HTML.hs Parser.hs TokenDef.hs CGISystem.hs Delete.hs HT
MLWizard.hs ParseToken.hs UrlEncoded.hs Classv1.hs DoAdd.hs ldapHTML.hs Pretty.h
s WebSite.hs CL.hs DoDelete.hs LdapTypesv2.hs QL.hs X690Utilsv2.hs Client2.hs Do
Modify.hs Mime.hs query.hs client.hs DoSearch.hs Modify.hs Request.hs Client.hs
Env.hs oldDecodeAll.hs Response.hs
Basev1.hs: can't find one of the following: `Word.hi' `Word.hs' `Word.lhs'
make: *** [depend] Error 1
[dominic@r341-02 webldap]$ 

Here's the relevant bit of the makefile.

depend:
ghc -M $(HC_OPTS) $(SRCS)

SRCS = Add.hs EnvPassed.hs ParseError.hs Search.hs\
   ASNv1.hs Counter.hs GetOpt.hs ParseExpr.hs StdTokenDef.hs\
   Basev1.hs DecodeAll.hs Hello.hs ParseLib.hs Tagsv1.hs\
   CGI.hs Decode.hs HTML.hs Parser.hs TokenDef.hs\
   CGISystem.hs Delete.hs HTMLWizard.hs ParseToken.hs UrlEncoded.hs\
   Classv1.hs DoAdd.hs ldapHTML.hs Pretty.hs WebSite.hs\
   CL.hs DoDelete.hs LdapTypesv2.hs QL.hs X690Utilsv2.hs\
   Client2.hs DoModify.hs Mime.hs query.hs\
   client.hs DoSearch.hs Modify.hs Request.hs\
   Client.hs Env.hs oldDecodeAll.hs Response.hs

HC_OPTS= -cpp  

and here are the imports in Basev1.hs

import Int
import Char
import Bits
import Word
import Tagsv1

It's not clear from the documentation what I should add to stop ghc -M trying to find
Word. I tried -exclude-module=Word.hs but got the following

[dominic@r341-02 webldap]$ make depend
ghc -M -cpp -exclude-module=Word.hs Add.hs EnvPassed.hs ParseError.hs Search.hs
ASNv1.hs Counter.hs GetOpt.hs ParseExpr.hs StdTokenDef.hs Basev1.hs DecodeAll.hs
 Hello.hs ParseLib.hs Tagsv1.hs CGI.hs Decode.hs HTML.hs Parser.hs TokenDef.hs C
GISystem.hs Delete.hs HTMLWizard.hs ParseToken.hs UrlEncoded.hs Classv1.hs DoAdd
.hs ldapHTML.hs Pretty.hs WebSite.hs CL.hs DoDelete.hs LdapTypesv2.hs QL.hs X690
Utilsv2.hs Client2.hs DoModify.hs Mime.hs query.hs client.hs DoSearch.hs Modify.
hs Request.hs Client.hs Env.hs oldDecodeAll.hs Response.hs
ghc-5.00.2: unrecognised flag: -exclude-module=Word.hs
Usage: For basic information, try the `--help' option.
make: *** [depend] Error 1
[dominic@r341-02 webldap]$

-
21st century air travel http://www.britishairways.com

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: Socket Behaviour

2001-06-04 Thread Steinitz, Dominic J

Simon, Thanks very much for this. Dominic.

-
21st century air travel http://www.britishairways.com

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Socket Behaviour

2001-05-31 Thread Steinitz, Dominic J

Can anyone tell me why the following code doesn't work as expected? Both the server 
and client hang. If I run

server 2 &
and 
client  2

the server logfile produces

[dom@lhrtba8fd85 twotest]$ more log.txt
Thu May 31 14:35:39 BST 2001
Starting logging
Thu May 31 14:36:08 BST 2001
Hello world48 65 6c 6c 6f 20 77 6f 72 6c 64

so it looks like the hPutStrLn to the socket never completes. On the client side, 
"Hello world" gets sent but the hGetLine never completes.

Client

   do sh <- connectTo host port
  hPutStr sh "Hello world"
  hFlush sh
  x <- hGetLine sh
  putStrLn x

Server

  socket <- listenOn port 
  (sh,host,portid) <- accept socket
  let loop = do b <- getBuffer sh 16
case b of
   Full msg ->
  do logMessage ofh (hexedMessage msg)
 loop
   Partial msg ->
  do logMessage ofh (hexedMessage msg)
 hPutStrLn sh "Finishing Logging"
 hFlush sh
 logMessage ofh "Finishing logging"
 hClose ofh
 in loop 


Dominic.

Here's the full code:

module Main (main) where

import System
import IO
import Time
import Socket
import Char

main :: IO ()
main = do prog <- getProgName
  args <- getArgs
  if (length args /= 1) 
 then do putStrLn ("Use: " ++ prog ++ " ")
 exitWith (ExitFailure (-1))
 else return ()
  let port = read (args !! 0) :: Int in
 server (PortNumber (mkPortNumber port))

-- The server function creates a socket to listen on the port and
-- loops to log messages. 

server :: PortID -> IO ()
server port = 
   do ofh <- openFile "log.txt" WriteMode
  logMessage ofh "Starting logging"
  socket <- listenOn port 
  (sh,host,portid) <- accept socket
  let loop = do b <- getBuffer sh 16
case b of
   Full msg ->
  do logMessage ofh (hexedMessage msg)
 loop
   Partial msg ->
  do logMessage ofh (hexedMessage msg)
 hPutStrLn sh "Finishing Logging"
 hFlush sh
 logMessage ofh "Finishing logging"
 hClose ofh
 in loop 

data Buffer = Full String | Partial String

getBuffer :: Handle -> Int -> IO Buffer
getBuffer h n =
   if (n <= 0)
  then return (Full "")
  else do x <- try (hGetChar h)
  case x of
 Right c -> 
do xs <- getBuffer h (n-1)
   case xs of
  Full cs -> return (Full (c:cs))
  Partial cs -> return (Partial (c:cs))
 Left e -> if isEOFError e 
  then return (Partial "")
  else ioError e
   
logMessage :: Handle -> String -> IO ()
logMessage hd msg =
   do clock <- getClockTime
  calendar <- toCalendarTime clock
  hPutStrLn hd ((calendarTimeToString calendar) ++ "\n" ++ msg)
  hFlush hd

showHex :: Char -> String
showHex x = 
   let y = ord x in
  hexDigit (y `div` 16):hexDigit (y `mod` 16):[]

hexDigit :: Int -> Char
hexDigit x 
   | (0 <= x) && (x <= 9)  = chr(ord '0' + x)
   | (10 <= x) && (x <=16) = chr(ord 'a' + (x-10))
   | otherwise = error "Outside hexadecimal range"

hexedMessage :: String -> String
hexedMessage msg =
   (map toPrint msg) ++ "" ++ unwords (map showHex msg)

toPrint :: Char -> Char
toPrint x = 
   if ((isAscii x) && (not (isControl x)))
  then x
  else '.'  


module Main(main) where

import System
import IO
import Socket

main :: IO ()
main = do prog <- getProgName
  args <- getArgs
  if (length args /= 2)
  then do putStrLn ("Use: " ++ prog ++ "  ")
  exitWith (ExitFailure (-1))
  else return ()
  let host = args !! 0
  port = read (args !! 1) :: Int in
  client host (PortNumber (mkPortNumber port))

client :: Hostname -> PortID -> IO ()
client host port = 
   do sh <- connectTo host port
  hPutStr sh "Hello world"
  hFlush sh
  x <- hGetLine sh
  putStrLn x

-
21st century air travel http://www.britishairways.com

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: ghc-5.00.1 is available

2001-05-24 Thread Steinitz, Dominic J

Of course I meant

hPutStr handle (map (chr .word8ToInt) protocolElement)





Dominic J Steinitz@baexternal
24/05/2001 18:47
To: v-julsew
cc: glasgow-haskell-users
haskell
bcc:Dominic Steinitz
Subject:Re: ghc-5.00.1 is available

Will this

   - Initial Unicode support - the Char type is now 31 bit

cause me a problem?

I am sending protocol elements via a socket. I represent these as [Word8]. I had
 assumed that when I want to send something I do

hPutStr (map (ord .word8ToInt) protocolElement)

essentially doing a type coercion. But this looks like bits actually get changed
 into something the respondent won't recognise.

Dominic.


-
21st century air travel http://www.britishairways.com

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell




-
21st century air travel http://www.britishairways.com

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: ghc-5.00.1 is available

2001-05-24 Thread Steinitz, Dominic J

Will this

   - Initial Unicode support - the Char type is now 31 bit

cause me a problem?

I am sending protocol elements via a socket. I represent these as [Word8]. I had 
assumed that when I want to send something I do

hPutStr (map (ord .word8ToInt) protocolElement)

essentially doing a type coercion. But this looks like bits actually get changed into 
something the respondent won't recognise.

Dominic.

-
21st century air travel http://www.britishairways.com

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Sockets on Windows

2001-02-23 Thread Steinitz, Dominic J

I am was trying out sockets. These worked fine under linux. Under windows I get the 
following error. Does anyone know what it means and how I can fix it? I can telnet 
from within the cygwin window so I assume tcp/ip is running.

Thanks, Dominic.

administrator@DEFAULT /cygdrive/d/dom/home/socketTest
$ ./server1 8000

Fail: does not exist
Action: getProtocolByName
Reason: no such protocol entry




-
21st century air travel http://www.britishairways.com

 ATTKHVFA


Too Strict?

2001-01-15 Thread Steinitz, Dominic J

Can someone help? The program below works fine with small files but when I try to use 
it on the one I need to (about 3 million lines of data) it produces no output. The 
hard disk is hammered - I assume this is the run time system paging. My suspicion is 
that the program is trying to read in the whole file before processing it. Is this 
correct? If so, how do I make the program lazy so that it processes a line at time?

By the way, the MD5 function which I use and is included as part of HSLIBS has the 
type String -> IO String. The MD5 algorithm really is a function and should have type 
String -> String. Do people agree and if so how do I get it changed?

Dominic.

-- Compile with ghc -o test test.hs -static -package util
-- under Windows.

module Main(main) where

import IO(openFile,
  hPutStr,
  IOMode(ReadMode,WriteMode,AppendMode))
import MD5
import Char

-- showHex and showHex' convert the hashed values to 
-- human-readable hexadecimal strings.

showHex :: Integer -> String

showHex =
map hexDigit .
map (fromInteger . (\x -> mod x 16)) .
takeWhile (/=0) .
iterate (\x -> div x 16) .
toInteger

hexDigit x
   | (0 <= x) && (x <= 9)  = chr(ord '0' + x)
   | (10 <= x) && (x <=16) = chr(ord 'a' + (x-10))
   | otherwise = error "Outside hexadecimal range"

powersOf256 = 1 : map (*256) powersOf256

showHex' x = 
   showHex $ 
   sum (zipWith (*) 
(map ((\x -> (mod x 16)*16 + (div x 16)) . 
 toInteger . 
 ord) x) 
powersOf256)

-- The type Anon and function anonymize hide the anonymisation
-- process. In this case, it's a hash function
-- digest :: String -> IO String which implements MD5. 

type Anon a = IO a

class Anonymizable a where
   anonymize :: a -> Anon a

-- MyString avoids overlapping instances of Strings 
-- with the [Char]

data MyString = MyString String
   deriving Show

instance Anonymizable MyString where
   anonymize (MyString x)
  = do s <- digest x
   return ((MyString . showHex') s)

instance Anonymizable a => Anonymizable [a] where
   anonymize xs = mapM anonymize xs

filename = "ldif1.txt"
fileout  = "ldif.out"

readAndWriteAttrVals =
   do h <- openFile fileout WriteMode
  s <- readFile filename
  a <- anonymize((map MyString) (lines s))
  hPutStr h (unlines (map (\(MyString x) -> x) a)) 

main = readAndWriteAttrVals

-
21st century air travel http://www.britishairways.com

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: GHC Command Line Help

2000-12-21 Thread Steinitz, Dominic J

Sorry. It's obviously -fglasgow-exts. I didn't realise it did things at the linking 
stage as well as the compilation stage.



    Dominic Steinitz
21/12/2000 16:30:15

To: glasgow-haskell-users
cc: Chris.Reade
djrussell
B.Avery
dominic
molyneux
bcc: 
Subject: GHC Command Line Help

I was experimenting with using FiniteMap. The program compiled ok but the linker gave 
me the following error. What do I need to include on the command line or have I not 
installed ghc correctly?

[dom@lhrtba8fd85 FiniteMap]$ /usr/bin/ghc -o main test.o -L/usr/lib/ghc-4.08.1 -
lHSlang -lHSdata
/usr/lib/ghc-4.08.1/libHSdata.a(FiniteMap__1.o): In function `__init_FiniteMap':
FiniteMap__1.o(.text+0x16): undefined reference to `__init_GlaExts'
collect2: ld returned 1 exit status

-
21st century air travel http://www.britishairways.com




-
21st century air travel http://www.britishairways.com

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



GHC Command Line Help

2000-12-21 Thread Steinitz, Dominic J

I was experimenting with using FiniteMap. The program compiled ok but the linker gave 
me the following error. What do I need to include on the command line or have I not 
installed ghc correctly?

[dom@lhrtba8fd85 FiniteMap]$ /usr/bin/ghc -o main test.o -L/usr/lib/ghc-4.08.1 -
lHSlang -lHSdata
/usr/lib/ghc-4.08.1/libHSdata.a(FiniteMap__1.o): In function `__init_FiniteMap':
FiniteMap__1.o(.text+0x16): undefined reference to `__init_GlaExts'
collect2: ld returned 1 exit status

-
21st century air travel http://www.britishairways.com

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: HaskellDirect Problems - Long

1999-12-30 Thread Steinitz, Dominic J

I've modified c:\haskelldirect\0.16\hugs-lib\AddrBits.hs by commenting out the export 
of addrToInt. The example in examples\math then worked. However, I'm not clear this is 
the right defintion to comment out.

Dominic.

{-# OPTIONS -#include "AddrBitsPrim.h" #-}
-- Automatically generated by HaskellDirect (ihc), snapshot 080899
-- Created: 20:12 , Thursday 04 November, 1999
-- Command line: -fno-qualified-names --hugs -fno-imports -fint-is-int -c AddrBits.idl 
-o AddrBits.hs

module AddrBits
   ( writeInt8OffAddr
   , writeInt16OffAddr
   , writeInt32OffAddr
   , writeStablePtrOffAddr
   , writeCharOffAddr
   , writeWord8OffAddr
   , writeWord16OffAddr
   , writeWord32OffAddr
   , writeDoubleOffAddr
   , writeFloatOffAddr
   , writeAddrOffAddr
   , readInt8OffAddr
   , readInt16OffAddr
   , readStablePtrOffAddr
   , readInt32OffAddr
   , readCharOffAddr
   , readWord8OffAddr
   , readWord16OffAddr
   , readWord32OffAddr
   , readFloatOffAddr
   , readDoubleOffAddr
   , readAddrOffAddr
   , writeForeignObjOffAddr
   , foreignObjToAddr
   , writeI64
   , readI64
   , primMalloc
   , primFree
   , intToAddr
--, addrToInt
   ) where



HaskellDirectProblems - Long

1999-12-30 Thread Steinitz, Dominic J

Help, I'm running Windows 95. [Version 4.00.].

Hugs works fine and GHC (on Win32) seems to have installed ok although  I did have to 
edit cygnus.bat to put

/GHC/GHC-4.05/BIN

in the path (is there a better way of doing this?). At least the Hello, world! program 
worked.

Then I tried to use HaskellDirect.

First of all I tried to make in examples\math planning to use Hugs.

BASH.EXE-2.02$ make
../../ihc -fhs-to-c --hugs-c math.idl -o math.hs
gcc -mno-cygwin -mno-cygwin -c math.c -o math.dll_o
math.c:7: HDirect.h: No such file or directory
make: *** [math.dll_o] Error 1

I fixed this by copying c:\HaskellDirect\0.16\lib-src\HDirect.h to examples\math but 
presumably there is some better way of resolving this problem.

I then invoked Hugs on Main.hs 

C:\HaskellDirect\0.16\examples\math>c:\hugs98\hugs.exe
__   __ __  __     ___  _
||   || ||  || ||  || ||__  Hugs 98: Based on the Haskell 98 standard
||___|| ||__|| ||__||  __|| Copyright (c) 1994-1999
||---|| ___||   World Wide Web: http://haskell.org/hugs
||   || Report bugs to: [EMAIL PROTECTED]
||   || Version: November 1999  _

Haskell 98 mode: Restart with command line option -98 to enable extensions

Reading file "C:\HUGS98\lib\Prelude.hs":

Hugs session for:
C:\HUGS98\lib\Prelude.hs
Type :? for help
Prelude>

Current settings: +fewui -stgl.qk -h25 -p"%s> " -r$$ -c40
Search path : -P{Hugs}\lib;{Hugs}\lib\hugs;{Hugs}\lib\exts;{Hugs}\lib\win32
Editor setting  : -E
Preprocessor: -F
Compatibility   : Haskell 98 (+98)
Prelude>

Prelude> :l main
Reading file "main.hs":
Reading file "Math.hs":
Reading file "C:\HUGS98\lib\exts\Addr.hs":
Reading file "HDirect":
ERROR "HDirect": Unable to open file "HDirect"
Addr>

I found two copies of HDirect, one in c:\hugs98\lib\com and one in 
c:\haskelldirect\0.16\hugs-lib. I then tried with the following settings.

Current settings: +fewui -stgl.qk -h25 -p"%s> " -r$$ -c40
Search path : -P{Hugs}\lib;{Hugs}\lib\hugs;{Hugs}\lib\exts;{Hugs}\lib\win32;
{Hugs}\lib\com
Editor setting  : -E
Preprocessor: -F
Compatibility   : Haskell 98 (+98)

I got the following output (minus the bit that scrolled off the top of the screen).

Reading file "C:\HUGS98\lib\exts\Bits.hs":
Reading file "C:\HUGS98\lib\exts\Int.hs":
Reading file "C:\HUGS98\lib\exts\Word.hs":
Reading file "C:\HUGS98\lib\Monad.hs":
Reading file "C:\HUGS98\lib\com\Pointer.lhs":
Reading file "C:\HUGS98\lib\exts\IOExts.hs":
Reading file "C:\HUGS98\lib\hugs\Trace.hs":
Reading file "C:\HUGS98\lib\IO.hs":
Reading file "C:\HUGS98\lib\Ix.hs":
Reading file "C:\HUGS98\lib\IO.hs":
Reading file "C:\HUGS98\lib\Array.hs":
Reading file "C:\HUGS98\lib\List.hs":
Reading file "C:\HUGS98\lib\Maybe.hs":
Reading file "C:\HUGS98\lib\List.hs":
Reading file "C:\HUGS98\lib\Array.hs":
Reading file "C:\HUGS98\lib\exts\IOExts.hs":
Reading file "C:\HUGS98\lib\exts\Foreign.hs":
Reading file "C:\HUGS98\lib\com\PointerPrim.hs":
Reading file "C:\HUGS98\lib\exts\Weak.hs":
Reading file "C:\HUGS98\lib\com\Pointer.lhs":
Reading file "C:\HUGS98\lib\com\AddrBits.hs":
Reading file "C:\HUGS98\lib\com\HDirect.lhs":
ERROR "C:\HUGS98\lib\com\HDirect.lhs": Entity "addrToInt" imported from module "
Addr" already defined in module "AddrBits"

HDirect does indeed import Addr. AddrBits defines addrToInt as

addrToInt :: Addr
  -> Int
addrToInt p = unsafePerformIO (prim_AddrBits_addrToInt p)

On the other hand, Addr defines addrToInt as 

primitive addrToInt :: Addr -> Int

I tried again with the following settings.

Current settings: +fewui -stgl.qk -h25 -p"%s> " -r$$ -c40
Search path : -P{Hugs}\lib;{Hugs}\lib\hugs;{Hugs}\lib\exts;{Hugs}\lib\win32;
c:\haskelldirect\0.16\hugs-lib
Editor setting  : -E
Preprocessor: -F
Compatibility   : Haskell 98 (+98)

Again I got (minus the bit that scrolled off the top of the screen).

Reading file "C:\HUGS98\lib\exts\Bits.hs":
Reading file "C:\HUGS98\lib\exts\Int.hs":
Reading file "C:\HUGS98\lib\exts\Word.hs":
Reading file "C:\HUGS98\lib\Monad.hs":
Reading file "c:\haskelldirect\0.16\hugs-lib\Pointer.lhs":
Reading file "C:\HUGS98\lib\exts\IOExts.hs":
Reading file "C:\HUGS98\lib\hugs\Trace.hs":
Reading file "C:\HUGS98\lib\IO.hs":
Reading file "C:\HUGS98\lib\Ix.hs":
Reading file "C:\HUGS98\lib\IO.hs":
Reading file "C:\HUGS98\lib\Array.hs":
Reading file "C:\HUGS98\lib\List.hs":
Reading file "C:\HUGS98\lib\Maybe.hs":
Reading file "C:\HUGS98\lib\List.hs":
Reading file "C:\HUGS98\lib\Array.hs":
Reading file "C:\HUGS98\lib\exts\IOExts.hs":
Reading file "C:\HUGS98\lib\exts\Foreign.hs":
Reading file "c:\haskelldirect\0.16\hugs-lib\PointerPrim.hs":
Reading file "C:\HUGS98\lib\exts\Weak.hs":
Reading file "c:\haskelldirect\0.16\hugs-lib\Pointer.lhs":
Reading file "c:\haskelldirect\0.16\hugs-lib\AddrBits.hs":
Reading file "c:\haskelldirect\0.16\hugs-lib\HDirect.lhs":
ERROR "c:\haskelldirect\0.16\hugs-l