
Is it possible to use Cabal with older versions (e. g. 6.0 to 6.2.2) of GHC? Some time later, I am going to release HSFFIG as a package. To be usable with GHC 6.2.2, can it be packaged with Cabal, or do I have to use ghc-pkg? If I use ghc-pkg, is there a way to convert such a package into Cabal? I am not going to upgrade to GHC 6.4.x any time soon, so what are my options in using Cabal with 6.2.2? -- Dimitry Golubovsky Anywhere on the Web

Hi,
I am trying to build from the current GHC source tree on a Debian
"sarge" box, and the build dies trying to compile
/home/shinobi/build/fptools/ghc/parser/Parser.hs, with the following
output:
/usr/bin/ghc -H16m -O -istage1/utils -istage1/basicTypes
-istage1/types -istage1/hsSyn -istage1/prelude -istage1/rename
-istage1/typecheck -istage1/deSugar -istage1/coreSyn
-istage1/specialise -istage1/simplCore -istage1/stranal
-istage1/stgSyn -istage1/simplStg -istage1/codeGen -istage1/main
-istage1/profiling -istage1/parser -istage1/cprAnalysis
-istage1/compMan -istage1/ndpFlatten -istage1/iface -istage1/cmm
-istage1/nativeGen -Istage1 -cpp -fglasgow-exts -fno-generics
-Rghc-timing -I. -IcodeGen -InativeGen -Iparser -package unix -recomp
-Rghc-timing -H16M '-#include "hschooks.h"' -i../lib/compat
-fno-warn-incomplete-patterns -fvia-C -Onot
-fno-ignore-interface-pragmas -c parser/Parser.hs -o
stage1/parser/Parser.o -ohi stage1/parser/Parser.hi
gcc: Internal error: Killed (program cc1)
Please submit a full bug report.
See URL:http://gcc.gnu.org/bugs.html for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see URL:file:///usr/share/doc/gcc-3.3/README.Bugs.
<

On Tue, 2005-07-12 at 22:59 +0300, Dinko Tenev wrote:
Hi,
I am trying to build from the current GHC source tree on a Debian "sarge" box, and the build dies trying to compile /home/shinobi/build/fptools/ghc/parser/Parser.hs, with the following output:
I have had this problem regularly...
It seems that, apart from whatever else might be wrong, there is a problem with GCC.
Yes...
I guess I'll have to switch to version 2.95.2 as suggested by the guide (I am currently using 3.3.5,)
I think you need more RAM. I had to buy a new computer to fix this problem. WORKAROUND: Reboot your computer and try again, in single user mode if necessary. Gcc is a badly written piece of software. What do you expect from a compiler that tries to do sophisticated optimisations .. written in C?? It uses HUGE amounts of memory, and some of the algorithms it uses are quadratic or worse. I regularly had to *hardware reset* my old 700MHz PIII to kill compiles. My new box has 1G Ram .. that seems to have fixed it .. but the C compiles are still VERY slow (Compared with Ocaml for example, which is at least 100 times faster). Just for example, most versions use a linked list for symbol lookup instead of a hashtable .. O(n) instead of O(1). It is woefully inadequate compiling large functions, which language translators sometimes generate. Most language translators would love to generate a single huge function, and compilation via C requires all sort of hacks to get around the fact that the most commonly used C compiler on Unix platforms, gcc, is incapable of handling it. There is an interesting paper by Fergus Henderson et al on the Felix website about the gcc specific hackery used to allow Mercury to work (Mercury is the premier logic programming language) .. Felix uses some of the techniques discussed: http://felix.sourceforge.net/papers/mercury_to_c.ps -- John Skaller <skaller at users dot sourceforge dot net> Download Felix: http://felix.sf.net

On 7/13/05, John Skaller
I guess I'll have to switch to version 2.95.2 as suggested by the guide (I am currently using 3.3.5,)
I think you need more RAM. I had to buy a new computer to fix this problem.
Oh my, that hurts...quite an expensive piece of software, GHC ;) But this really explains a lot, because two identical builds of mine happened to die on different files - it never occurred to me GCC could run low on memory though... How about more swap, provided I would let it run overnight?
Gcc is a badly written piece of software. What do you expect from a compiler that tries to do sophisticated optimisations .. written in C??
Ah, this sounds a bit more encouraging (really :) Wouldn't disabling GCC optimisations be an easier way then? Cheers, D. Tenev

On Wed, 2005-07-13 at 10:18 +0300, Dinko Tenev wrote:
On 7/13/05, John Skaller
wrote: I think you need more RAM. I had to buy a new computer to fix this problem.
Oh my, that hurts...quite an expensive piece of software, GHC ;) But this really explains a lot, because two identical builds of mine happened to die on different files - it never occurred to me GCC could run low on memory though...
Try running 'top' in one window whilst compiling ..:)
How about more swap, provided I would let it run overnight?
On my box, running RH9, I had a heap of swap .. that was part of the problem -- the thing went into a paging frenzy. I think that version of Linux had very bad code in it too: I had the same problem opening too many browser windows. If you do 'random access' on virtual memory, your box will be sure to die -- you're loading a whole page when all you may want is one word :) If you run in single user mode .. you might do better to turn the swap OFF :)
Gcc is a badly written piece of software. What do you expect from a compiler that tries to do sophisticated optimisations .. written in C??
Ah, this sounds a bit more encouraging (really :) Wouldn't disabling GCC optimisations be an easier way then?
I cannot say for GHC -- my compiler Felix relies on the C++ compiler to do some of the work. Using GHC with a native code compiler might avoid the problem (but I'm no expert on GHC ;) -- John Skaller <skaller at users dot sourceforge dot net> Download Felix: http://felix.sf.net

On Mon, Jul 11, 2005 at 09:17:50AM -0400, Dimitry Golubovsky wrote:
Is it possible to use Cabal with older versions (e. g. 6.0 to 6.2.2) of GHC?
Cabal works with 6.2 (I haven't tried 6.0, but that might work too). For all but the most complex packages, you need only a basic setup script bundled with a copy of the library. I've placed one at http://www.soi.city.ac.uk/~ross/cabal-setup-1.0.tar.gz That builds a program that can be used as a Cabal setup script for most packages, including Cabal itself.
participants (4)
-
Dimitry Golubovsky
-
Dinko Tenev
-
John Skaller
-
ross@soi.city.ac.uk