Re: RegexString: was it really meant to be that way ?

2000-01-18 Thread Marcin 'Qrczak' Kowalczyk

Tue, 11 Jan 2000 07:36:22 -0800, Simon Marlow <[EMAIL PROTECTED]> pisze:

> I'm tempted to junk the whole Regex library and replace it with
> one based on pcre, actually.

 looks interesting, is
written in Haskell, but is quite big and seems to be not maintained
anymore... I've given up trying to compile it with current GHC version.

-- 
 __("$ P+++ L++>$ E-
  ^^  W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK  5? X- R tv-- b+>++ DI D- G+ e> h! r--%>++ y-




ghc -parallel ...

2000-01-18 Thread Dirk Nowotka TUCS

Hi,

I've been trying to compile a toy example with GHC's parallel option.

The `impossible' happened ...

How do I get the parallel machinery working?

Best,
Dirk


Here is the verbose compiler report:
(the program code follows after that)

droog:~/Hacks/haskell/Equations/src/test> ghc -parallel 
-i/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/imports/concurrent:/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/imports/std
 -v parFact.hs
The Glorious Glasgow Haskell Compilation System, version 4.04, patchlevel 1

Effective command line: -parallel 
-i/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/imports/concurrent:/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/imports/std
 -v
ghc: unrecognised option: -fstack-check

Ineffective C pre-processor:
echo '{-# LINE 1 "parFact.hs" -}' > /tmp/ghc21755.cpp && cat parFact.hs >> 
/tmp/ghc21755.cpp

real0.0
user0.0
sys 0.0
ghc:compile:Output file parFact.o doesn't exist
ghc:compile:Interface file parFact.hi doesn't exist
ghc:recompile:Input file parFact.hs newer than parFact.o

Haskell compiler:
/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/hsc /tmp/ghc21755.cpp  
-fparallel -fignore-interface-pragmas -fomit-interface-pragmas -fsimplify [ 
-finline-phase2 -fmax-simplifier-iterations4 ]   -fwarn-overlapping-patterns 
-fwarn-missing-methods -fwarn-duplicate-exports -fhi-version=404 -static 
-himap=/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/imports/concurrent%.hi:/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/imports/std%.hi:.%.hi:/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/imports/concurrent%.mp_hi:/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/imports/concurrent%.mp_hi:/softa/zeus/prg/fptools/lib/sparc-sun-solaris2/ghc-4.04/imports/std%.mp_hi
-v -hifile=/tmp/ghc21755.hi -C=/tmp/ghc21755.hc -F=/tmp/ghc21755_stb.c 
-FH=/tmp/ghc21755_stb.h +RTS -H600 -K100
Glasgow Haskell Compiler, version 4.04, for Haskell 98, compiled by GHC version 4.04

panic! (the `impossible' happened):
closureCodeBody:arg_regs

Please report it as a compiler bug to [EMAIL PROTECTED]



real2.5
user2.3
sys 0.1
deleting... /tmp/ghc21755.cpp /tmp/ghc21755.hi /tmp/ghc21755.hc /tmp/ghc21755_stb.c 
/tmp/ghc21755_stb.h

rm -f /tmp/ghc21755*




parFact.hs:

module Main(main) where

import IO
import Parallel

pfc :: Int -> Int -> Int -> Int
pfc x y c
  | y - x > c = f1 `par` (f2 `seq` (f1+f2))
  | x == y= x
  | otherwise = pf x m + pf (m+1) y
  where
m  = (x+y) `div` 2
f1 = pfc x m c
f2 = pfc (m+1) y c

pf :: Int -> Int -> Int
pf x y
  | x < y = pf x m + pf (m+1) y
  | otherwise = x
  where
m = (x+y) `div` 2

parfact x c = pfc 1 x c

mk_num  :: String -> Int
mk_num s = (fst . head) (reads s :: [(Int,String)])

main = do putStr "argument 1: "
  arg1 <- getLine
  putStr "argument 2: "
  arg2 <- getLine
  putStrLn (show (parfact (mk_num arg1) (mk_num arg2)))




RE: compilation fails when -O flag specified

2000-01-18 Thread Simon Peyton-Jones

Thanks for reporting this bug.   It is indeed a bug in GHC 4.04,
but the current working version of the compiler compiles and
runs it fine.

So for now, just compile without -O.  We plan to release 4.06 in the
next fortnight.

I hope the process of elimination didn't take too long.

Simon

| -Original Message-
| From: Louis Madon [mailto:[EMAIL PROTECTED]]
| Sent: 18 January 2000 17:12
| To: [EMAIL PROTECTED]
| Subject: compilation fails when -O flag specified 
| 
| 
| Hi,
| 
| I've been having problems getting GHC to compile some code I'm working
| on with optimisation (-O) turned on.  Compilation is fine without -O
| specified.  Through a process of elimination I've managed to reproduce
| the problem
| in the following (much simpler) piece of code: 
| 
| 
| 
| 
| 
| module Main where
| 
| import List
| 
| test es = 
|   concat (groupBy eq (zip [0..(length es) - 1] es))
|   where
|   eq a b = (fst a) == (fst b)
| 
| main = putStr (show (test [1,2,3,4]))
| 
| 
| 
| 
| 
| 
| When compiled with -O the compiler produces the following output:
| 
| 
| 
| > panic! (the `impossible' happened):
| > funResultTy t{-r1Gm-}
| >
| > Please report it as a compiler bug to 
| [EMAIL PROTECTED]
| 
| 
| Additional information:
| 
| uname -a gives:
| FreeBSD Gatekeeper.quillan.com 3.2-RELEASE FreeBSD 3.2-RELEASE #0: Sun
| Jul 18 09:22:18 EST 1999
| [EMAIL PROTECTED]:/usr/src/sys/compile/GATEKEEPER  i386
| 
| gcc version is 2.7.2.1
| 
| 
| Here is a recorded shell session:
| 
| 
| ---
| 
| Script started on Tue Jan 18 11:01:18 2000
| sh-2.03$ ls -l
| total 2
| -rw-r--r--  1 madonl  wheel  172 Jan 18 10:40 Main.hs
| -rw-r--r--  1 madonl  wheel   43 Jan 18 11:01 typescript
| sh-2.03$ cat Main.hs
| module Main where
| 
| import List
| 
| test es = 
|   concat (groupBy eq (zip [0..(length es) - 1] es))
|   where
|   eq a b = (fst a) == (fst b)
| 
| main = putStr (show (test [1,2,3,4]))
| sh-2.03$ ghc -v -O Main.hs
| The Glorious Glasgow Haskell Compilation System, version 4.04,
| patchlevel 1
| 
| Effective command line: -v -O
| 
| Ineffective C pre-processor:
|   echo '{-# LINE 1 "Main.hs" -}' > /tmp/ghc962.cpp && cat 
| Main.hs >>
| /tmp/ghc962.cpp
| 0.00 real 0.00 user 0.00 sys
| ghc:compile:Output file Main.o doesn't exist
| ghc:compile:Interface file Main.hi doesn't exist
| ghc:recompile:Input file Main.hs newer than Main.o
| 
| Haskell compiler:
|   /usr/local/lib/ghc/hsc /tmp/ghc962.cpp  -ffoldr-build-on
| -fdo-eta-reduction -fdo-lambda-eta-expansion -fcase-of-case 
| -fcase-merge
| -flet-to-case -fpedantic-bottoms -fsimplify [ -finline-phase0
| -fmax-simplifier-iterations2 ] -fspecialise -ffull-laziness
| -ffloat-inwards -fsimplify [ -finline-phase1
| -fmax-simplifier-iterations4 ]  -fsimplify [ -finline-phase2
| -fmax-simplifier-iterations4 ] -fstrictness -fcpr-analyse
| -fworker-wrapper -fsimplify [ -fmax-simplifier-iterations4 ] -fcse
| -ffull-laziness -ffloat-inwards -fsimplify [
| -fmax-simplifier-iterations4 ]   -flet-no-escape
| -fwarn-overlapping-patterns -fwarn-missing-methods
| -fwarn-duplicate-exports -fhi-version=404 -static
| -himap=.%.hi:/usr/local/lib/ghc/imports/std%.hi-v
| -hifile=/tmp/ghc962.hi -C=/tmp/ghc962.hc -F=/tmp/ghc962_stb.c
| -FH=/tmp/ghc962_stb.h +RTS -H600 -K100
| Glasgow Haskell Compiler, version 4.04, for Haskell 98, 
| compiled by GHC
| version 4.04
| 
| panic! (the `impossible' happened):
|   funResultTy t{-r1Gm-}
| 
| Please report it as a compiler bug to 
| [EMAIL PROTECTED]
| 
| 
| 2.31 real 2.27 user 0.03 sys
| deleting... /tmp/ghc962.cpp /tmp/ghc962.hi /tmp/ghc962.hc
| /tmp/ghc962_stb.c /tmp/ghc962_stb.h
| 
| rm -f /tmp/ghc962*
| sh-2.03$ exit
| exit
| 
| Script done on Tue Jan 18 11:02:01 2000
| 
| 
| --
| 
| 
| If you know how I can fix or work around this please let me 
| know as I'd
| really like to be able to do optimised builds of my project.
| 
| Thanks,
| Louis Madon
| [EMAIL PROTECTED]
| 



Re: make in-place broken?

2000-01-18 Thread Michael Weber

On Tue, Jan 18, 2000 at 03:49:35 -0800, Simon Marlow wrote:
>   BIN_DIST=1
> 
> in your build.mk file in order to build a binary distribution.  I bet that's
> the problem.

In fact, that fixed the problem...


thanks & cheers,
Michael
-- 
Lehrstuhl-BeleuchtungMichael Weber <[EMAIL PROTECTED]>
Lehrstuhl für Informatik II
RWTH Aachen
WWW: http://www-i2.informatik.rwth-aachen.de/Software/Haskell/



RE: make in-place broken?

2000-01-18 Thread Simon Marlow


> It seems, `make in-place' on a binary distribution (gen'ed with 
>   `make binary-dist Project=Ghc', CVS 2000/01/09)
> 
> doesn't produce a working system, because:
> 
> ghc/drivers/ghc-inplace (which I believe is copied to
> bin//ghc-4.06.prl in the binary dist) contains the 
> following lines:
[ gumph from ghc.prl deleted ]

I've just done a make in-place on the nightly build's binary dist, and it
seems to work fine, even built a hello world with it.

I may have forgotten to mention, after recent build system changes you need
to have the line

BIN_DIST=1

in your build.mk file in order to build a binary distribution.  I bet that's
the problem.

Cheers,
Simon



RE: problem with -split-objs and _stub.c files

2000-01-18 Thread Simon Marlow


> The driver script bails out, if using option `-split-objs' on 
> a Haskell
> source that also produces a source_stub.c (like 
> hslibs/util/Readline.lhs
> does, for example).
> 
> The obvious fix to me was checking `$ifileroot' against /stub\.s$/ in
> `runAsm()' and then not using split-objs on the file, but 
> there is surely a
> better solution (maybe in ghc-split.prl?) ...

I've incorporated your patch for now.  As you say, there's probably a better
solution, but as far as I'm concerned the less time I have to spend looking
at ghc.lprl the better :-)

Cheers,
Simon



problem with -split-objs and _stub.c files

2000-01-18 Thread Michael Weber


Hi again!

The driver script bails out, if using option `-split-objs' on a Haskell
source that also produces a source_stub.c (like hslibs/util/Readline.lhs
does, for example).

The obvious fix to me was checking `$ifileroot' against /stub\.s$/ in
`runAsm()' and then not using split-objs on the file, but there is surely a
better solution (maybe in ghc-split.prl?) ...

However, split-objs on this kind of files doesn't make much sense, does it?

I attached a patch for it, with my (hackish) solution...


Cheers,
Michael
-- 
Lehrstuhl-BeleuchtungMichael Weber <[EMAIL PROTECTED]>
Lehrstuhl für Informatik II
RWTH Aachen
WWW: http://www-i2.informatik.rwth-aachen.de/Software/Haskell/


--- ghc4-4.06.2109.orig/ghc/driver/ghc.prl.orig Thu Jan 13 09:48:30 2000
+++ ghc4-4.06.2109.orig/ghc/driver/ghc.prl  Thu Jan 13 09:49:24 2000
@@ -2168,7 +2168,7 @@
 # need to add the -I flags in case the file is going through cpp (.S files)
 local($includes) = '-I' . join(' -I', @Include_dir);
 
-if ( ! $SplitObjFiles ) {
+if ( ! $SplitObjFiles || $ifile_root =~ /_stub\.s$/ ) {
local($to_do)  = "$asmblr -o $as_out -c @As_flags $includes $cc_as";
push(@Files_to_tidy, $as_out );
&run_something($to_do, 'Unix assembler');



make in-place broken?

2000-01-18 Thread Michael Weber

Hi!

It seems, `make in-place' on a binary distribution (gen'ed with 
  `make binary-dist Project=Ghc', CVS 2000/01/09)

doesn't produce a working system, because:

ghc/drivers/ghc-inplace (which I believe is copied to
bin//ghc-4.06.prl in the binary dist) contains the following lines:

[...]
$libdir="/usr/local/lib";
$libexecdir="/usr/local/lib";
$datadir="/usr/local/share";
$bindir="/usr/local/bin";
$TMPDIR="/tmp";
$TOP_PWD="/usr/local";
[...]


The `in-place' $*dir variables are cat'ed to the _top_ of ghc-4.06.prl, with
the consequence that the variables are overridden with the lines listed
above...


Is this true, or did I miss an important step?

Cheers,
Michael
-- 
Lehrstuhl-BeleuchtungMichael Weber <[EMAIL PROTECTED]>
Lehrstuhl für Informatik II
RWTH Aachen
WWW: http://www-i2.informatik.rwth-aachen.de/Software/Haskell/