axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] Using a shared lib in Axiom


From: Gernot Hueber
Subject: [Axiom-developer] Using a shared lib in Axiom
Date: Fri, 04 Aug 2006 15:39:23 +0200

Hi,

see below for results. elf-test and the loader-stuff is based on
gcl-elf-loader (http://www.copyleft.de/Lisp).
System is FreeBSD 5.4, Axiom--main--1-patch-49 and Aldor 1.0.3


Howto:

Maybe not all of my changes are really necessary.
(I use a gcl compiled with dlopen enabled)

1) Generate a gclelf (Makefile of gcl-elf-loader)
Minor changes to the elf-loader.lsp file, due to that defCfun causes a
compile error:

[...]
(defentry cast-obj2int (object) (int cast_obj2int))
;;(defCfun "int cast_obj2int(s) object s;" 0
;;  " return( (int) s->st.st_self);" )
(clines "int cast_obj2int(s) object s; { object *vs=vs_top; object
*old_top=vs_top+0; { return( (int) s->st.st_self); } vs_top=vs; } ")
[...]


2) Adapt lsp/Makefile to build obj/${syslisp}/bin/lisp from gclelf
e.g. for gcl-system:

[...]
        echo '(compiler::link
'"'"'("/home/hueber/src/test/elf-loader.o") "${OUT}/lisp" (format nil
"(progn (let ((*load-path* (cons ~S *load-path*))(si::*load-types* ~S))
(compiler::emit-fn t))(when (fboundp (quote si::sgc-on)) (si::sgc-on
t))(setq compiler::*default-system-p* t))" si::*system-directory* (quote
(list
".lsp"))) "${OBJ}/${SYS}/lib/cfuns-c.o ${OBJ}/${SYS}/lib/sockio-c.o
${OBJ}/${SYS}/lib/libspad.a -lc")' | /home/hueber/src/test/gclelf
        ln -fs /usr/local/lib/gcl-2.6.7/h ${MNT}/${SYS}/
[...]

3) use the generation of interpsys proposed by Camm
(http://www.mail-archive.com/address@hidden/msg00576.html)

[...]
        @ (cd ${OBJ}/${SYS}/bin ; \
          echo '#+native-reloc(progn (gbc t) (setq x
si::*system-directory*)(load "${OUT}/makeint.lisp") (setq
si::*system-directory* x) (unintern (quote x))(gbc t)(user::spad-save
"${SAVESYS}"))#-native-reloc(progn \
                        (setq si::*collect-binary-modules* t)\
                        (setq x si::*system-directory*)\
                        (load "${OUT}/makeint.lisp")\
                        (setq si::*system-directory* x)\
                        (unintern (quote x))\
                        (compiler::link \
                                (remove-duplicates
si::*binary-modules* :test (quote equal))\
                                "$(SAVESYS)" \
                                (format nil "\
                                        (let ((si::*load-path* (cons ~S
si::*load-path*))\
                                              (si::*load-types* ~S))\
                                                (compiler::emit-fn t))\
                                         (setq
si::*collect-binary-modules* t)\
                                  (setq x si::*system-directory*)\
                                         (load \"$(OUT)/makeint.lisp\")\
                                         (setq si::*system-directory*
x)\
                                         (unintern (quote x))\
                                         (when si::*binary-modules* \
                                                (error
si::*binary-modules*))\
                                        (setq
si::collect-binary-modules* nil si::*binary-modules* nil)\
                                        (gbc t)\
                                        (when (fboundp (quote
si::sgc-on)) (si::sgc-on t))\
                                        (setq
compiler::*default-system-p* t)\
                                " si::*system-directory* (quote (list
".lsp")))\                        "$(OBJ)/$(SYS)/lib/sockio-c.o
$(OBJ)/$(SYS)/lib/cfuns-c.o $(OBJ)/$(SYS)/lib/libspad.a" \
                               nil))' | $(LISPSYS))
[...]






hawkings# /home/hueber/src/axiom--main--1--patch-49/mnt/freebsd/bin/AXIOMsys
GCL (GNU Common Lisp)  2.6.7 CLtL1    Aug  3 2006 20:14:50
Source License: LGPL(gcl,gmp), GPL(unexec,bfd)
Binary License:  GPL due to GPL'ed components: (READLINE 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.
                        AXIOM Computer Algebra System
                         Version: Axiom (April 2006)
                Timestamp: Friday August 4, 2006 at 10:07:45
-----------------------------------------------------------------------------
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave AXIOM and return to shell.
-----------------------------------------------------------------------------

   Re-reading compress.daase   Re-reading interp.daase
   Re-reading operation.daase
   Re-reading category.daase
   Re-reading browse.daase
(1) -> )lisp (dyn-cos 1.1)

   >> System error:
   The function DYN-COS is undefined.

(1) -> )lisp (load "elf-test3")
[unknown global sym call_d1d]
Value = 936
(1) -> )lisp (dyn-cos 1.1)

Value = 0.45359612142557731
(1) ->
[...]
(2) -> DYN_-COS(1.0::DoubleFloat)$Lisp

   (2)  0.54030230586813977
                                                            Type:
SExpression
(3) -> DYN_-COS(1.1::DoubleFloat)$Lisp

   (3)  0.45359612142557748
                                                            Type:
SExpression
(4) ->

-- 
DI Gernot Hueber
Institut für Integrierte Schaltungen
Altenbergerstr. 69
4040 Linz
Tel +43 732 2468 7120
Fax +43 732 2468 7126
Email address@hidden
Web   www.riic.at





reply via email to

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