(clnl:run)
```
-To view the opengl view, you'll want to open up the interface:
+## Running on OSX
-```lisp
-(sb-thread:make-thread #'clnl-interface:run)
-```
-
-(On OSX, the interface should be the main thread)
+In order to run on OSX, you may have to build your own sbcl instance with threads enabled.
# Testing
--- /dev/null
+(when (not (find-package :clnl)) (asdf:load-system :clnl))
+(when (not (find-package :clnl-test)) (asdf:load-system :clnl-test))
+
+(format t "~%~c[1;33mRunning Tests~c[0m~%" #\Esc #\Esc)
+(when (not (clnl-test:run-all-tests))
+ (format t "~c[1;31mFailed tests!~c[0m~%" #\Esc #\Esc)
+ (sb-ext:exit :code 1))
+
+(when (not (find-package :syntax-checker)) (asdf:load-system :style-checker))
+(format t "~%~c[1;33mChecking Style~c[0m~%" #\Esc #\Esc)
+(when (not (syntax-checker:pretty-print-check-directory "src"))
+ (format t "~c[1;31mFailed style check!~c[0m~%" #\Esc #\Esc)
+ (sb-ext:exit :code 1))
+(format t "~c[1;32m- Style Passed!~c[0m~%" #\Esc #\Esc)
+
+(when (not (find-package :docgen)) (asdf:load-system :docgen))
+(format t "~%~c[1;33mChecking Docs~c[0m~%" #\Esc #\Esc)
+(when (not (docgen:pretty-print-validate-packages
+ :clnl :clnl-parser :clnl-random :clnl-transpiler :clnl-nvm :clnl-lexer :clnl-interface :clnl-cli))
+ (format t "~c[1;31mFailed doc check!~c[0m~%" #\Esc #\Esc)
+ (sb-ext:exit :code 1))
+(format t "~c[1;32m- Doc Check Passed!~c[0m~%" #\Esc #\Esc)
+
+(format t "~c[1;30m--------------~c[0m~%" #\Esc #\Esc)
+(format t "~c[1;32mBuild Success!~c[0m~%" #\Esc #\Esc)
+(sb-ext:exit :code 0)
--- /dev/null
+#!/bin/bash
+
+# This sciprt builds a version of sbcl pre loaded with libraries that can run on osx.
+# You can use ./osxsbcl --script bin/run.lisp to run it
+
+mkdir -p tmp/sbcl
+mkdir -p tmp/sbcl-binary
+
+cwd=$PWD
+( cd tmp &&
+ tar jxf ../deps/tarpit/sbcl-1.2.11-x86-64-darwin-binary.tar.bz2 &&
+ tar jxf ../deps/tarpit/sbcl-1.2.13-source.tar.bz2 &&
+ cd sbcl-1.2.11-x86-64-darwin/ &&
+ SBCL_HOME="" INSTALL_ROOT=$cwd/tmp/sbcl-binary/ bash install.sh &&
+ cd ../sbcl-1.2.13/ &&
+ PATH="$cwd/tmp/sbcl-binary/bin/:$PATH" SBCL_HOME="$cwd/tmp/sbcl-binary/lib/sbcl/" bash make.sh --with-sb-thread &&
+ SBCL_HOME="" INSTALL_ROOT=$cwd/tmp/sbcl/ bash install.sh )
+
+mkdir -p tmp/deps/
+
+( cd tmp/deps &&
+ tar zxf ../../deps/tarpit/3b-cl-opengl-993d627.tar.gz &&
+ tar zxf ../../deps/tarpit/alexandria-b1c6ee0.tar.gz &&
+ tar zxf ../../deps/tarpit/babel_0.5.0.tar.gz &&
+ tar zxf ../../deps/tarpit/cffi_0.15.0.tar.gz &&
+ tar zxf ../../deps/tarpit/cl-ppcre.tar.gz &&
+ tar zxf ../../deps/tarpit/ironclad.tar.gz &&
+ tar zxf ../../deps/tarpit/mt19937-latest.tar.gz &&
+ tar zxf ../../deps/tarpit/nibbles-v0.12.tar.gz &&
+ tar zxf ../../deps/tarpit/trivial-features_0.8.tar.gz &&
+ tar zxf ../../deps/tarpit/cl-charms-9bb94ef.tar.gz # &&
+ ln -s 3b-cl-opengl-993d627/cl-glut.asd . &&
+ ln -s 3b-cl-opengl-993d627/cl-opengl.asd . &&
+ ln -s alexandria-b1c6ee0/alexandria.asd . &&
+ ln -s babel_0.5.0/babel-streams.asd . &&
+ ln -s babel_0.5.0/babel.asd . &&
+ ln -s cffi_0.15.0/cffi-examples.asd . &&
+ ln -s cffi_0.15.0/cffi-grovel.asd . &&
+ ln -s cffi_0.15.0/cffi-libffi.asd . &&
+ ln -s cffi_0.15.0/cffi-uffi-compat.asd . &&
+ ln -s cffi_0.15.0/cffi.asd . &&
+ ln -s cl-charms/cl-charms.asd . &&
+ ln -s cl-ppcre-2.0.10/cl-ppcre.asd . &&
+ ln -s mt19937-1.1.1/mt19937.asd . &&
+ ln -s nibbles-0.12/nibbles.asd . &&
+ ln -s trivial-features_0.8/trivial-features.asd . &&
+ ln -s ../../src/main/clnl.asd .
+)
+
+SBCL_HOME="" tmp/sbcl/bin/sbcl --core tmp/sbcl/lib/sbcl/sbcl.core --no-sysinit --no-userinit \
+ --eval "(require 'asdf)" \
+ --eval '(setf asdf:*central-registry* (list #p"tmp/deps/"))' \
+ --eval "(asdf:load-system :clnl)" \
+ --eval "(asdf:clear-output-translations)" \
+ --eval '(sb-ext:save-lisp-and-die "osxsbcl" :executable t :toplevel (function clnl:run))' \
+
+chmod +x osxsbcl
+
+rm -rf tmp
#!/bin/bash
+# This script builds a verion of sbcl with the libraries pre loaded
+# for ease of travis. Remember to update bin/buildosxsbcl when you
+# update this.
+
mkdir -p tmp/sbcl
cwd=$PWD
ln -s docgen_0.1/docgen.asd .
)
-
SBCL_HOME="" tmp/sbcl/bin/sbcl --core tmp/sbcl/lib/sbcl/sbcl.core \
--eval "(require 'asdf)" \
--eval '(setf asdf:*central-registry* (list #p"tmp/deps/"))' \
(require 'asdf)
(push #p"deps/" asdf:*central-registry*)
(asdf:load-system :clnl)
-(sb-thread:make-thread #'clnl-interface:run)
-(clnl-cli:run)
+(clnl:run)
(asdf:load-system :clnl.internal)
(asdf:load-system :clnl-test.internal)
-(format t "~%~c[1;33mRunning Tests~c[0m~%" #\Esc #\Esc)
-(when (not (clnl-test:run-all-tests))
- (format t "~c[1;31mFailed tests!~c[0m~%" #\Esc #\Esc)
- (sb-ext:exit :code 1))
-
-(format t "~%~c[1;33mChecking Style~c[0m~%" #\Esc #\Esc)
-(when (not (syntax-checker:pretty-print-check-directory "src"))
- (format t "~c[1;31mFailed style check!~c[0m~%" #\Esc #\Esc)
- (sb-ext:exit :code 1))
-(format t "~c[1;32m- Style Passed!~c[0m~%" #\Esc #\Esc)
-
-(format t "~%~c[1;33mChecking Docs~c[0m~%" #\Esc #\Esc)
-(when (not (docgen:pretty-print-validate-packages
- :clnl :clnl-parser :clnl-random :clnl-transpiler :clnl-nvm :clnl-lexer :clnl-interface :clnl-cli))
- (format t "~c[1;31mFailed doc check!~c[0m~%" #\Esc #\Esc)
- (sb-ext:exit :code 1))
-(format t "~c[1;32m- Doc Check Passed!~c[0m~%" #\Esc #\Esc)
-
-(format t "~c[1;30m--------------~c[0m~%" #\Esc #\Esc)
-(format t "~c[1;32mBuild Success!~c[0m~%" #\Esc #\Esc)
-(sb-ext:exit :code 0)
+(load "bin/all.lisp")
; want to investigate until simply ignoring them becomes a problem.
(sb-int:with-float-traps-masked (:invalid)
(cl-glut:init)
- (gl:clear-color 0 0 0 1)
(cl-glut:init-window-size
(floor (* *patch-size* (1+ (- (getf *world-dims* :xmax) (getf *world-dims* :xmin)))))
(floor (* *patch-size* (1+ (- (getf *world-dims* :ymax) (getf *world-dims* :ymin))))))
- (setf *glut-window-opened* t)
- (cl-glut:create-window "CLNL Test Window")
(cl-glut:init-display-mode :double :rgba)
+ (cl-glut:create-window "CLNL Test Window")
+ (setf *glut-window-opened* t)
+ (gl:clear-color 0 0 0 1)
(cl-glut:display-func (cffi:get-callback 'display))
(glut:reshape-func (cffi:callback reshape))
(cl-glut:idle-func (cffi:get-callback 'idle))
(sb-int:with-float-traps-masked (:invalid)
(when (not *glut-window-opened*)
(cl-glut:init)
- (gl:clear-color 0 0 0 1)
(cl-glut:init-window-size 1 1)
(cl-glut:create-window "CLNL Test Window")
+ (gl:clear-color 0 0 0 1)
(set-turtle-list)
(setf *glut-window-opened* t))
(let
DESCRIPTION:
- RUN implements a very simple REPL."
- (loop
- :for str := (progn (format t "> ") (force-output) (read-line))
- :while str
- :do (p (e (r str))))
- (sb-ext:exit))
+ RUN starts up the CLNL system."
+
+ (sb-thread:make-thread #'clnl-cli:run)
+ (clnl-interface:run))
(defun boot ()
"BOOT => RESULT
(in-package #:clnl-test)
(defviewtest "Basic 1" "crt 1"
- "FE38C1C9873FD97451A41EB89CE47E60DAB0DD03")
+ "A41D8146DD81EF27AF2B97955C66E982CFA0A465")
(defviewtest "Basic 2" "crt 10 ask turtles [ fd 1 ]"
- '("99673570760F0A2E3B49B858AFC8CCDAE16C78D5" "9A7CB6E13203687AB09CBA4CEFF7912534D69542"))
+ '("DEC2ED793C08A1680DD601BD3E9B81927994C123" "788EAE5B41CE031672672C372EDBCDFD9B309E64"))