axiom-developer
[Top][All Lists]
Advanced

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

RE: [Axiom-developer] Aldor compilation for Axiom


From: Bill Page
Subject: RE: [Axiom-developer] Aldor compilation for Axiom
Date: Sun, 5 Nov 2006 21:37:10 -0500

On November 5, 2006 7:31 PM Ralf Hemmecke wrote:
> 
> could someone tell me what ")compile blah.as" is actually 
> doing in Axiom?
> 
> It is certainly more than saying
> 
> aldor -O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y 
> $AXIOM/algebra blah.as
> 
> (without having an Axiom session running).
> 
> I think someone once said that )compile calls aldor with the 
> above flags and then also generates object files from the .lsp
> files.

Yes.

> How could I achieve that from outside Axiom?

Do you mean generate stand alone object files from .lsp files? This
would be done with a Lisp compiler, of course. In principle you can
use GCL just like Axiom does, but you must also provide a Lisp
run-time. The Aldor distribution has such a lisp run-time that is
supposed to be equivalent to the Aldor C run-time environment, but
my initial attempts to use it with GCL ran into trouble - maybe
some GCL incompatibility with the lisp run-time source?

If you want to generate object files that can later be loaded into
Axiom, I am not sure that it is possible to do this outside of Axiom
because I suspect there symbols that are known only to Axiom. If you
discover a way, I would be quite interested. Remember that because
it is written in Lisp AXIOM really just GCL + a lot of extra Lisp code.
So internally in AXIOM, compiling Lisp to object code is done by the
same underlying GCL mechanisms.

> Or is it enough to provide the .lsp files and the compilation to
> object files is triggered when the code is first used?
> 

No. You must compile the .lsp files inside Axiom.

Ralf, do you know section 18.12 : Using Aldor outside AXIOM for AXIOM
of the Aldor User's Guide?

http://www.aldor.org/docs/HTML/chap18.html#12

"When you are ready to test and use your code within AXIOM, start
up AXIOM and then )cd to the directory containing your compiled code.
Invoke )compile on each .lsp file you wish to use."

See also section 18.11.

> Further, I actually have a whole library (several .as files). 
> What would be the right procedure to compile them externally
> (I want to do that via Makefiles) and then provide some nice
> mechanism to load the compiled library into Axiom.
> 

Why compile "externally"? Why not just use Axiom in your Makefile,
the way it is currently done in the Axiom build. E.g.

myfile.NRLIB/code.o: myfile.as
        echo ')compile myfile.as' | AXIOMsys

You can use the ')dir' option of the ')library' command to load
all the object files in a given subdirectory

)library )dir mylib

See section 16.4 of the Axiom book:

http://wiki.axiom-developer.org/public/book2.pdf

> I just need a rough overview.
> 

I hope these comments are some some use.

Regards,
Bill Page.






reply via email to

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