axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] Re: How do I apply a patch?


From: Waldek Hebisch
Subject: Re: [Axiom-developer] Re: How do I apply a patch?
Date: Sat, 28 Jul 2007 01:12:59 +0200 (CEST)

On 7/28/07, Alasdair McAndrew <address@hidden> wrote:
> On 7/28/07, Alasdair McAndrew <address@hidden> wrote:
> > Sorry if this has been covered before... I'm using the axiom linux
> > binary - how do I apply a patch, or add a patch of my own?  Is it just
> > a matter of changing the .spad file in
> >
> > /usr/local/axiom/mnt/linux/src/algebra
> >
> > or do I need to do some sort of recompiling?  If this is a dumb
> > question, I humbly apologize, but I still don't know how to do it...

> Sorry, I should have been more specific: all I want to do at the
> moment is add the single function definition
> 
> x mod y == integer MOD(x,y)$Lisp
> 
> to si.spad (or possible integer.spad).  How do I do that?
> 

First: spad files are compiled so you need to recompile.  I you use
patch prepared by some other person the simplest way (but using a
lot of computer time) is to apply the patch to source tree and
rebuild from scratch.  The next posibility is to run make, but
that assumes that you have build Axiom from sources and keep the
build directory.  Also, running make sometimes recompiles too
little so you may get errors that are not present in a full
build.  You may also recompile by hand only thing that needs
recompilation, but finding what to recompile and the commands to
do this may be tricky.

Coming to your specific question:  you hit one of serious problems
with current Axiom.  What you you want to do should be very
easy, but currently is quite hard (at least if you try to this
directly).  The problem is that to _use_ your new function you
must to add declaration to some category or domain, say to Integer
domain.  However, this changes type of Integer.  To make sure
that Axiom sees consistent types you need to recompile parts
of algebra which depends on Integer.  Unfortunatly, almost all of
Axiom algebra depends on Integer -- in most cases this dependence
is trival, but you may get pretty weird errors if you do
not recompile other parts.  Moreover, Axiom stores type information
in *.daase files, so after re-compiling algebra files you need to 
re-generate the *.daase files.  Let me say that the whole process
is tricky and there is no satiscatory description.  You can look
into MonoidWithZero tread for more details.

In your case much simpler approach is to add mod operation separately.
Create .spad file and define inside a package which contains your
function.  If you compile the package you will be able to use
the function in the same Axiom session.  If you just compile the
package Axiom will forget about the definition when you quit
current session -- you can use )lib command to load compiled
file in new session.  Alternatively, you can re-generate Axiom
databases so that Axiom will remember your package.

-- 
                              Waldek Hebisch
address@hidden 




reply via email to

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