Re: Fail to compile ghc-6.2 on a Sun/Sparc

2004-01-15 Thread Volker Stolz
In local.glasgow-haskell-users, you wrote:
 Ok, that was definitely my fault. I´ve built the gnu-make and tried again. 
 After an hour of compilation ghc ended with:

 ./../ghc/utils/hsc2hs/hsc2hs-inplace -Iinclude -I../../ghc/includes -I.
 GHC/Unicode.hsc
 Unicode.hsc: In function `main':
 Unicode.hsc:126: `wint_t' undeclared (first use in this function)
 Unicode.hsc:126: (Each undeclared identifier is reported only once
 Unicode.hsc:126: for each function it appears in.)
 Unicode.hsc:126: parse error before int
 make[2]: *** [GHC/Unicode.hs] Error 1
 make[1]: *** [boot] Error 1
 make[1]: Leaving directory `/home/mai99dnn/tmp/ghc-6.2/libraries'
 make: *** [build] Error 1

Just update if you use CVS are use the following patch (from O.Braun).
Then, 'gmake clean' and restart the build (both just in 'libraries', the
compiler built fine).

--- libraries/base/GHC/Unicode.hsc.orig Mon Oct 20 12:12:20 2003
+++ libraries/base/GHC/Unicode.hsc  Mon Jan 12 23:32:22 2004
@@ -112,7 +112,7 @@
 -- -
 -- Win32 implementation
 
-#if (defined(HAVE_WCTYPE_H)  HAVE_ISWSPACE) || mingw32_TARGET_OS
+#if (defined(HAVE_WCTYPE_H)  HAVE_ISWSPACE  defined(HTYPE_WINT_T)) || 
mingw32_TARGET_OS
 
 -- Use the wide-char classification functions if available.  Glibc
 -- seems to implement these properly, even for chars  0x, as long
-- 
http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME
rage against the finite state machine 
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Fail to compile ghc-6.2 on a Sun/Sparc

2004-01-15 Thread Patrick Scheibe

Hmm, the patch works fine, but compilation stops when building 
libraries/base/GHC/List.o
It seems to me that some library of the system makes trouble. I dont think 
thats a ghc errror:

rm -f GHC/List.o; if [ ! -d GHC/List_split ]; then mkdir GHC/List_split; else 
/usr/bin/find GHC/List_split -name '*.o' -print | xargs rm -f __rm_food; fi;
Putting child 0x000aa798 (GHC/List.o) PID 9863 on the chain.
Live child 0x000aa798 (GHC/List.o) PID 9863
Got a SIGCHLD; 1 unreaped children.
Reaping winning child 0x000aa798 PID 9863
../../ghc/compiler/ghc-inplace -H16m -O -fglasgow-exts -cpp -Iinclude 
-#include HsBase.h -funbox-strict-fields -package-name base -O -Rghc-timing  
-split-objs-c GHC/List.lhs -o GHC/List.o  -ohi GHC/List.hi
Live child 0x000aa798 (GHC/List.o) PID 9868
Segmentation Fault
Got a SIGCHLD; 1 unreaped children.
Reaping losing child 0x000aa798 PID 9868
make[1]: *** [GHC/List.o] Error 139
Removing child 0x000aa798 PID 9868 from chain.
Got a SIGCHLD; 1 unreaped children.
Reaping losing child 0x00055318 PID 9857
make: *** [all] Error 1
Removing child 0x00055318 PID 9857 from chain.

How can I get more informations than just the segfault-message?

Cheers
Patrick


Am Donnerstag, 15. Januar 2004 09:17 schrieben Sie:
 In local.glasgow-haskell-users, you wrote:
  Ok, that was definitely my fault. I´ve built the gnu-make and tried
  again. After an hour of compilation ghc ended with:
 
  ./../ghc/utils/hsc2hs/hsc2hs-inplace -Iinclude -I../../ghc/includes -I.
  GHC/Unicode.hsc
  Unicode.hsc: In function `main':
  Unicode.hsc:126: `wint_t' undeclared (first use in this function)
  Unicode.hsc:126: (Each undeclared identifier is reported only once
  Unicode.hsc:126: for each function it appears in.)
  Unicode.hsc:126: parse error before int
  make[2]: *** [GHC/Unicode.hs] Error 1
  make[1]: *** [boot] Error 1
  make[1]: Leaving directory `/home/mai99dnn/tmp/ghc-6.2/libraries'
  make: *** [build] Error 1

 Just update if you use CVS are use the following patch (from O.Braun).
 Then, 'gmake clean' and restart the build (both just in 'libraries', the
 compiler built fine).

 --- libraries/base/GHC/Unicode.hsc.orig   Mon Oct 20 12:12:20 2003
 +++ libraries/base/GHC/Unicode.hscMon Jan 12 23:32:22 2004
 @@ -112,7 +112,7 @@
  --
 ---
-- -- Win32 implementation

 -#if (defined(HAVE_WCTYPE_H)  HAVE_ISWSPACE) || mingw32_TARGET_OS
 +#if (defined(HAVE_WCTYPE_H)  HAVE_ISWSPACE  defined(HTYPE_WINT_T)) ||
 mingw32_TARGET_OS

  -- Use the wide-char classification functions if available.  Glibc
  -- seems to implement these properly, even for chars  0x, as long

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


RE: Fail to compile ghc-6.2 on a Sun/Sparc

2004-01-15 Thread Simon Marlow
 
 Hmm, the patch works fine, but compilation stops when building 
 libraries/base/GHC/List.o
 It seems to me that some library of the system makes trouble. 
 I dont think 
 thats a ghc errror:
 
 rm -f GHC/List.o; if [ ! -d GHC/List_split ]; then mkdir 
 GHC/List_split; else 
 /usr/bin/find GHC/List_split -name '*.o' -print | xargs rm -f 
 __rm_food; fi;
 Putting child 0x000aa798 (GHC/List.o) PID 9863 on the chain.
 Live child 0x000aa798 (GHC/List.o) PID 9863
 Got a SIGCHLD; 1 unreaped children.
 Reaping winning child 0x000aa798 PID 9863
 ../../ghc/compiler/ghc-inplace -H16m -O -fglasgow-exts -cpp -Iinclude 
 -#include HsBase.h -funbox-strict-fields -package-name base 
 -O -Rghc-timing  
 -split-objs-c GHC/List.lhs -o GHC/List.o  -ohi GHC/List.hi
 Live child 0x000aa798 (GHC/List.o) PID 9868
 Segmentation Fault
 Got a SIGCHLD; 1 unreaped children.
 Reaping losing child 0x000aa798 PID 9868
 make[1]: *** [GHC/List.o] Error 139
 Removing child 0x000aa798 PID 9868 from chain.
 Got a SIGCHLD; 1 unreaped children.
 Reaping losing child 0x00055318 PID 9857
 make: *** [all] Error 1
 Removing child 0x00055318 PID 9857 from chain.
 
 How can I get more informations than just the segfault-message?

What version of gcc do you have installed?  (gcc --version).

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


Re: Fail to compile ghc-6.2 on a Sun/Sparc

2004-01-15 Thread Oliver Braun
* Patrick Scheibe [EMAIL PROTECTED] [2004-01-14 22:56 +0100]:
 ../../ghc/utils/hsc2hs/hsc2hs-inplace -Iinclude -I../../ghc/includes -I.
 GHC/Unicode.hsc
 Unicode.hsc: In function `main':
 Unicode.hsc:126: `wint_t' undeclared (first use in this function)
 Unicode.hsc:126: (Each undeclared identifier is reported only once
 Unicode.hsc:126: for each function it appears in.)
 Unicode.hsc:126: parse error before int
 make[2]: *** [GHC/Unicode.hs] Error 1
 make[1]: *** [boot] Error 1
 make[1]: Leaving directory `/home/mai99dnn/tmp/ghc-6.2/libraries'
 make: *** [build] Error 1

Try the attached patch.

HTH,
 Olli
-- 
Oliver Braun -- obraun @ { unsane.org | FreeBSD.org | haskell.org }
--- libraries/base/GHC/Unicode.hsc.orig Mon Oct 20 12:12:20 2003
+++ libraries/base/GHC/Unicode.hsc  Mon Jan 12 23:32:22 2004
@@ -112,7 +112,7 @@
 -- -
 -- Win32 implementation
 
-#if (defined(HAVE_WCTYPE_H)  HAVE_ISWSPACE) || mingw32_TARGET_OS
+#if (defined(HAVE_WCTYPE_H)  HAVE_ISWSPACE  defined(HTYPE_WINT_T)) || 
mingw32_TARGET_OS
 
 -- Use the wide-char classification functions if available.  Glibc
 -- seems to implement these properly, even for chars  0x, as long


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


Re: Fail to compile ghc-6.2 on a Sun/Sparc

2004-01-15 Thread Patrick Scheibe
Am Donnerstag, 15. Januar 2004 10:35 schrieb Simon Marlow:
  Hmm, the patch works fine, but compilation stops when building
  libraries/base/GHC/List.o
  It seems to me that some library of the system makes trouble.
  I dont think
  thats a ghc errror:
 
  rm -f GHC/List.o; if [ ! -d GHC/List_split ]; then mkdir
  GHC/List_split; else
  /usr/bin/find GHC/List_split -name '*.o' -print | xargs rm -f
  __rm_food; fi;
  Putting child 0x000aa798 (GHC/List.o) PID 9863 on the chain.
  Live child 0x000aa798 (GHC/List.o) PID 9863
  Got a SIGCHLD; 1 unreaped children.
  Reaping winning child 0x000aa798 PID 9863
  ../../ghc/compiler/ghc-inplace -H16m -O -fglasgow-exts -cpp -Iinclude
  -#include HsBase.h -funbox-strict-fields -package-name base
  -O -Rghc-timing
  -split-objs-c GHC/List.lhs -o GHC/List.o  -ohi GHC/List.hi
  Live child 0x000aa798 (GHC/List.o) PID 9868
  Segmentation Fault
  Got a SIGCHLD; 1 unreaped children.
  Reaping losing child 0x000aa798 PID 9868
  make[1]: *** [GHC/List.o] Error 139
  Removing child 0x000aa798 PID 9868 from chain.
  Got a SIGCHLD; 1 unreaped children.
  Reaping losing child 0x00055318 PID 9857
  make: *** [all] Error 1
  Removing child 0x00055318 PID 9857 from chain.
 
  How can I get more informations than just the segfault-message?

 What version of gcc do you have installed?  (gcc --version).

 Cheers,
   Simon

There is the following version installed. The version seems to 
be greater than that versionnumber that is needed.
While I'm waiting I'll compile the gnu-gcc...

bash-2.05$ gcc --version
gcc (GCC) 3.2.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.




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


Random number generator

2004-01-15 Thread Gwoing Yu


Hi,

I need some assistances in calling random number generatorusing 6.0.1 haskell compiler. To return a list of random int [Int], I have tried the following:

drawInt :: Int-Int - [Int]drawInt x y = getStdRandom (randomRs (x,y))

It has a type error. I would appreciate if you know how to fix it.

Thank you in advance.

Tina Yu
http://www.improvise.ws
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Random number generator

2004-01-15 Thread Stefan Reich
That's definitely not a message for the bugs list :-)

Please have a look at this page: 
http://www.zvon.org/other/haskell/Outputrandom/getStdRandom_f.html

It gives the correct signature for drawInt as you defined it: Int - Int 
- IO Int

The signature you gave doesn't work because it specifies a pure function 
- for the same set of arguments, it must always produce the same result.

How many ints do you want to generate? I don't think it is possible to 
generate an infinite lazy list in this case because this interferes with 
monad semantics. If you want a fixed number of random ints, try this:

drawInts :: Int - Int - Int - IO [Int]
drawInts num x y = sequence (replicate num (getStdRandom (randomR (x,y
-Stefan

Gwoing Yu wrote:

Hi,
 
I need some assistances in calling random number generator using 6.0.1 
haskell compiler. To return a list of random int [Int], I have tried  
the following:
 
drawInt :: Int-Int - [Int]
drawInt x y =  getStdRandom (randomRs (x,y))
 
It has a type error. I would appreciate if you know how to fix it.
 
Thank you in advance.
 
Tina Yu
http://www.improvise.ws http://www.improvise.ws/
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Fail to compile ghc-6.2 on a Sun/Sparc

2004-01-15 Thread mai99dnn
Ok, with the right versions of gcc and make and great support of my tutor
ghc-6.2 is compiled succesfully on the sun :-)

Thanks to all
Patrick



Am Donnerstag, 15. Januar 2004 12:10 schrieb Simon Marlow:
  There is the following version installed. The version seems to
  be greater than that versionnumber that is needed.
  While I'm waiting I'll compile the gnu-gcc...
 
  bash-2.05$ gcc --version
  gcc (GCC) 3.2.1
  Copyright (C) 2002 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.
   There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A
  PARTICULAR PURPOSE.

 GCC versions later than 3.x have a bug which affects code generation on
 Sparc and other (non-x86) architectures.  This is most likely the cause
 of your crash. Please install GCC 2.95.

 Cheers,
   Simon

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


Re: Random number generator

2004-01-15 Thread Tomasz Zielonka
On Thu, Jan 15, 2004 at 11:00:24PM +0100, Stefan Reich wrote:
 
 How many ints do you want to generate? I don't think it is possible to 
 generate an infinite lazy list in this case because this interferes with 
 monad semantics. If you want a fixed number of random ints, try this:
 
 drawInts :: Int - Int - Int - IO [Int]
 drawInts num x y = sequence (replicate num (getStdRandom (randomR (x,y

Sure you can. You can 'split' the random generator getting two new
generators. One is used to update the global generator, and you use the
second one to generate infinite list of pseudo-random values.

  drawInts :: Int - Int - IO [Int]
  drawInts x y = getStdRandom split = (return . randomR (x, y))

Actually, if you relax the type signature you get a function that's
missing from Random module:

  randomRIOs :: (Random a) = (a, a) - IO [a]
  randomRIOs r = getStdRandom split = (return . randomRs r)

Best regards,
Tom

-- 
.signature: Too many levels of symbolic links
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users