2 ;;; To compile Maxima with CMUCL, load this file. Then
3 ;;; (compile-maxima) to compile everything. Then (save-maxima)
4 ;;; to save a core file.
6 ;;; If you want support for maxima describe command, you need to get a
7 ;;; copy of GNU regex and compile and install it. Change the path
8 ;;; user::run in init_max1.lisp to the appropriate location of
11 ;;; Also, for things to work, you really need to have a dir file in
12 ;;; the same location as the maxima.info file.
14 ;;; Finally, you need to set MAXIMA_DIRECTORY appropriately before
15 ;;; running maxima. This should be the top-level directory of the
16 ;;; maxima sources. Either here or wherever you installed maxima.
17 ;;; (See the maxima shell script if you installed maxima with gcl for
18 ;;; an appropriate value.)
21 ;; this is now in maxima package
23 (:use
"COMMON-LISP" "ALIEN" "C-CALL")
26 "+RE-BACKSLASH-ESCAPE-IN-LISTS+"
29 "+RE-CONTEXT-INDEP-ANCHORS+"
30 "+RE-CONTEXT-INDEP-OPS+"
31 "+RE-CONTEXT-INVALID-OPS+"
34 "+RE-HAT-LISTS-NOT-NEWLINE+"
42 "+RE-NO-EMPTY-RANGES+"
43 "+RE-UNMATCHED-RIGHT-PAREN-ORD+"
44 ;; Common regexp syntaxes
47 "+RE-SYNTAX-POSIX-COMMON+"
48 "+RE-SYNTAX-POSIX-BASIC+"
49 "+RE-SYNTAX-POSIX-EXTENDED+"
71 (:use
"COMMON-LISP" "REGEXP" "ALIEN"))
72 (defvar si
::*info-paths
* nil
)
75 (push :main-files-loaded
*features
*)
81 (defun compile-maxima ()
82 (compile-file "cmulisp-regex")
83 (compile-file "cl-info")
84 (make::make
:maxima
:compile t
))
88 ;;(load "cmulisp-regex" :if-source-newer :compile)
89 ;;(load "cl-info" :if-source-newer :compile)
91 (setq maxima
::*maxima-directory
* (namestring (truename "../")))
94 (ext:save-lisp
"maxima.core" :init-function
#'user
::run
95 :load-init-file nil
:site-init nil
))
98 (shadow '(lisp::compiled-function-p
) (find-package "MAXIMA"))
100 (defun getpid () (unix:unix-getpid
))
102 (defun compiled-function-p (x)
103 (and (functionp x
) (not (symbolp x
))
104 (not (eval:interpreted-function-p x
))))
106 (defmacro clines
(x) nil
)
108 (cdr (assoc (intern x
(find-package "KEYWORD")) ext
:*environment-list
*)))
110 (defun $system
(&rest x
)
111 (let ((cmdline (apply '$sconcat x
)))
112 (ext:run-program
"/bin/sh" (list "-c" cmdline
) :output t
)
115 (defvar *init-run
* nil
)
116 (defun init-maxima ()
117 ;; Turn off gc messages
120 (setf ext
:*gc-verbose
* nil
)
121 ;; Reload the documentation stuff.
124 (ext:load-foreign
*regex-lib
*)
125 (load (maxima-path "src" "cmulisp-regex") :if-source-newer
:compile
)
126 (load (maxima-path "src" "cl-info") :if-source-newer
:compile
))
128 (format t
"~&Regex support files not found. Skipping regexp stuff for describe~%")))
131 (defvar *maxima-directory
* nil
)
134 ;; Set this to where GNU regex.o can be found.
136 "/apps/src/regex-0.12/regex.o")
140 (let ((dirpath (ext:cmd-switch-arg switch
)))
141 ;; Make sure it ends with a slash
142 (setf *maxima-directory
*
143 (if (eql (aref dirpath
(1- (length dirpath
))) #\
/)
145 (concatenate 'string dirpath
"/"))))))
147 ;; define bye so that quit() will work in maxima
148 (defun bye () (ext:quit
))
149 (defun quit () (ext:quit
))