Re: HaXml stuff ...

2000-03-01 Thread Keith Wansbrough

On the Haskell list, Bill Halchin writes:

 I am trying to build the HaXML stuff and the linker (ld) is
 looking for an archive, gmp.a, which I don't have installed. Can
 anybody lead me in the right direction??

[queries like this should really go to
[EMAIL PROTECTED] or [EMAIL PROTECTED],
since they relate to the Glasgow Haskell Compiler and not to Haskell
in general]

Assuming you're using Linux, you want the gmp RPM:

http://rpmfind.net/linux/RPM/libgmp.so.2.html

GMP is the Gnu Multiple-Precision library, which GHC uses for Integer
arithmetic.


GHC maintainers: this is definitely a FAQ - is it mentioned on the GHC
download page?

HTH.

--KW 8-)




RE: HaXml stuff ...

2000-03-01 Thread Simon Marlow


 GHC maintainers: this is definitely a FAQ - is it mentioned on the GHC
 download page?

Yes :)

http://www.haskell.org/ghc/faq_406.html

Simon



RE: GHC include files

2000-03-01 Thread Simon Marlow


 Don't know about binary dists, but I compiled 4.06 from source and
 it did install directly in /usr/local/lib, which is IMHO not so good.
 Many files used by a single package should generally go to a separate
 subdirectory. I reran ./configure with some option to install in
 /usr/local/lib/ghc-4.06 to have less mess directly in /usr/local/lib.

I think on reflection that /usr/local/lib/ghc or /usr/local/lib/ghc-4.06
would be a better choice than /usr/local/lib.  In fact, binary distributions
already use the latter.

Include files, on the other hand, should really be in
/usr/local/include/ghc, so f.e. #include ghc/RtsAPI.h has a chance of
working.

 BTW, I see lack of standard way of conveniently installing a Haskell
 library. For example c2hs installs in its own subdirectory 
 and provides
 a script c2hs-config which outputs compiler and linker flags necessary
 to link an application with c2hs libs. OK, but should every package
 provide its own script?

I don't think so.  Also, I don't think we should adopt a solution that
requires the programmer to know anything about how or where a particular
library is installed.

I had in mind a slight generalisation of GHC's syslib mechanism.  Currently
GHC's libraries (HsLibs) are split into about 7 categories, and you can
bring a given category into scope by saying, eg. '-syslib text' on the
command line.  GHC knows about dependencies between libraries, so you don't
need to say '-syslib lang' as well, if text depends on lang.  The ordering
is also unimportant.

What we need is a way for external library writers to be able to package up
and distribute a library that will install onto a system with an existing
GHC such that you can say '-syslib blah' to get the new library.  This is
pretty straightforward, we just need to separate out the syslib
configuration stuff from the driver, and write a (perl?) script to do the
installation.  The script would be part of GHC, and invoked as part of the
library installation.

In the long term, I hope Haskell will get a hiearchical module namespace and
we can do away with the -syslib option altogether.  We're also working
towards expanding the library collection to be a lot more comprehensive;
we've now incorporated HaXml, for instance.

 Simon Marlow has already explained why shared libraries are currently
 impossible... A pity. Hope that at some time someone will anyway
 do them, possibly not using standard Unix linker if problems are
 specifically with it itself rather than with the concept.

Good news on this front: due to a truly heroic effort on the part of Julian,
STG-Hugs is just about able to load GHC-compiled modules, which means you
can compile Main.hs into Main.o, and run it inside STG-Hugs against the
compiled prelude/libraries etc.  Strictly speaking it's dynamic linking, not
shared libraries, but you still get the disk-space and link-time savings.

If the linker were separated out from Hugs and included in GHC's RTS, we'd
have a way to generate standalone dynamically-linked binaries.

Cheers,
Simon



Re: GHC include files

2000-03-01 Thread George Russell

I must admit I'm surprised by the reaction to my suggestion.  Here /usr is shared
between lots of machines and there is no question of my installing GHC in /usr/bin
or anything like it.  (The few system adminstrators here are all honest, overworked,
and sadly incorruptible.)  My original problem was that GHC installs the
include files in prefix/lib/ghc-4.06/includes meaning you have to know the
version number as well as the prefix.  I suppose this makes sense where
prefix is in fact /usr, but I actually make prefix depend on the version,
so having to specify the version twice is redundant.  At least my scheme means
that (on the rare times when I can build from source . . .) I can store
multiple CVS releases.



RE: GHC include files

2000-03-01 Thread Simon Marlow

 Just a few remarks and personal opinions from a RPM builder's view:
 
* IMHO the whole /usr/local hierarchy is completely obsolete for
  and "real" programs should only be used for quick local hacks.
  = GHC should reside under /usr/{bin,lib,include}

I'd rather say that the use of /usr/local is system dependent.  The BSD
folks for example have a nice clear scheme: everything in /usr is part of
the base system, everything in /usr/local comes from the ports tree.

In a package system the choice of installation directories is moot, as you
point out.  The only issue is whether several versions are allowed to
co-exist.  Either choice seems reasonable to me.

Cheers,
Simon



Re: GHC include files

2000-03-01 Thread Manuel M. T. Chakravarty

Malcolm Wallace [EMAIL PROTECTED] wrote,

 Can I propose a change to the -i / -I flags?  Currently, the -idir (or
 -Idir) options add a directory to the search path for imports.  This
 directory is either relative to the current dir, or absolute.  My
 suggestion is that it could also be used for "relative to a standard
 installation directory".  For instance, -Idata/edison would look first
 in ./data/edison if it exists, then in $prefix/data/edison, where
 $prefix has the value /usr/local/lib/ghc, or whatever.
 
 I think this is a reasonably straightforward means to allow
 hierarchical library organisation.  Plus, as of about two weeks ago,
 nhc98 (in CVS) implements something similar to this feature.
 
 However, -i / -I only covers imports, it doesn't cover linking.  Hence,
 I also propose to extend the -L flag in the same way.  -Ldir usually
 adds a relative or absolute directory to the link search path, so
 the same extension would allow "-Ldata/edison -ledison" to search for
 both ./data/edison/libedison.a and $prefix/data/edison/libedison.a.

The disadvantage of this scheme is that you can get into
trouble as soon as you (accidentally) name one of your local
directories the same as one of the system directories.  With
system directories like `posix', `lang', `num', `net', etc a
collision is only a matter of time, I think.

Cheers,
Manuel



RE: GHC include files

2000-03-01 Thread Manuel M. T. Chakravarty

Simon Marlow [EMAIL PROTECTED] wrote,

  Don't know about binary dists, but I compiled 4.06 from source and
  it did install directly in /usr/local/lib, which is IMHO not so good.
  Many files used by a single package should generally go to a separate
  subdirectory. I reran ./configure with some option to install in
  /usr/local/lib/ghc-4.06 to have less mess directly in /usr/local/lib.
 
 I think on reflection that /usr/local/lib/ghc or /usr/local/lib/ghc-4.06
 would be a better choice than /usr/local/lib.  In fact, binary distributions
 already use the latter.

I like the use of a prefix including the program name and
version number very much, as I usually have about three
versions of ghc installed (the latest stable release, the
stable release before that, and the current cvs version).

I understand Sven's position on that matter, but only
because some packages make a mess out of the installation
doesn't mean that we can't find a nice way to let different
versions co-exist.

 Include files, on the other hand, should really be in
 /usr/local/include/ghc, so f.e. #include ghc/RtsAPI.h has a chance of
 working.

That is indeed a problem.

  BTW, I see lack of standard way of conveniently installing a Haskell
  library. For example c2hs installs in its own subdirectory 
  and provides
  a script c2hs-config which outputs compiler and linker flags necessary
  to link an application with c2hs libs. OK, but should every package
  provide its own script?
 
 I don't think so.  Also, I don't think we should adopt a solution that
 requires the programmer to know anything about how or where a particular
 library is installed.
 
 I had in mind a slight generalisation of GHC's syslib mechanism.  Currently
 GHC's libraries (HsLibs) are split into about 7 categories, and you can
 bring a given category into scope by saying, eg. '-syslib text' on the
 command line.  GHC knows about dependencies between libraries, so you don't
 need to say '-syslib lang' as well, if text depends on lang.  The ordering
 is also unimportant.

I will still have to use `c2hs-config'[1].  The point of
`c2hs-config' is to provide a truely OS and compiler
system-independent way of using C-HS.  So, unless the
Haskell language definition enforces a fixed policy on
library organisation, the need for `c2hs-config' won't go
away.

In fact, the concept behind `c2hs-config' is not my own
idea.  It is the mechanism used by the GTK+ and Gnome
libraries - ie, even C libraries run into essentially the
same problems as we do.

There are quite a number of subtleties involved here:

* How do I get the version of a library?  (I just use
  `c2hs-config --version'.)

* How can I have two versions of the same library installed?
  (With `c2hs-config' they can be installed with different
  prefixes.) 

* How can I select between different versions of one
  library?  Eg, how can I have

./configure --cool-lib=whichever

  style options in a program using the library.

  (With `c2hs-config', you just provide the path to the
  c2hs-config script you want - the script knows the rest.)

* How can I handle multi-language programs/libraries (eg,
  mixed C and Haskell code)?  (The `...-config' script gets
  different flags for the different languages involved.)

* How can I select between different capabilities of my
  library (with or without threads or so)?  (`gtk-config' is 
  called with or without the `gthread' argument).

I don't know of any other configuration mechanism that
handles all these things gracefully.

Cheers,
Manuel

[1] For those who don't know how `c2hs-config' works:

  http://www.cse.unsw.edu.au/~chak/haskell/c2hs/docu/c2hs-2.html#ss2.1



Re: GHC include files

2000-03-01 Thread Michael Weber

On Tue, Feb 29, 2000 at 17:06:01 +, Marcin 'Qrczak' Kowalczyk wrote:
 BTW, I see lack of standard way of conveniently installing a Haskell
 library. For example c2hs installs in its own subdirectory and provides a
 script c2hs-config which outputs compiler and linker flags necessary to
 link an application with c2hs libs. OK, but should every package provide
 its own script?

At least, the idea is flexible and those scripts are easily adaptable...

 Putting C headers in a standard place like /usr/include or
 /usr/local/include and C libraries in /usr/lib is convenient.

Not a good idea, if there is more than one version of a software installed
on a system...

 IMHO there should be a flag similar to -syslib which tells the compiler
 and linker to use a package of a given name from such standard
 directory (hoping that there will be no name clashes): search for
 interfaces there and link a library. Not depending on whether it is
 under /usr/lib or /usr/local/lib - packages themselves should not be
 required to separately announce where they reside.
 

 It's possible that a package requires some additional compiler flags when
 it is used.

the "script" solution addresses this problem, too... 
(cf. `xxx-config--libs')

 Will ghc change interface format with each version? :-)

This is the biggest problem (and, interestingly, the least addressed :-)).
Especially for binary distribution builders, it's quite inconvenient to
rebuild every GHC-library on the system to match with the latest compiler
version :-(

I thought about a scheme similar to the tex-font generation (if the font is
"compiled" for a particular resolution (dpi), it's re-used; if not, it is
created).

[I'll describe that in another mail...]


On Wed, Mar 01, 2000 at 04:34:43 -0800, Simon Marlow wrote:
 What we need is a way for external library writers to be able to package up
 and distribute a library that will install onto a system with an existing
 GHC such that you can say '-syslib blah' to get the new library.  This is
 pretty straightforward, we just need to separate out the syslib
 configuration stuff from the driver, and write a (perl?) script to do the
 installation.  The script would be part of GHC, and invoked as part of the
 library installation.

This would not address the .hi-file versionitis...
And what, if the library needs additional compiler flags?


On Wed, Mar 01, 2000 at 14:29:41 +0100, Sven Panne wrote:
 Just a few remarks and personal opinions from a RPM builder's view:
 
* IMHO the whole /usr/local hierarchy is completely obsolete for
  and "real" programs should only be used for quick local hacks.
  = GHC should reside under /usr/{bin,lib,include}

... and the GNU/Hurd people try to obsolete the /usr tree IIRC :-)

... and there is the /opt tree (for big packages) ...

quoting FHS-pre2.1#4.6 "/usr/local : Local hierarchy":
[...]
This directory should always be empty after first installing a FHS-
compliant system.  No exceptions to this rule should be made other than
the listed directory stubs.

Locally installed software should be placed within /usr/local rather
than /usr unless it is being installed to replace or upgrade software in
/usr.
[...]

So, /usr/local is perfectly ok for software that is not installed via a
package management system and should be the default for a source dist or
binary-tarballs[2].

[2] a single tarball bindist is _NO_ package management! (Go away,
slackware users! :-))

There is no single solution... that's one of the reasons, why autoconf
exists, right? :-) (Hi Sven, Manuel!) :-)) 


 Include files, on the other hand, should really be in
 /usr/local/include/ghc, so f.e. #include ghc/RtsAPI.h has a chance of
 working. [...]

I'd favour a scheme, in which ghc can tell me, where the include files
reside: the perl driver already knows about the location, so why not adding
an option: `ghc --print-includedir'?

This would also be the cleanest solution, if there is more than one version
of ghc installed...

Honestly, if a project has more than two source files, I let `make' care
about dependencies etc. and
  GHCINCLUDES := $(shell $(HC) --print-includedir)
  [...]
  %.o: %.hs
$(HC) $(GHCINCLUDES) $(MOREOPTIONS) $ -o $@
  
is not very complicated, is it?


On Wed, Mar 01, 2000 at 07:59:25 -0800, Simon Marlow wrote:
 In a package system the choice of installation directories is moot, as you
 point out.  The only issue is whether several versions are allowed to
 co-exist.

There is also the possibility to have more than one _flavour_ of a specific
version installed, for example ghc-4.06 and ghc-4.06-debugging...


Cheers,
Michael
p.s.: I'm just browsing through my overflowing mail folders, sorry if I
  miss some of the messages...
-- 
Lehrstuhl-Gärtnerei  Michael Weber [EMAIL PROTECTED]
Lehrstuhl für Informatik II
RWTH Aachen
WWW: http://www-i2.informatik.rwth-aachen.de/Software/Haskell/