axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] Re: debugging


From: Camm Maguire
Subject: Re: [Axiom-developer] Re: debugging
Date: 18 Jul 2007 11:55:24 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  

OK the issue is that you are setting the compiler::fixed-args property
-- a legacy function signature facility which may have even been
implemented to support axiom for all that I know.  The short fix is to
stop setting this property and let GCL figure out the signature on its
own.

In more detail, this flag was intended to allow the user to assert a
signature of the form '((t t t) t).  A better way follows acl2,
(declaim (ftype (function (t t t) t) foo)), which is supported by the
ansi standard and is compatible with the new automatic function
signature discovery mechanism.  But either signature would be wrong
here as the functions in question return double float.  These cannot
be supported via the fastlink mechanism as the return type does not
portably fit in one machine word.  GCL compiles such (at safety <=2)
as a local C function returning double, and a global wrapper boxing
the double into a lisp object.  GCL is incorrectly relying on
'fixed-args to determine that a wrapper is not necessary.

If 'fixed-args is to be kept, I need to make it compatible with the
automatic function signature discovery, but the simplest for me would
be to ignore the property, depending on axiom's needs.  It seems
redundant with declaim anyway.  Thoughts welcome.

Take care,

Waldek Hebisch <address@hidden> writes:

> Camm Maguire wrote:
> > Greetings, and thanks!  The problem is that the global entries to the
> > functions returning double float etc. are not being writtin into
> > DFLOAT.c.  I'm trying to debug by reproducing the compile-file step on
> > DFLOAT.lsp.  This fails at the lisp prompt:
> > 
> > (compile-file "DFLOAT.NRLIB/DFLOAT.lsp")
> > 
> > ; (DEFUN |DFLOAT;manexp| ...) is being compiled.
> > ;;; The tag #:G2017215 is undefined.
> > ; (DEFUN |DFLOAT;rationalApproximation;$2NniF;84| ...) is being compiled.
> > ;;; The tag #:G2017237 is undefined.
> > ;;; The tag G190 is undefined.
> > ; (DEFUN |DFLOAT;**;$F$;85| ...) is being compiled.
> > ;;; The tag #:G2017246 is undefined.
> > ;;; The tag #:G2017246 is undefined.
> > No FASL generated.
> > 
> > Error: 
> > Fast links are on: do (si::use-fast-links nil) for debugging
> > Signalled by BREAK.
> > Condition in BREAK [or a callee]: INTERNAL-SIMPLE-PROGRAM-ERROR: 
> > Compilation of "DFLOAT.NRLIB/DFLOAT.lsp" failed.
> > 
> > Broken at BREAK.  Type :H for Help.
> >  1 Retry compiling file "DFLOAT.NRLIB/DFLOAT.lsp".
> >  2 Retry compiling file "DFLOAT.NRLIB/DFLOAT.lsp".
> >  3 (Abort) Return to debug level 2.
> >  4 (Continue) Return from break.
> >  5 Return to top level.
> > COMPILER>>
> >
> > Then I try )co "DFLOAT.spad" from the axiom prompt:
> > 
> > )co "DFLOAT.spad"
> >    Your command is ambiguous. The following are abbreviated by co :
> >       compiler 
> >       copyright 
> > (1) -> )quit
> >    Please enter y or yes if you really want to leave the interactive 
> >       environment and return to the operating system:
> > y
> >    You have chosen to remain in the AXIOM interactive environment.
> > (1) -> 
> > (1) -> 
> > Program exited normally.
> > 
> > So I try a fresh interpsys, set the stage 1 bootstrap mode flag, And
> > find a very long chain of compiles which must proceed before I can
> > compile DFLOAT.  
> > 
> > I'm sure I'm just making some simple mistake, but how can one rebuild
> > just DFLOAT from any given stage in the build?  This will enable me to
> > fix this.
> >
> 
> All Axiom generated Lisp file use special macros, present in interpsys.
> Theoretically all macros are also present in depsys image, but I did
> not check if depsys works for Lisp compilation of algebra files.
> Error messages from Lisp compilation probably can be explained by lack
> of macros.  But behavoir of ')co' (and also ')quit') command looks
> strange -- I prefer to always use full version ')compile', but for
> me ')co' starts compilation.  Also the
> 
> "You have chosen to remain in the AXIOM interactive environment."
> 
> message looks like a bug.
> 
> Spad compilation is slightly more tricky: given spad file may require
> that several other files are compiled earlier.  When Spad compiler
> operates in default mode there are cyclic dependencies.  Basically the
> whole bootstrap procedure is to fight with those cyclic dependencies.
> Stage 1 of bootstrap must go in a rather rigid order.  After stage 1 of
> bootstrap it should be possible to compile all Spad files using special
> |$bootstrapDomains| flag.  Once Stage 2 is finished it should be
> possible to compile all normal mode.  
> 
> If you want to compile a single file after stage 1 finished do the following.
> 
> 1) start interpsys, you need to correctly set up AXIOM and DAASE variables,
>    for me the it is below:
> 
> ( export AXIOM=/h/axp62/ax-build2/target/x86_64-unknown-linux; export 
> DAASE=/h/axp62/wh-sandbox/src/share; 
> /h/axp62/ax-build2/build/x86_64-unknown-linux/bin/interpsys )
> 
> 2) for stage 2 compilation set the |$bootstrapDomains| flag:
> 
> )lisp (setf |$bootstrapDomains| t)
> 
> Value = T
> 
> 3) issue compilation command:
> 
> (2) -> )compile "DFLOAT.spad"
> 
> 
> If you want you can also do Lisp compilation:
> 
> (1) -> )lisp (compile-file "DFLOAT.NRLIB/DFLOAT.lsp")
> 
> Value = #P"/h/axp62/ax-build2/src/algebra/DFLOAT.NRLIB/DFLOAT.o"
> (1) ->
> 
> Trying the above I noticed that doing by hand stage 2 compilation of
> "DFLOAT.spad" I can also do stage 3 compilation of "DFLOAT.spad".
> So the problem seem to appear only if I do all compilations in a
> single image...
> 
> Normally Lisp files from stage 2 compilation are deleted before
> starting stage 3 compilation.  I changed the Makefile to capture
> the result from stage 2 compilation.  Comparing with the Lisp file
> obtained separately I see some differences, but none which can explain
> different behavior of object code.
> 
> -- 
>                               Waldek Hebisch
> address@hidden 
> 
> 
> 

-- 
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]