With the following patch applied to FriCAS trunk:
------------------<cut here>---------------------------
Index: src/interp/util.lisp
===================================================================
--- src/interp/util.lisp (revision 2024)
+++ src/interp/util.lisp (working copy)
@@ -392,6 +392,7 @@
(push (list 'defparameter el (symbol-value el))
initforms)))
(push `(interpsys-ecl-image-init ,spad) initforms)
+ (push `(fricas-restart) initforms)
(setf initforms (reverse initforms))
(push `progn initforms)
(setf FRICAS-LISP::*fricas-initial-lisp-forms* initforms)
@@ -421,7 +422,7 @@
spad)
(format *standard-output* "before fricas-restart~%")
(force-output *standard-output*)
- (fricas-restart))
+)
(defun interpsys-image-init (parse-files comp-files browse-files
asauto-files spad)
------------------------<cut here>------------------
I can use the following to produce fricas as shared library:
--------------<cut here>----------------------------
;;; load compiler
(defun foo () nil)
(compile 'foo)
(let ((*default-pathname-defaults*
#P"//sklad/hebisch/fricas/axp7/ax-build87/src/interp/"))
(load "../lisp/fricas-package.lisp")
)
(let ((*default-pathname-defaults*
#P"//sklad/hebisch/fricas/axp7/ax-build87/src/interp/"))
(load "../lisp/fricas-config.lisp")
(load "../lisp/fricas-lisp")
(load "../lisp/primitives.lisp")
(load "../lisp/fricas-ecl.lisp")
(load "makeint.lisp")
(let ((initforms (reverse FRICAS-LISP::*fricas-initial-lisp-forms*)))
(setf initforms (reverse (cdr initforms)))
(c:build-fasl "fricas_lib"
:lisp-files FRICAS-LISP::*fricas-initial-lisp-objects*
:ld-flags FRICAS-LISP::*fricas-extra-c-files*
:epilogue-code initforms)
)
)
--------------------<cut here>--------------------------
This needs to be run once after FriCAS build. It creates
"fricas_lib.fas" in the 'src/interp' subdirectory of FriCAS
build tree.
Note: the paths above are from my machine. Adjust to your
envirinment.
Once FriCAS shared library is created in ECL you can do:
(load "src/interp/fricas_lib.fas")
(in-package "BOOT")
(fricas-init)
and then use FriCAS functions. Presumably in Sage it will look
like:
ecl_eval("(load \"src/interp/fricas_lib.fas\")")
ecl_eval("(in-package \"BOOT\")")
ecl_eval("(fricas-init)")
At some moment you need to set AXIOM environment variable
to inform FriCAS where it can find other files it needs.
In Sage it is probably most convenient to do from Python
code.
--
Waldek Hebisch