Mac OS X

2005-09-19 Thread Serge D. Mechveliani
Dear GHC supporters,

I have received a letter from a potential DoCon user

*
 I've downloaded docon 2.08. I am interested in trying to build docon. 
 I'm using ghc 6.4 intalled on my 
  Mac OS X machine. 

 I've run into an erro and it doesn't look too serious, 
 but I'm not sure exactly what to do...

 [..]

 Here is the bottom of the file log after running 
make space=-M90m docon  log:

ar -s
/Users/ruben/Documents/developer/docon-2/docon/source/export/
libHSdocon.a
echo Package {name= \docon\, import_dirs =
[\/Users/ruben/Documents/developer/docon-2/docon/source/export\],
source_dirs = [], library_dirs=
...
/Users/ruben/Documents/developer/docon-2/docon/source/docon.conf -u -g
Creating user package database in
/Users/ruben/.ghc/powerpc-darwin-6.4/package.conf
Reading package info from stdin... ghc-pkg: Line 1: Invalid syntax (no
colon after field name)
make: *** [docon] Error 1
***



I have replied with the following letter:



install.txt  of  docon-2.08  says:
  
  It was tested under the Haskell implementation  GHC-6.2.2.
  WARNING:  usually, each DoCon version works (literally as it is)
only under a single GHC version.
  On the other hand, it is easy to port to other GHC versions.
  

Mind this warning. 
In particular, the usage of  ghc-pkg (`packages'),  changes rapidly 
with the GHC version.

DoCon was tested under  Linux. 
But it is intersesting to see how it will work under  Mac OS X.

Now, you could try the following alternative ways out.

(I) 
(preferable for me)
Install  ghc-6.4.1  and ask me to send you a pre-release of
docon-2.09.
In  docon-2.09 + ghc-6.4.1,  the package feature is done in a much
simpler way (it relies on the Cabal subsystem).
With other respects, docon-2.09 is like 2.08.

(II) Install  ghc-6.2.2,  as required by  install.txt of  docon-2.08,
 and try to make  docon-2.08  under  ghc-6.2.2,
 and write me about the result.
--


What is your advice, please, concerning the versions of  
ghc, ghc-pkg, Cabal,  as related  to  Mac OS X.
Have we a chance to run  
(docon-2.09, with docon.cabal) + ghc-6.4.1  under Mac OS X ?

Regards,

-
Serge Mechveliani
[EMAIL PROTECTED]


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


RE: .hc files for building ghc-6.4.1 on amd64 ?

2005-09-19 Thread Simon Marlow
On 17 September 2005 22:05, Wilhelm B. Kloke wrote:

 I tried it again today. One of my problems was related to gmake
 version. 
 The configure script should warn, if gmake is older than 3.80 (I had
 3.78). 

I'm using 3.79.1.  I do vaguely remember a problem with older versions
of gmake - what goes wrong for you?

 The building of the .hc bundle fails wirth the following messages:
 
 ...
 tar czf ghc-6.4.1-x86_64-unknown-freebsd-hc.tar.gz `cat
 hc-files-to-go` 
 tar: ghc-6.4.1/ghc/rts/PrimOps.hc: Cannot stat: No such file or
 directory 
 tar: ghc-6.4.1/ghc/rts/StgStartup.hc: Cannot stat: No such file or
 directory 
 tar: ghc-6.4.1/ghc/rts/StgStdThunks.hc: Cannot stat: No such file or
 directory 
 tar: ghc-6.4.1/ghc/rts/Updates.hc: Cannot stat: No such file or
 directory 
 tar: ghc-6.4.1/ghc/rts/Apply.hc: Cannot stat: No such file or
 directory 
 tar: ghc-6.4.1/ghc/rts/Exception.hc: Cannot stat: No such file or
 directory 
 tar: ghc-6.4.1/ghc/rts/HeapStackCheck.hc: Cannot stat: No such file
 or directory 
 tar: ghc-6.4.1/ghc/rts/StgMiscClosures.hc: Cannot stat: No such file
 or directory 
 tar: ghc-6.4.1/libraries/haskell-src/Language/Haskell/Parser.hs:
 Cannot stat: No such file or directory gmake: *** [hc-file-bundle]
 Fehler 1 

Yes, you do actually need to generate these .hc files on the host
system.  What happened to the build in ghc/rts - could you post the
error message?  Possibly a 'make -k' in ghc/rts will be enough to get
these files.

 I tried to go back to ghc/rts to build more files following the
 ipattern of the last steps before, but this destroys genapply.

Don't quite understand this - could you elaborate?

 Further, there are some hsc.c files of length 0 like:
 ~/Haskell/fptools-i386amd64/ghc-6.4.1 0$ ls -l
 libraries/base/System/*hsc.c 
 -rw-r--r--  1 wb  ifado  0 17 Sep 21:31
 libraries/base/System/CPUTime_hsc.c 
 -rw-r--r--  1 wb  ifado  0 17 Sep 21:31
 libraries/base/System/Time_hsc.c 

This is correct (the C compiler should generate an empty object file
when compiling them).  It was easier to avoid the special case in the
build system when the _hsc.c file is empty.
 
 The building process on the target system fails with messages that
 there is no rule to build those files. Also, I needed to have happy
 and alex 
 on the target system, because make boot fails without them (catch 22).

When things are working properly, you don't need Happy or Alex on the
target system.  I suspect things have gone wrong earlier.

 A final glitch is that (at least, my) FreeBSD-amd64-6.0 gcc does not
 include -I/usr/local/include and -L/usr/local/lib in the search path.
 So libgmp is not found.

Ok.  You can use the libgmp in the tree (this should happen
automatically), or you can add the -I/-L flags to the relevant places.
This is something we don't handle very well right now, though.

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


Re: .hc files for building ghc-6.4.1 on amd64 ?

2005-09-19 Thread Wilhelm B. Kloke
Simon Marlow [EMAIL PROTECTED] schrieb:
 On 17 September 2005 22:05, Wilhelm B. Kloke wrote:

 I tried it again today. One of my problems was related to gmake
 version. 
 The configure script should warn, if gmake is older than 3.80 (I had
 3.78). 

 I'm using 3.79.1.  I do vaguely remember a problem with older versions
 of gmake - what goes wrong for you?

The old gmake does not get the dependencies right.

 The building of the .hc bundle fails wirth the following messages:
 
 ...
 tar czf ghc-6.4.1-x86_64-unknown-freebsd-hc.tar.gz `cat
 hc-files-to-go` 
 tar: ghc-6.4.1/ghc/rts/PrimOps.hc: Cannot stat: No such file or
 directory 
...
 Cannot stat: No such file or directory gmake: *** [hc-file-bundle]
 Fehler 1 

 Yes, you do actually need to generate these .hc files on the host
 system.  What happened to the build in ghc/rts - could you post the
 error message?  Possibly a 'make -k' in ghc/rts will be enough to get
 these files.

 I tried to go back to ghc/rts to build more files following the
 ipattern of the last steps before, but this destroys genapply.

 Don't quite understand this - could you elaborate?

I tried
 (cd ghc/rts ; gmake all)
after (cd ghc/compiler ; gmake stage=2 )

I have further information now. When compiling Linker.c,
the compilation fails, because there is no MAP_32BIT in FreeBSD-amd64.
Perhaps just removing this could make it work. I have no idea
why it is needed on linux-x86_64.

 there is no rule to build those files. Also, I needed to have happy
 and alex 
 on the target system, because make boot fails without them (catch 22).

 When things are working properly, you don't need Happy or Alex on the
 target system.  I suspect things have gone wrong earlier.

Probably. But this is in a very early stage. It even happens when using
 gmake -n boot
(for finding the cause I wanted to know the commands which may have failed),
that two command using $(HAPPY) and $(ALEX) are executed. I was not
able to locate the point better. Perhaps you could try the first stages of
the crossbuild on suitable system, where these two variable from
mk/config.mk are defined empty (as was the case on my system after configure).

 A final glitch is that (at least, my) FreeBSD-amd64-6.0 gcc does not
 include -I/usr/local/include and -L/usr/local/lib in the search path.
 So libgmp is not found.

 Ok.  You can use the libgmp in the tree (this should happen
 automatically), or you can add the -I/-L flags to the relevant places.

This was not possible, as x86_64 does not seem supported in ghc's gmp.
The other solution (exporting LDFLAGS=-L/usr/local/lib) works.

-- 
Dipl.-Math. Wilhelm Bernhard Kloke
Institut fuer Arbeitsphysiologie an der Universitaet Dortmund
Ardeystrasse 67, D-44139 Dortmund, Tel. 0231-1084-257

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


RE: .hc files for building ghc-6.4.1 on amd64 ?

2005-09-19 Thread Simon Marlow
On 19 September 2005 12:45, Wilhelm B. Kloke wrote:

 I tried
 (cd ghc/rts ; gmake all)
 after (cd ghc/compiler ; gmake stage=2 )

You should try a 'gmake -k' in ghc/rts, that might be enough to get the
required .hc files.
 
 I have further information now. When compiling Linker.c,
 the compilation fails, because there is no MAP_32BIT in FreeBSD-amd64.
 Perhaps just removing this could make it work. I have no idea
 why it is needed on linux-x86_64.

MAP_32BIT is quite important: it tells mmap() to return memory in the
lower 2Gb of the address space, so that we can assume all symbols have
32 bit addresses.  This is how the small memory model on Linux works.  I
bet FreeBSD has something equivalent (or maybe not?).

This is only required for GHCi.  You can get a working compiler without
needing a working Linker.c.

 Probably. But this is in a very early stage. It even happens when
 using 
 gmake -n boot
 (for finding the cause I wanted to know the commands which may have
 failed), that two command using $(HAPPY) and $(ALEX) are executed. I
 was not 
 able to locate the point better. Perhaps you could try the first
 stages of the crossbuild on suitable system, where these two variable
 from 
 mk/config.mk are defined empty (as was the case on my system after
 configure).

I would, but I'm kind of busy doing the 6.4.1 release right now.  When I
have more time, I plan to try the port to FreeBSD/amd64 myself (unless
anyone gets there first).

Cheers,
Simon

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


ghc 6.4.1 for OS X from darwinports

2005-09-19 Thread Gregory Wright


Hi,

GHC 6.4.1 is now available for OS X via the darwinports system.

The compiler is built from source, using a binary bootstrap compilier.
Both 10.3 (Panther) and 10.4 (TIger) are supported.

For more information on darwinports, see:

http://darwinports.opendarwin.org

Best Wishes,
Greg

Gregory Wright
Antiope Associates LLC
[EMAIL PROTECTED]



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


C/Haskell speed comparisons

2005-09-19 Thread Ian Lynagh

Hi all,

Quite often in darcs we want to do a simple loop over a chunk of memory,
looking for the first whitespace character or somesuch.

Historically this has been done by writing a small snippet of C, but
this has a number of downsides (less type safety in the C code,
Int/int/HsInt/CInt mismatches, code artificially separated, complicates
the Makefiles, have to write C code), so I'd like to replace them with
little bits of Haskell.

However, it would be easier to convince people that this is the right
thing to do if there was no slow-down involved, so I've put some
benchmarks together. Hopefully this will help find some cases where ghc
is generating poor code, and perhaps help to spot regressions (although
it's hard to spot that automatically currently).

Essentially each test has n modules, each of which (are supposed to) do
the same thing, and it compares certain pairs and it works out how much
slower one is than the other on various test sizes. I arbitrarily
declared x1.1 to be too slow.

The code is at http://urchin.earth.li/~ian/bench/ and the results I get
for ghc 6.4.1 are at http://urchin.earth.li/~ian/bench/all.html
(interestingly some of the slowdowns I was trying to measure turned out
to be speed/ups/).


Thanks
Ian

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