Gasgow Haskell compiler

General talk about packaging procedures and packages.
User avatar
mimosa
Salix Warrior
Posts: 3089
Joined: 25. May 2010, 17:02
Contact:

Re: Gasgow Haskell compiler

Post by mimosa » 27. Oct 2012, 11:48

Here is config.log:

http://pastebin.com/qaJSAYJR

EDIT Seems to be building ok for 32 bits.

User avatar
mimosa
Salix Warrior
Posts: 3089
Joined: 25. May 2010, 17:02
Contact:

Re: Gasgow Haskell compiler

Post by mimosa » 29. Oct 2012, 01:00

I think I have solved this by passing --build=$arch to ./configure.

It may take me a couple of days to tidy up the package and build and upload (apart from anything else, there's a similar problem with libffi). Please let me know if time is running short; I'd hate to miss the deadline for 14.0 now.

Code: Select all

./configure --build=${CHOST} \
    --prefix=/usr --infodir=/usr/share/info \
    --enable-cxx
That is the section of the Arch PKGBUILD that inspired me.

Is there any reason for or against enabling C++ support?

Incidentally, I tested the latest version of ghc (7.6.x), and neither xmonad nor haskell-platform work with it. This 7.4.x looks to be a good recent-stable choice. (Oddly enough, ghc 7.6.x *still* reguires the old libgmp, but it does use the latest libffi.)

User avatar
mimosa
Salix Warrior
Posts: 3089
Joined: 25. May 2010, 17:02
Contact:

Re: Gasgow Haskell compiler

Post by mimosa » 30. Oct 2012, 23:36

The trouble is the pesky library won't build for 32 bits like that. I am struggling to write the SLKBUILD so it works. I am reduced to something like this:

Code: Select all

[ "${arch}" = "i486" ] && export ABI="32" &&  ./configure# --build=$arch 
[ "${arch}" = "x86_64" ] &&   ./configure --build=$arch 
[ "${arch}" = "ARM" ] && echo "You're ******"
Would that pass muster?

I should say that the GHC bugtracker's response to this problem was, "A symlink generally works OK for me."

User avatar
gapan
Salix Wizard
Posts: 5498
Joined: 6. Jun 2009, 17:40

Re: Gasgow Haskell compiler

Post by gapan » 31. Oct 2012, 07:26

I think it would be better like:

Code: Select all

case "$arch" in
  i?86) run 32bit stuff here
  x86_64) run 64bit stuff here
  *) echo "You're ******"
esac
Image
Image

User avatar
mimosa
Salix Warrior
Posts: 3089
Joined: 25. May 2010, 17:02
Contact:

Re: Gasgow Haskell compiler

Post by mimosa » 31. Oct 2012, 10:56

Thanks gapan; so the general principle is OK. I know even less bash than Python, not much beyond the level of copying snippets of code.

This package is becoming quite frustrating - I can no longer get gmp to build for 64 bits, and some tiresome trial and error last night left me wondering whether I ever had (perhaps the apparent success was actually attributable to something I'd left lying around in the build environment by mistake).

The people at libffi (same trouble, different library) were as horrified at what they called my "magic library" approach to the problem as people more generally are by using symlinks to get round it; and I've discovered that some distros (such as SUSE) patch the Haskell compiler to use system libraries. That's beyond my current skills, but perhaps for Salix 15.0 ...

Are the build scripts for Slackware packages (such as gmp) available somewhere? I looked, and it seems not.

EDIT I can't get it to work this morning, either. I've been trying various versions of libgmp and though the most recent compile fine, they don't produce the all-important libgmp.so.3 file.
Is it possible the problem lies with the new kernel, that is, it just won't build with a 3.x kernel?

Assuming I can't get it to work, could using the symlink be reconsidered? As I said above, that's the offciial advice from the Haskell bugtracker :mrgreen:

User avatar
gapan
Salix Wizard
Posts: 5498
Joined: 6. Jun 2009, 17:40

Re: Gasgow Haskell compiler

Post by gapan » 31. Oct 2012, 20:53

If the symlink is only needed for building the package, make a note in the comments at the top of the SLKBUILD file about it, create the symlink (not in the SLKBUILD), build the package and remove the symlink from your system.
Image
Image

User avatar
mimosa
Salix Warrior
Posts: 3089
Joined: 25. May 2010, 17:02
Contact:

Re: Gasgow Haskell compiler

Post by mimosa » 31. Oct 2012, 20:58

:D

User avatar
mimosa
Salix Warrior
Posts: 3089
Joined: 25. May 2010, 17:02
Contact:

Re: Gasgow Haskell compiler

Post by mimosa » 3. Nov 2012, 20:31

I'm delighted to report that everything now works!

gmp builds for both architectures; I found the Slackware SlackBuild (written by Alien Bob) and added one or two switches to configure.

It turns out that (not surprisingly) libgmp and libffi are not just build deps. (Well, I suppose it would be possible for the compiler to notice system libraries *after* it was built.) Indeed ghc works for simple interaction but when I tried to install xmonad and its dependencies from src, and run xmonad, there were complaints.

The ideal solution would be to patch the source to use system libraries, and maybe by the time 15.0 comes round, I wil lhave got out of my armchair and actually learned Haskell. For now though, that was beyond me.

SUSE patched ghc for the libffi problem, but not gmp. Or the other way round.

User avatar
SoleSoul
Posts: 49
Joined: 2. Oct 2009, 01:53
Location: Israel

Re: Gasgow Haskell compiler

Post by SoleSoul » 4. Nov 2012, 09:51

Just a little comment, the Haskell Platform is not a sort of IDE, but a sort of software distribution. Since there are many Haskell libraries and application which depend on each other it's quite hard to match the versions of them all when installing them. What the Haskell people did was to do this version matching themselves and ship a working collection of mathcing versions libraries and applications, which is called the Haskell Platform.

User avatar
mimosa
Salix Warrior
Posts: 3089
Joined: 25. May 2010, 17:02
Contact:

Re: Gasgow Haskell compiler

Post by mimosa » 4. Nov 2012, 10:24

Thanks for explaining that. It also makes clear why an older ghc is needed for it.

No doubt all will become clearer once I actually get out of my armchair and start learning the language!

My packages are here:

http://people.salixos.org/mimosa/packag ... 6-1tjb.txz
http://people.salixos.org/mimosa/packag ... 4-1tjb.txz

If you do try them out, please let me know of any problems :)

Post Reply