Compare commits
No commits in common. "f4a538dc5134b33c7f4d5ac2f2b206cff58e9e32" and "d2c9ff77f6daaf6cd7a68a1d01b3864ba5201201" have entirely different histories.
f4a538dc51
...
d2c9ff77f6
35
README
35
README
@ -21,25 +21,22 @@ To then run the simulation:
|
|||||||
|
|
||||||
SETUP
|
SETUP
|
||||||
|
|
||||||
If you have :sdl2 available and the sources are in ASDF's registry,
|
Before the ASDF system can be loaded, you must build the Maxima
|
||||||
loading the system should just work™:
|
sources locally and install them into a directory (I couldn't get
|
||||||
|
Maxima's ASDF system to load successfully otherwise, though I'm not
|
||||||
|
entirely sure why this fixes it). This can be done with:
|
||||||
|
|
||||||
(asdf:load-system :ham)
|
cd maxima
|
||||||
|
mkdir $PWD-install
|
||||||
|
./bootstrap
|
||||||
|
./configure --prefix=$PWD-install
|
||||||
|
make -j
|
||||||
|
make install
|
||||||
|
|
||||||
Otherwise, the full process fetching :sdl2 with Quicklisp and adding
|
I'll try to figure out if this step itself can be done with ASDF at
|
||||||
the current directory to ASDF's registry is
|
some point ;)
|
||||||
|
|
||||||
(ql:quickload :sdl2)
|
Once that's done you should be able to load the system with
|
||||||
(push *default-pathname-defaults* asdf:*central-registry*)
|
(asdf:load-system :ham), given that the sources are in your ASDF
|
||||||
(asdf:load-system :ham)
|
registry. The system also uses :sdl2, so make sure that's available
|
||||||
|
-- you can get it with (ql:quickload :sdl2) if you're so inclined.
|
||||||
As it stands the system will only work with SBCL, though I don't think
|
|
||||||
it would be *that* much work to get it working with other Common Lisp
|
|
||||||
implementations.
|
|
||||||
|
|
||||||
Maxima ended up being a bit of a pain to build fully within ASDF so
|
|
||||||
the ASDF config first compiles it with its autotools set-up (so you'll
|
|
||||||
need autoconf et al) and uses the FASLs from that build when possible.
|
|
||||||
It's a little cursed but it does the job. I did have to call
|
|
||||||
asdf::mark-operation-done directly so it might break with future
|
|
||||||
versions of ASDF (I'm using version 3.3.1 at time of writing).
|
|
||||||
|
56
ham.asd
56
ham.asd
@ -4,62 +4,14 @@
|
|||||||
(in-package :asdf-user)
|
(in-package :asdf-user)
|
||||||
|
|
||||||
(eval-when (:compile-toplevel :load-toplevel :execute)
|
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||||
(let* ((base-dir
|
(let ((base-dir
|
||||||
(make-pathname :directory (pathname-directory *load-pathname*)))
|
(make-pathname :directory (pathname-directory *load-pathname*))))
|
||||||
(maxima-dir (merge-pathnames "maxima/" base-dir))
|
(pushnew (merge-pathnames "maxima/src/" base-dir)
|
||||||
(maxima-src-dir (merge-pathnames "src/" maxima-dir))
|
|
||||||
(maxima-install-dir (merge-pathnames "maxima-install/" base-dir)))
|
|
||||||
(unless (probe-file (merge-pathnames "bin/maxima" maxima-install-dir))
|
|
||||||
(uiop:with-current-directory (maxima-dir)
|
|
||||||
(uiop:run-program "./bootstrap"
|
|
||||||
:output *standard-output*
|
|
||||||
:error-output *error-output*)
|
|
||||||
(uiop:run-program (format nil "./configure --prefix=~A"
|
|
||||||
(namestring maxima-install-dir))
|
|
||||||
:output *standard-output*
|
|
||||||
:error-output *error-output*)
|
|
||||||
(uiop:run-program "make -j"
|
|
||||||
:output *standard-output*
|
|
||||||
:error-output *error-output*)
|
|
||||||
(uiop:run-program "make install"
|
|
||||||
:output *standard-output*
|
|
||||||
:error-output *error-output*)))
|
|
||||||
(pushnew maxima-src-dir
|
|
||||||
asdf:*central-registry*
|
asdf:*central-registry*
|
||||||
:test #'equal)
|
:test #'equal)
|
||||||
(pushnew (merge-pathnames "maxima-interface/" base-dir)
|
(pushnew (merge-pathnames "maxima-interface/" base-dir)
|
||||||
asdf:*central-registry*
|
asdf:*central-registry*
|
||||||
:test #'equal)
|
:test #'equal)))
|
||||||
(defparameter *maxima-src-dir* maxima-src-dir)))
|
|
||||||
|
|
||||||
(defun prebuilt-maxima-fasl (source-file)
|
|
||||||
(let ((source-path (asdf:component-pathname source-file)))
|
|
||||||
(when (uiop:subpathp source-path *maxima-src-dir*)
|
|
||||||
(let ((fasl-file
|
|
||||||
(make-pathname
|
|
||||||
:directory (substitute "src/binary-sbcl" "src"
|
|
||||||
(pathname-directory source-path)
|
|
||||||
:test #'string=)
|
|
||||||
:name (pathname-name source-path)
|
|
||||||
:type "fasl")))
|
|
||||||
(when (probe-file fasl-file)
|
|
||||||
(list fasl-file))))))
|
|
||||||
|
|
||||||
(defmethod asdf:output-files :around ((op asdf:compile-op)
|
|
||||||
(c asdf:cl-source-file))
|
|
||||||
(or (prebuilt-maxima-fasl c)
|
|
||||||
(call-next-method)))
|
|
||||||
|
|
||||||
(defmethod asdf:perform :around ((op asdf:compile-op)
|
|
||||||
(c asdf:cl-source-file))
|
|
||||||
(if (prebuilt-maxima-fasl c)
|
|
||||||
(asdf::mark-operation-done op c)
|
|
||||||
(call-next-method)))
|
|
||||||
|
|
||||||
(defmethod asdf:input-files :around ((op asdf:load-op)
|
|
||||||
(c asdf:cl-source-file))
|
|
||||||
(or (prebuilt-maxima-fasl c)
|
|
||||||
(call-next-method)))
|
|
||||||
|
|
||||||
(defsystem :ham
|
(defsystem :ham
|
||||||
:version "0.1.0"
|
:version "0.1.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user