[darcs-devel] Building darcs on Solaris 10 i386 experience

Marantz, Roy Roy.Marantz at deshaw.com
Mon Oct 22 02:02:42 UTC 2007


I just built darcs for Solaris 10 i386 because there were no prebuilt
packages.  I had
a bunch of trouble, most of which was due to my environment and
configure not being 
clear about what problems I was hitting.  I'll describe what I had to do
here so you
can fix or document things as you see appropriate.  BTW, I'm not a darcs
developer,
just someone who wants to (try) using it.  I'm a sys admin just
learning/playing with
haskell.  I'm hoping to convince my co-workers to try darcs instead of
cvs or svn.

1st my environment:
Host machine is a Sun v20 i386 machine running Solaris 10 11/06 plus
patches.
I was using the latest stable prebuilt ghc (6.6.1) tar ball from the ghc
website.
ghc is running from where it was extracted in a private directory (for
now).
I am using gcc version 3.4.5

Some comments:
I had to use gcc and gnu build tools.  IMO this should be documented.
Why? 1) ghc calls the gcc compile so that has to be in my path.
     2) only a GNUmakefile was generated by configure which needed gmake
to run
        If you don't think there are any gnu make dependencies, then use
Makefile
        or include a Makefile that runs $(MAKE) GNUmakefile to chain to
the correct file.

I needed to set the GHC  environment variable (as directed) even though
I had ghc in
my path.  This may be due to the way I hacked the ghc calling scripts in

ghc-6.6.1/bin/i386-unknown-Solaris.  I needed to hack the scripts so
they would
set LD_LIBRARY_PATH to find a private copy of libncurses since Solaris
doesn't have
libncurses by default.  (but that is another story)

I had to set 
CFLAGS=-I/usr/local/include and
LDFLAGS='-L/usr/local/lib -R/usr/local/lib -L/usr/local/gnu/lib
-R/usr/local/gnu/lib'
because of where non-Solaris libraries were installed on my system.

I had to set LD_LIBRARY_PATH=/usr/local/gnu/lib so compiled ghc programs
will find
libgmp.  I could have looked for a environment variable that ghc would
use to link
with the above LDFLAGS, but I didn't want to spend the time.

I could NOT use --with-static-libraries since that applied to all
libraries
(libz, ...) not just ghc related libraries.  This may be a Solaris thing
or maybe
the files I have for some libraries.

On hindsight I probably should have 1st rebuilt the ghc compiler to know
about
my system.  It just seemed easier to tackle 1st darcs since it has less
dependencies.

The above setup was needed in order for configure to run successfully.
When I ran
gnu make on the results, it mostly worked except I had to manually run
the ghc
compilation of the following .c files since make was calling ghc with
-optc-DPACKAGE_STRING=\"darcs\ -optc1.0.9\"  switch which caused
   gcc: 1.0.9": No such file or directory
when they were run.  I just cut and pasted the whole command line and
removed the
-optc1.0.9 string from it.  Here is the list of the files that I did
this on
   c_compat.c
   maybe_relink.c
   atomic_create.c
   fpstring.c
   umask.c
   rts.c

After all that I ran make test which failed 1 test
   Failed Test Stat Wstat Total Fail  Failed  List of Failed
 
------------------------------------------------------------------------
-------
   rmdir.pl       1   256    34    1   2.94%  14
    (1 subtest UNEXPECTEDLY SUCCEEDED).
   Failed 1/34 test scripts, 97.06% okay. 1/1475 subtests failed, 99.93%
okay.

Although the resulting binary seems to run fine.  I haven't been able to
find out
how serious that unexpected succeeded failure is, can you tell me?

Roy


More information about the darcs-devel mailing list