\documentclass{book}
%\newcommand{\VolumeName}{Volume 2: Axiom Users Guide}
%\input{bookheader.tex}
\pagenumbering{arabic}
\mainmatter
\setcounter{chapter}{0} % Chapter 1

\usepackage{makeidx}
\makeindex
\begin{document}
\begin{verbatim}
\start
Date: Fri, 08 Jun 2012 10:48:16 +0400
From: Grigory Sarnitskiy
To: list
Subject: Re: axiom-wiki: PanAxiom or separate project pages?

Any progress? The wiki is still shown in google search results, but unfortunately its pages are not cashed. I just wanted to know if there is really no parametric polymorphism in Spad.

\start
Date: Mon, 11 Jun 2012 00:58:44 -0400 (EDT)
From: Tim Daly
To: list
Subject: Axiom May 2012 release

May 2012 release notes

The primary work of this release is developing the BLAS1 domain. 
This is a subtask of developing native BLAS and LAPACK support.
These are all checked and tested against the original fortran code.

Makefile.pamphlet
   VERSION = March 2012
   add <<GCLOPTS-CUSTRELOC>> to all stanzas
   add ubuntu64 with 64 bit patch
   move to GCL Version gcl-2.6.8pre7

books/bookvol10.3
   change HASHEQ to SXHASH

books/bookvol10.4
   add Frederick H. Pitts to credits
   add LAPACK contributors

books/bookvol10.5
   BLAS1 daxpy dcopy ddot dnrm2 drot drotg dscal dswap dzasum dznrm2
         icamax idamax isamax izamax zaxpy
   add LAPACK reference code
   add missing lapack routines

books/bookvol5
   add Frederick H. Pitts to credits
   add LAPACK contributors
   fix parsing for 64 bit systems
   reset si::*system-directory* to the null string

books/bookvol7.1
   update What's New Page

books/bookvolbib
   BLAS1 drotg references
   add paper references
   fix typo
   update references

books/bookvolbib.bib
   BLAS1 drotg references
   add LAPACK bibtex reference
   update references

books/ps/
   v71mar2012.eps added
   v71releasenotes.eps add release notes

faq 
   add FAQ 53: Axiom won't build on Fedora
   fix FAQ 22: How do I check out the latest source?

lsp/Makefile.pamphlet
   move to GCL Version gcl-2.6.8pre7

readme
   Frederick H. Pitts <fred.pitts@comcast.net>
   add LAPACK contributors

src/algebra/Makefile
   fix MYUP, etc

src/axiom-website/download.html
   add debian binary
   add ubuntu
   update download list
   update download table

src/axiom-website
   releasenotes.html

src/input/Makefile
   add cohen.input
   add example of spad code
   add simplify.input

src/input
   clements.input add example of spad code
   cohen.input Joel Cohen algebra example
   simplify.input added from sci.math.symbolic

src/interp
   buildom.lisp: change HASHEQ to SXHASH
   sys-pkg.lisp: remove HASHEQ

zips/
   gcl-2.6.8pre7.h.linux.defs.patch port to pre7
   gcl-2.6.8pre7.o.read.d.patch port to pre7
   gcl-2.6.8pre7.tgz lisp fixes from Camm Maquire
   gcl-2.6.8pre7.unixport.init_gcl.lsp.in.patch port to pre7
   gcl-2.6.8pre7.unixport.makefile.patch port patch to pre7

\start
Date: Mon, 11 Jun 2012 10:03:20 -0400
From: Alfredo Portes
To: Grigory Sarnitskiy
Subject: Re: axiom-wiki: PanAxiom or separate project pages?

Hi Grigory,

I am also looking forward to these pages being up again, or just have
the text content somewhere.

The another good reference you can probably find is in Martin Baker's site:

http://www.euclideanspace.com/maths/standards/program/spad/index.htm

On Fri, Jun 8, 2012 at 2:48 AM, Grigory Sarnitskiy wrote:
> Any progress? The wiki is still shown in google search results, but unfortunately its pages are not cashed. I just wanted to know if there is really no parametric polymorphism in Spad.

\start
Date: Mon, 11 Jun 2012 16:24:05 +0200
From: Ralf Hemmecke
To: Alfredo Portes
Subject: PanAxiom or separate project pages?

> I am also looking forward to these pages being up again, or just have
> the text content somewhere.

Well, I was trying to put them up, but the computer that I have 
available for this virtual machine does not allow me to run 64bit VMs, 
because the processor is not powerful enough. In other words, I 
currently have no machine.

Anyway, I (of course) also want to see the information back online. 
However, the axiom wiki runs on a very old ubuntu and the Plone 
installation is also very old. I'm not very eager to leave it that way, 
But upgrading might not even work.

In fact, I'm currently thinking about two things.

1) Put the static stuff to github and manage the pages via sphinx 
http://sphinx.pocoo.org/ .

2) Make the IPython notebook understand %%fricas as a cell magic and 
provide a server that enables people to run some code.

-----

1) would probably be a task to go though all the pages and move them 
into restructured text. Not the easiest task, but certainly doable.
We would be using "git push" to update the website on github. We 
wouldn't have any need to provide a server ourselves and the pages would 
be versioned. Of course, that wouldn't be a wiki, but I don't see much 
of an advantage in a wiki.

2) Involves understanding the IPython magic. I'm not at all very 
knowledgable in Python, but to me it looks as if it shouldn't be too 
hard to get something like Bill Page did for the sage notebook and 
Martin Rubey did with efricas inside the IPython notebook.

Would you be able to help with (2)?

\start
Date: Mon, 11 Jun 2012 12:09:01 -0400
From: Camm Maguire
To: Tim Daly
Subject: Re: Axiom May 2012 release

Greetings, and thanks for your work here as always!

Is the tar file posted yet?

There is a really nice blas/lapack/atlas shared library FFI in gcl I can
discuss with you if interested.

Take care,

Tim Daly writes:

> May 2012 release notes
>
> The primary work of this release is developing the BLAS1 domain. 
> This is a subtask of developing native BLAS and LAPACK support.
> These are all checked and tested against the original fortran code.
>
> Makefile.pamphlet
>    VERSION = March 2012
>    add <<GCLOPTS-CUSTRELOC>> to all stanzas
>    add ubuntu64 with 64 bit patch
>    move to GCL Version gcl-2.6.8pre7
>
> books/bookvol10.3
>    change HASHEQ to SXHASH
>
> books/bookvol10.4
>    add Frederick H. Pitts to credits
>    add LAPACK contributors
>
> books/bookvol10.5
>    BLAS1 daxpy dcopy ddot dnrm2 drot drotg dscal dswap dzasum dznrm2
>          icamax idamax isamax izamax zaxpy
>    add LAPACK reference code
>    add missing lapack routines
>
> books/bookvol5
>    add Frederick H. Pitts to credits
>    add LAPACK contributors
>    fix parsing for 64 bit systems
>    reset si::*system-directory* to the null string
>
> books/bookvol7.1
>    update What's New Page
>
> books/bookvolbib
>    BLAS1 drotg references
>    add paper references
>    fix typo
>    update references
>
> books/bookvolbib.bib
>    BLAS1 drotg references
>    add LAPACK bibtex reference
>    update references
>
> books/ps/
>    v71mar2012.eps added
>    v71releasenotes.eps add release notes
>
> faq 
>    add FAQ 53: Axiom won't build on Fedora
>    fix FAQ 22: How do I check out the latest source?
>
> lsp/Makefile.pamphlet
>    move to GCL Version gcl-2.6.8pre7
>
> readme
>    Frederick H. Pitts <fred.pitts@comcast.net>
>    add LAPACK contributors
>
> src/algebra/Makefile
>    fix MYUP, etc
>
> src/axiom-website/download.html
>    add debian binary
>    add ubuntu
>    update download list
>    update download table
>
> src/axiom-website
>    releasenotes.html
>
> src/input/Makefile
>    add cohen.input
>    add example of spad code
>    add simplify.input
>
> src/input
>    clements.input add example of spad code
>    cohen.input Joel Cohen algebra example
>    simplify.input added from sci.math.symbolic
>
> src/interp
>    buildom.lisp: change HASHEQ to SXHASH
>    sys-pkg.lisp: remove HASHEQ
>
> zips/
>    gcl-2.6.8pre7.h.linux.defs.patch port to pre7
>    gcl-2.6.8pre7.o.read.d.patch port to pre7
>    gcl-2.6.8pre7.tgz lisp fixes from Camm Maquire
>    gcl-2.6.8pre7.unixport.init_gcl.lsp.in.patch port to pre7
>    gcl-2.6.8pre7.unixport.makefile.patch port patch to pre7

\start
Date: Mon, 11 Jun 2012 20:44:29 +0200 (CEST)
From: Waldek Hebisch
To: Grigory Sarnitskiy
Subject: Re: axiom-wiki: PanAxiom or separate project

> I just wanted to know if there is really no parametric polymorphism in Spad.
>

Parametric types available in Spad are more powerful than
parametric polymorphism in core ML, in particular you can
almost mechanically translate such code to Spad.

What Spad lacks is type reconstruction and general recursive
types (single recursion is doable by using %).

\start
Date: Mon, 11 Jun 2012 23:09:06 -0400
From: Bill Page
To: list
Subject: Re: [fricas-devel] PanAxiom or separate project pages?

Ralf,

Axiom wiki does not depend on Plone although it can be used from
Plone.  Axiom wiki was in fact built on another Zope product called
ZWiki.

When you say "static stuff" I wonder if you do not fully appreciate
how a wiki operates.  The "static stuff" is normally not what gets
presented to a user unless they are actually editing the content of a
page. The content is represented in one of several markup formats and
in the case of Axiom-Wiki it also includes embedded LaTeX and Axiom
commands.  When a user clicks Save after editing the content a
"rendered" version of the content is generated and usually also
involves running Axiom (Axiom, FriCAS or OpenAxiom) to convert Axiom
commands and output to embedded LaTeX before converting the embedded
LaTeX to jpeg images.  In a sense the rendered version of the wiki
page is also "static" - so long as it is never edited again.  An awful
lot of the rendered content is in the form of these images.

Anyway it is possible in principle to "harvest" the rendered form
using something like wget.  The result is a css stylesheet for
formating and a bunch of HTML code for each wiki page that includes a
lot of <img> tags plus whole lot (maybe as many as 10,000 or so) of
image files.  I did this once several years ago to produce a CDrom
version of the site.  Everything was OK provided you never clicked on
a function like "edit".  But I think maintaining and updating a static
site like this would be close to impossible.

---

Personally I don't see the point of

> 2) Make the IPython notebook understand %%fricas as a cell magic and provide
> a server that enables people to run some code.

since the Sage notebook interface to FriCAS already exists.  And in
any case it would not be in any sense a replacement for the wiki.

Regards,
Bill Page.

On Mon, Jun 11, 2012 at 10:24 AM, Ralf Hemmecke wrote:
> Hi Alfredo,
>
>> I am also looking forward to these pages being up again, or just have
>> the text content somewhere.
>
>
> Well, I was trying to put them up, but the computer that I have available
> for this virtual machine does not allow me to run 64bit VMs, because the
> processor is not powerful enough. In other words, I currently have no
> machine.
>
> Anyway, I (of course) also want to see the information back online. However,
> the axiom wiki runs on a very old ubuntu and the Plone installation is also
> very old. I'm not very eager to leave it that way, But upgrading might not
> even work.
>
> In fact, I'm currently thinking about two things.
>
> 1) Put the static stuff to github and manage the pages via sphinx
> http://sphinx.pocoo.org/ .
>
> 2) Make the IPython notebook understand %%fricas as a cell magic and provide
> a server that enables people to run some code.
>
> -----
>
> 1) would probably be a task to go though all the pages and move them into
> restructured text. Not the easiest task, but certainly doable.
> We would be using "git push" to update the website on github. We wouldn't
> have any need to provide a server ourselves and the pages would be
> versioned. Of course, that wouldn't be a wiki, but I don't see much of an
> advantage in a wiki.
>
> 2) Involves understanding the IPython magic. I'm not at all very
> knowledgable in Python, but to me it looks as if it shouldn't be too hard to
> get something like Bill Page did for the sage notebook and Martin Rubey did
> with efricas inside the IPython notebook.
>
> Would you be able to help with (2)?
>
> Anybody else any ideas?

\start
Date: Tue, 12 Jun 2012 13:08:23 -0400
From: Tim Daly
To: Camm Maguire
Subject: Re: Axiom May 2012 release

Yes, the src tar is at:
http://axiom-developer.org/axiom-website/downloads/axiom-may2012-src.tgz

I'd like to know the details for the blas/lapack/atlas FFI
and also the details of FFI. 

\start
Date: Tue, 12 Jun 2012 12:19:51 -0500
From: Tim Daly
To: Camm Maguire
Subject: BLAS1

The actual implementation details, the fortran code, the lisp code,
and the spad code are all contained in book volume 10.5 (numerics).
You can find the PDF on the documentation section of the website
or on the Wikipedia Axiom page.

\start
Date: Tue, 12 Jun 2012 16:03:25 -0400
From: Camm Maguire
To: Tim Daly
Subject: Re: Axiom May 2012 release

Greetings, and thanks!

BTW, the Debian axiom package automatically polls

http://axiom.axiom-developer.org/axiom-website/download.html

for new releases (in case I miss an email list post), as

http://axiom.axiom-developer.org/axiom-website/downloads/  

is not searchable.  So if you remember to update the former when making
a release, I'll be sure to see it and package updates can proceed more
smoothly. 

Tim Daly writes:

> Yes, the src tar is at:
> http://axiom-developer.org/axiom-website/downloads/axiom-may2012-src.tgz
>
> I'd like to know the details for the blas/lapack/atlas FFI
> and also the details of FFI. 
>

You're probably already familiar with the legacy FFI using defentry, as
I think axiom uses this already.  This is a bit slow, but functional.

I've designed a new one with the goal of accessing shared libraries from
within GCL given its unique (it appears) ability to unexec a running
image, and reexec later, possibly on a different machine.  A shared
library link therefore needs to be remembered in the image, together
with all code pointer locations which must be reset on image startup.
The following is implemented in the 2.7.0 tree, but can be backported
rather easily if you need it.

There is a :lib package:

(do-external-symbols (s :lib) (print s))

LIB:|libm| 
LIB:|libc| 

each external symbol of which tracks a live shared library binding, and
which also names another package with the dynamically linked symbols in
use:

COMPILER>(do-external-symbols (s 'lib:|libm|) (print s))

|libm|:|atan| 
|libm|:|ctan| 
|libm|:|csqrt| 
|libm|:|clogf| 
|libm|:|acosh| 
|libm|:|ccosh| 
|libm|:|expf| 
|libm|:|atanhf| 
|libm|:|casin| 
|libm|:|cexpf| 
|libm|:|acosf| 
|libm|:|sqrtf| 
|libm|:|exp| 
|libm|:|atanh| 
|libm|:|ccosf| 
|libm|:|ctanh| 
|libm|:|cosh| 
|libm|:|ccoshf| 
|libm|:|cosf| 
|libm|:|atanf| 
|libm|:|cos| 
|libm|:|cacos| 
|libm|:|tanh| 
|libm|:|ctanf| 
|libm|:|csinhf| 
|libm|:|tanf| 
|libm|:|tan| 
|libm|:|asin| 
|libm|:|sinh| 
|libm|:|csin| 
|libm|:|sinf| 
|libm|:|cabs| 
|libm|:|sin| 
|libm|:|catanhf| 
|libm|:|coshf| 
|libm|:|catanh| 
|libm|:|fabs| 
|libm|:|catanf| 
|libm|:|tanhf| 
|libm|:|acoshf| 
|libm|:|asinh| 
|libm|:|csinh| 
|libm|:|asinhf| 
|libm|:|atan2f| 
|libm|:|asinf| 
|libm|:|sinhf| 
|libm|:|atan2| 
|libm|:|csinf| 
|libm|:|cabsf| 
|libm|:|fabsf| 
|libm|:|casinhf| 
|libm|:|logf| 
|libm|:|casinh| 
|libm|:|clog| 
|libm|:|casinf| 
|libm|:|ctanhf| 
|libm|:|csqrtf| 
|libm|:|log| 
|libm|:|cacoshf| 
|libm|:|cacosh| 
|libm|:|catan| 
|libm|:|cacosf| 
|libm|:|cexp| 
|libm|:|acos| 
|libm|:|sqrt| 
|libm|:|ccos| 

Each of these symbols name genuine lisp functions which wrap calls to
the external routine in question:

(function-lambda-expression #'|libm|:|atan| )

(LAMBDA (#:G550) (DECLARE (OPTIMIZE (SAFETY 2)))
        (CHECK-TYPE #:G550 (LONG-FLOAT * *))
        (BLOCK |libm|:|atan| (CADD-DLADDRESS "dlatan" |libm|:|atan|)
               (LIT :DOUBLE "(" "(double(*)(double))" "(" "dlatan"
                    "))(" (:DOUBLE #:G550) "" ")")))
NIL
|libm|:|atan|


These functions check argument types, but when inlined at (default)
safety 0, simply compile to calls to the routine through a C pointer. 

COMPILER>(disassemble '|libm|:|atan| nil)

;; Compiling /tmp/gazonk_21018_0.lsp.
;; End of Pass 1.  
;; End of Pass 2.  
;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3, (Debug quality ignored)
;; Finished compiling /tmp/gazonk_21018_0.o.

#include "gazonk_21018_0.h"
void init_code(){do_init((void *)VV);}
/*	local entry for function libm::atan	*/

static object LI1__atan___gazonk_21018_0(object V2)
{	 VMB1 VMS1 VMV1
	if(!(type_of((V2))==t_longfloat)){
	goto T4;}
	goto T3;
	goto T4;
T4:;
	V2= (VFUN_NARGS=4,/* SYSTEM::CHECK-TYPE-SYMBOL */(*LnkLI2)(((object)VV[1]),(V2),((object)VV[2]),Cnil));
	goto T3;
T3:;
	{object V3 = make_longfloat(((double(*)(double))(dlatan))(lf(V2)));
	VMR1(V3);}
}


COMPILER>(declaim (inline |libm|:|atan|))

NIL

COMPILER>(disassemble '(lambda (x) (declare (long-float x)) (|libm|:|atan| x)) nil)

;; Compiling /tmp/gazonk_21018_0.lsp.
;; End of Pass 1.  
;; End of Pass 2.  
;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3, (Debug quality ignored)
;; Finished compiling /tmp/gazonk_21018_0.o.

#include "gazonk_21018_0.h"
void init_code(){do_init((void *)VV);}
/*	local entry for function COMPILER::CMP-ANON	*/

static object LI1__CMP_ANON___gazonk_21018_0(object V2)
{	 VMB1 VMS1 VMV1
	{object V3 = make_longfloat(((double(*)(double))(dlatan))(lf(V2)));
	VMR1(V3);}
}


New bindings are made via the defdlfun macro:

(defdlfun (:double "cblas_ddot" "libcblas.so") :int :double* :int :double* :int)

|libcblas|:|cblas_ddot|

(do-external-symbols (s :lib) (print s))

LIB:|libcblas| 
LIB:|libm| 
LIB:|libc| 
NIL

(do-external-symbols (s :|libcblas|) (print s))

|libcblas|:|cblas_ddot| 
NIL


The usage exactly follows C prototype rules.   

One limitation at present is that the function cannot be run when
interpreted, i.e. must be compiled.  I'll try to find time to fix this:

(compile '|libcblas|:|cblas_ddot| )

;; Compiling /tmp/gazonk_21018_0.lsp.
;; End of Pass 1.  
;; End of Pass 2.  
;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3, (Debug quality ignored)
;; Finished compiling /tmp/gazonk_21018_0.o.
;; Loading /tmp/gazonk_21018_0.o
start address -T 0xb66b50 ;; Finished loading /tmp/gazonk_21018_0.o
#<function 01cf2090>
NIL
NIL

The function can now be used as any other function:

(setq a (make-array 10 :element-type 'long-float :static t
:initial-contents '(1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0)))

#(1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0)

(|libcblas|:|cblas_ddot| 10 a 1 a 1)

385.0

When the image is saved and restarted, the linking pointer is
automatically updated.

(si::save-system "ff")
camm@localhost:~/debian/gcl/gclcvs/tmp/unixport$ ./ff
GCL (GNU Common Lisp)  NIL.NIL.NIL CLtL1    May 25 2012 14:58:14
Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd,xgcl)
Binary License:  GPL due to GPL'ed components: (XGCL 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.

Temporary directory for compiler files set to /tmp/

>(in-package :compiler)

#<"COMPILER" package>

COMPILER>(|libcblas|:|cblas_ddot| 10 a 1 a 1)

385.0

COMPILER>


On Debian based systems, such blas calls automatically proceed to
optimized atlas calls (when installed) making use of specialized vector
instruction extensions.

One thing that should be kept in mind when using blas/lapack/atlas is
that the latter can call malloc under certain circumstances.  I wish
these libraries had some means to toggle allocation on the stack, but
they don't, or at least didn't last time I looked.  This means that if
you pass arrays allocated in relocatable memory, the result could be
corrupted if a gc is triggered.  We wrote gmp wrappers to handle a
similar situation.  But for a generic interface, this is impossible, so
arrays should be allocated in contiguous block memory to be safe,
i.e. using the :static t keywords in make-array.  It is somewhat of a
pity, as such memory is slower to GC.

\start
Date: Tue, 12 Jun 2012 23:56:20 -0500
From: Tim Daly
To: Camm Maguire
Subject: monitoring download.html

I just updated the download.html file.
I was waiting until I had compiled the binaries for the different distros.
I did not realize you were monitoring that file.
I'll update it immediately next release.



\end{verbatim}
\eject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
%\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{axiom}
\bibliography{axiom}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
%\phantomsection
\addcontentsline{toc}{chapter}{Index}
\printindex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
