It is possible to use the Aldor compiler WebSite:www.aldor.org to compile functions which you then can use from FriCAS. Currently the following commands work and install Aldor in '/opt/aldor': git clone https://github.com/aldorlang/aldor cd aldor/aldor ./configure --disable-maintainer-mode --prefix=/opt/aldor make > mlogg 2>&1 make install Note: Newest Aldor is available only from Git repository. The The FriCAS/Aldor interface is part of the current FriCAS source distribution. Ralf Hemmecke updated the work of Peter Broadbery and integrated it into FriCAS. In FriCAS you can now simply say: ./configure --enable-aldor && make && make install which will compile a file libfricas.al and thus make it possible to use the Aldor compiler for FriCAS. Of course, you must have the latest aldor compiler installed. If Aldor is installed in a nonstandard place then use ../trunk/configure --enable-gmp --enable-aldor --with-aldor-binary=/opt/aldor/bin/aldor Note: there were several changes in Aldor and FriCAS affecting the interface, older versions of Aldor do not work with newest FriCAS, older versions of FriCAS do not work with newest Aldor. It is possible to use Aldor interface on MathAction including FriCASWiki. Instruction below describe how such usage is working. Aldor on MathActionThis is a simple example of how to use Aldor on MathAction. To compile an Aldor function, for example this non-recursive method to compute a factorial, in MathAction the Aldor code appears between \begin{aldor}[fact] ... \end{aldor} tags on the edit page. fricas (1) -> <aldor> #include "fricas.as" fricas Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/fact.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. fricas Compiling Lisp source code from file ./fact.lsp Issuing )library command for fact fricas Reading /var/aw/var/LatexWiki/fact.asy The optional [name] parameter is used to name the compiled library
file which can be used later on another page in a Now call the function in FriCAS as you would any other. First get the library fricas )lib fact fricas Reading /var/aw/var/LatexWiki/fact.asy Now we test it: fricas fact(11)
Type: PositiveInteger?
fricas sqrt(fact(13))
Type: AlgebraicNumber?
If you care to, you can also look at the Aldor source generated lisp code and the final compiled result Here is an example from WebSite:www.aldor.org/docs/HTML/chap18.html aldor #include "fricas.as" #pile aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/9220782423898255697-25px004.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. Compiling Lisp source code from file ./9220782423898255697-25px004.lsp Issuing )library command for 9220782423898255697-25px004 Reading /var/aw/var/LatexWiki/9220782423898255697-25px004.asy MatrixSymmetry is now explicitly exposed in frame initial MatrixSymmetry will be automatically loaded when needed from /var/aw/var/LatexWiki/9220782423898255697-25px004 fricas m := matrix[[1/2,
Type: Matrix(Fraction(Integer))
fricas s := symmetricPart(m)$MatrixSymmetry(Fraction(Integer))
Type: Matrix(Fraction(Integer))
fricas a := antisymmetricPart(m)$MatrixSymmetry(Fraction(Integer))
Type: Matrix(Fraction(Integer))
See also the more complex examples: More Examples Having put the following simple domain in a file aldor #include "fricas.as" aldor Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/5434963794726606939-25px006.as using Aldor compiler and options -O -Fasy -Fao -Flsp -lfricas -Mno-ALDOR_W_WillObsolete -DFriCAS -Y $FRICAS/algebra -I $FRICAS/algebra Use the system command )set compiler args to change these options. Compiling Lisp source code from file ./5434963794726606939-25px006.lsp Issuing )library command for 5434963794726606939-25px006 Reading /var/aw/var/LatexWiki/5434963794726606939-25px006.asy Test is now explicitly exposed in frame initial Test will be automatically loaded when needed from /var/aw/var/LatexWiki/5434963794726606939-25px006 I compiled it with Aldor as above. In FriCAS you should do: )co test.as fricas )sh Test fricas fact(5)$Test
Type: PositiveInteger?
Known Problems see Issue # 229 |