gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: GCL 2.6.7 on a Mac


From: Camm Maguire
Subject: [Gcl-devel] Re: GCL 2.6.7 on a Mac
Date: Wed, 14 Dec 2005 20:48:31 -0500
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigory ōmae) APEL/10.3 Emacs/21.2 (i386-debian-linux-gnu) MULE/5.0 (SAKAKI)

Greetings!  And thank you for this!

My currently preferred solution for macosx is to use version 2.6.8pre
from cvs.  I know this sounds unstable, but this is merely a minor
bugfix branch against 2.6.7 (i.e. not the far more significantly
modified 2.7.0) and should be released shortly pending testing.  This
branch includes the fix for your tiny3.lisp example below, the fix to
plt and a few other files Robert mentions in his notes, and an upgrade
of Aurelien's macosx binutils support to the latest binutils version.
We've been caught by a macosx version change -- all works now on the
latest macosx, but for now we have no testbed for the older system.

As for fink, this is a good point which warrants discussion.  I
thought it was virtually standard.  If not, I think we should make GCL
not depend on gettext if possible.  In either case, whatever
environment variables we decide are needed to build gcl on the mac
should be pushed to the various command lines via configure.

For example, I use at present

export PATH=/sw/bin:/sw/sbin:/usr/local/bin:$PATH # I don't think these are 
actually
export LIBRARY_PATH=/sw/lib
export C_INCLUDE_PATH=/sw/include
export CPPFLAGS="-no-cpp-precomp"

The first three are likely only needed for gettext.  The last was
needed to handle at least earlier versions of the apple gcc -- is this
still required?  Well, I just tried it and apparently it is not
required any longer on the latest macosx, but a proper treatment would
conditionalize it on the older apple gcc being present.

So I guess my recommendation boils down to this, which might be
simplified further before 2.6.8 is released:

With fink:
export PATH=/sw/bin:/sw/sbin:/usr/local/bin:$PATH # I don't think these are 
actually
export LIBRARY_PATH=/sw/lib
export C_INCLUDE_PATH=/sw/include
export CVSROOT=:pserver:address@hidden:/sources/gcl
cvs -z9 -q co -d gcl-2.6.8pre -r Version_2_6_8pre
cd gcl-2.6.8pre && ./configure && make

Without fink:
<robert's gettext instructions>
<robert's h/powerpc-macosx.defs patch>
export CVSROOT=:pserver:address@hidden:/sources/gcl
cvs -z9 -q co -d gcl-2.6.8pre -r Version_2_6_8pre
cd gcl-2.6.8pre && ./configure && make


Thoughts/suggestions most welcome.  Aurelien -- any ideas you have on
robustifying this before 2.6.8 is released are especially appreciated.

Take care,




Matt Kaufmann <address@hidden> writes:

> Howdy!
> 
> This email is in two parts.  For one, I thought I'd report that I have
> successfully followed instructions supplied by Robert Krug in order to build
> GCL 2.6.7 on a Mac (OS X) -- in my case, a 1.67GHz PowerPC G4 notebook.  In
> case you're interested, below are his notes, which I plan to put up on the web
> in a couple of days.  Do you imagine an update to GCL 2.6.7 soon that makes 
> the
> extra edits unnecessary?
> 
> Underneath Robert's notes, I have placed a file tiny3.lisp that I derived from
> a failed certification using an ACL2 (development version as of 10/23) built 
> on
> that GCL on that Mac (books/workshops/1999/simulator/tiny.lisp).  I've done
> LOTS of trimming of tiny.lisp to create tiny3.lisp, which causes the error in
> GCL (i.e., without ACL2).  (The good news is that this seems to be the only
> problem with the full regression suite.)  Here is a log showing the error:
> 
> ======================================================================
> 
> matt-kaufmanns-powerbook-g4-15:~/acl2/current/books/workshops/1999/simulator 
> kaufmann$ gcl
> GCL (GNU Common Lisp)  2.6.7 CLtL1    Dec 12 2005 12:23:55
> Source License: LGPL(gcl,gmp), GPL(unexec,bfd)
> Binary License:  GPL due to GPL'ed components: (READLINE BFD UNEXEC)
> Modifications of this banner must retain notice of a compatible license
> Dedicated to the memory of W. Schelter
> 
> Use (help) to get some basic information on how to use GCL.
> 
> >(compile-file "tiny3.lisp")
> 
> Compiling tiny3.lisp.
> End of Pass 1.  
> End of Pass 2.  
> OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
> Finished compiling tiny3.lisp.
> #p"tiny3.o"
> 
> >(load "tiny3.o")
> 
> Loading tiny3.o
> error: unknown relocation entry
> 
> Error: Cannot get relocated section contents
> 
> Fast links are on: do (si::use-fast-links nil) for debugging
> Error signalled by EVAL.
> Broken at LOAD.  Type :H for Help.
> >>
> 
> ========================= Robert's notes =========================
> 
> The normal build process for GCL 2.6.7 on Mac OS X assumes that
> you have installed Fink on your Mac.  (If you do not know what
> this is, don't worry; you probably don't have it or want it.)
> Here is the process which worked on my Mac.
> 
> Building Gcl 2.6.7 On Os X 10.4.3 Without Fink
> 
> 1. First, get and install the gettext library.
>    You can get it at:
>    ftp.gnu.org/gnu/<Latest Version>
>    As of this writing, 0.14 was the latest version.
>    If you download a newer version you will need to adjust
>    the tar command below to refer to the file you downloaded.
> 
>    To Build It:
>    A. Untar it in a convenient location:   
>       tar zxf gettext-0.14.tar.gz
>       (If you downloaded this from within a web browser,
>        you may have to use
>        tar xf Gettext-0.14.Tar
>        instead.)
>    B. Connect to the gettext directory and configure:
>       cd gettext-0.14
>       ./configure --disable-csharp
>    C. Build and install the library:
>       make
>       sudo make install
> 
> 2. Build And Install Gcl.  (First, obtain from ftp://ftp.gnu/org/, cd gnu, cd 
> gcl,
>    get gcl-2.6.7.tar.gz, tar xfz gcl-2.6.7.tar.gz)
> 
>    A. cd <Gcl Directory>
> 
>    B. You Now Need To Patch Several Files:
>       h/powerpc-macosx.h
>       Replace the line:
>       extern char *my_sbrk(int incr);
>       with:
>       void *my_sbrk(int incr);
> 
>       o/unexmacosx.c
>       Replace the line:
>       char *my_sbrk (int incr)
>       with:
>       void *my_sbrk (int incr)
> 
>       h/powerpc-macosx.defs
>       Replace the line:
>       LIBS := `echo $(LIBS) | sed -e 's/-lncurses/ /'` /sw/lib/libintl.dylib
>       With:
>       LIBS := `echo $(LIBS) | sed -e 's/-lncurses/ /'` 
> /usr/local/lib/libintl.dylib
> 
>    C. Configure and start to build gcl
>       ./configure
>       make
> 
>       This Make Will Fail, But Do Not Fear!
> 
>    D.  Patch o/plt.h
>        Remove the underscores in front of
>        _getc and _putc
>  
>    E. Build and install gcl
>       make
>       sudo make install
> 
> ============================ file tiny3.lisp ============================
> 
> (in-package "USER")
> 
> (defvar *user-stobj-alist*)
> 
> (DEFUN PROGC (ST)
>   (THE (UNSIGNED-BYTE 10)
>     (AREF (THE (SIMPLE-ARRAY (UNSIGNED-BYTE 10) (1)) (SVREF ST 0)) 0)))
> (DEFUN UPDATE-PROGC (V ST)
>   (DECLARE (TYPE (UNSIGNED-BYTE 10) V))
>   (PROGN
>     (SETF (AREF (THE (SIMPLE-ARRAY (UNSIGNED-BYTE 10) (1))
>                 (SVREF ST 0))
>               0)
>         (THE (UNSIGNED-BYTE 10) V))
>     ST))
> (DEFUN MEMI (I ST)
>   (DECLARE (TYPE (INTEGER 0 268435455) I))
>   (THE (SIGNED-BYTE 32)
>     (AREF (THE (SIMPLE-ARRAY (SIGNED-BYTE 32) (*)) (SVREF ST 1))
>         (THE (INTEGER 0 268435455) I))))
> (DEFUN UPDATE-MEMI (I V ST)
>   (DECLARE (TYPE (INTEGER 0 268435455) I) (TYPE (SIGNED-BYTE 32) V))
>   (PROGN
>     (SETF (AREF (THE (SIMPLE-ARRAY (SIGNED-BYTE 32) (*))
>                 (SVREF ST 1))
>               (THE (INTEGER 0 268435455) I))
>         (THE (SIGNED-BYTE 32) V))
>     ST))
> (DEFUN DTOS (ST)
>   (THE (UNSIGNED-BYTE 10)
>     (AREF (THE (SIMPLE-ARRAY (UNSIGNED-BYTE 10) (1)) (SVREF ST 2)) 0)))
> (DEFUN UPDATE-DTOS (V ST)
>   (DECLARE (TYPE (UNSIGNED-BYTE 10) V))
>   (PROGN
>     (SETF (AREF (THE (SIMPLE-ARRAY (UNSIGNED-BYTE 10) (1))
>                 (SVREF ST 2))
>               0)
>         (THE (UNSIGNED-BYTE 10) V))
>     ST))
> (DEFUN CTOS (ST)
>   (THE (UNSIGNED-BYTE 10)
>     (AREF (THE (SIMPLE-ARRAY (UNSIGNED-BYTE 10) (1)) (SVREF ST 3)) 0)))
> (DEFUN UPDATE-CTOS (V ST)
>   (DECLARE (TYPE (UNSIGNED-BYTE 10) V))
>   (PROGN
>     (SETF (AREF (THE (SIMPLE-ARRAY (UNSIGNED-BYTE 10) (1))
>                 (SVREF ST 3))
>               0)
>         (THE (UNSIGNED-BYTE 10) V))
>     ST))
> 
> (defmacro Int32 (x) `(the   (signed-byte 32) ,x))
> (defmacro Nat10 (x) `(the (unsigned-byte 10) ,x))
> (defmacro MAX_NAT<10>   ()  1023)
> 
> (defmacro fix|10| (x)
>   `(Nat10 (logand (MAX_NAT<10>) ,x)))
> 
> (defmacro +<32> (x y)
>   `(Int32 (+ ,x ,y)))
> 
> (defmacro +|10| (x y)
>   `(Nat10 (logand (+<32> ,x ,y) (MAX_NAT<10>))))
> 
> (defun pushus (val st)
>   (declare (type (signed-byte 32) val))
>   (let ((dtos (dtos st)))
>     (declare (type (unsigned-byte 10) dtos))
>     (let ((st (update-memi dtos (Int32 val) st)))
>       (update-dtos (+|10| dtos -1) st))))
> 
> (defun next (st)
>   (let ((progc (progc st))
>       (dtos  (dtos st))
>       (ctos  (ctos st)))
>     (declare (type (unsigned-byte 10) progc dtos ctos))
> 
>     (let ((ins (memi progc st)))
>       (declare (type (signed-byte 32) ins))
> 
>       (case ins
> 
>       (2 (let ((st (update-progc (+|10| progc 2) st)))
>           (pushus (memi (+|10| progc 1) st) st)))
> 
>       (4 (update-progc (fix|10| (memi (+|10| progc 1) st)) st))
> 
>       (5 (let ((nprogc (if (= (memi (+|10| dtos 1) st) 0)
>                            (fix|10| (memi (+|10| progc 1) st))
>                          (+|10| progc 2))))
>            (declare (type (unsigned-byte 10) nprogc))
>            (let ((st (update-progc nprogc st)))
>              (update-dtos (+|10| dtos 1) st))))
> 
>       (7 (let ((nadd (fix|10| (memi (+|10| ctos 1) st))))
>            (declare (type (unsigned-byte 10) nadd))
>            (let ((st (update-progc nadd st)))
>             (update-ctos (+|10| ctos 1) st))))
> 
>       (9 (let ((st (update-progc (+|10| progc 1) st)))
>           (pushus (memi (+|10| dtos 1) st) st)))
> 
>       (otherwise st)))))
> 
> ======================================================================
> 
> Thanks --
> -- Matt
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah






reply via email to

[Prev in Thread] Current Thread [Next in Thread]