In preparation for the upcoming TC Lispers meeting, I was testing my Sheeple-based CL-OpenGL GUI code on all of the different systems that I use. This was important because part of my goal in starting from bare-bones OpenGL was to make something that was pretty easy to port. The OpenGL libraries are the only non-Lisp dependencies, and they are pretty standard.
I run Mac OS X 10.6.2 as my primary development machine. I knew everything I had so far worked there under SBCL 1.0.30 and CMU-CL 20a. It took a little tweaking to get Sheeple built under Allegro CL 8.1 (Trial Edition), but after that I was five-by-five under Allegro, too. Unfortunately, I cannot get CL-OpenGL to run under Clozure 1.3-r11936 on Mac OS X. Also, ECL 9.10.2 doesn’t support weak key hashtables which Sheeple needs. And, my install of clisp broke somewhere along the lines, so I haven’t tried it.
I have an Ubuntu Linux box. There, I am using SBCL 1.0.11.debian (eeps). Everything ran perfectly over there (even displaying through X Windows back to my Mac).
I also run Windows Vista under VMWare Fusion on my Mac. I hadn’t done any development on it for months and months. Fortunately, in Google-ing to find out how to fix it, I stumbled upon what I had written about how I got things set up originally. Over the last two hours, I got SBCL upgraded to 1.0.29 under Vista. I got ASDF-Install set up with a bunch of help from this article. And, from there, I got CFFI and cl-opengl and ZPB-TTF and Sheeple installed.
ZPB-TTF and Sheeple both used some tar format options that archive_0.7.0 didn’t like. For those, I had to jump through some hoops to untar and retar them to get them to install.
Here was my final /Users/Patrick/.sbclrc file:
;; from Zach Beane
(defmethod asdf:perform :around ((o asdf:load-op)
(c asdf:cl-source-file))
(handler-case (call-next-method o c)
(#+sbcl sb-ext:invalid-fasl
#+allegro excl::file-incompatible-fasl-error
#+lispworks conditions:fasl-error
#+cmu ext:invalid-fasl
#-(or sbcl allegor lispworks cmu) error ()
(asdf:perform (make-instance 'asdf:compile-op) c)
(call-next-method))))
(dolist (pkg '("alexandria/"
"archive_0.7.0/"
"asdf-install/asdf-install/"
"babel_0.3.0/"
"cffi_0.10.5/"
"cl-opengl/"
"flexi-streams-1.0.7/"
"gzip-stream_0.2.8/"
"salza2-2.0.7/"
"sykopomp-sheeple-ceab213/"
"trivial-features_0.6/"
"trivial-gray-streams-2008-11-02/"
"woolly/"
"zpb-ttf-1.0/") )
(pushnew (merge-pathnames pkg
(merge-pathnames "ASDF-Systems/"
(user-homedir-pathname)))
asdf:*central-registry*))
(asdf:oos 'asdf:load-op 'asdf-install)
;; for my sanity
(setf asdf-install:*locations*
(list (list (merge-pathnames "ASDF-Systems/" (user-homedir-pathname))
(merge-pathnames "ASDF-Systems/" (user-homedir-pathname))
"My install spot")))
;; via http://sean-ross.blogspot.com/2007/05/asdf-install-windows.html
#+win32
(asdf:oos 'asdf:load-op 'gzip-stream)
#+win32
(asdf:oos 'asdf:load-op 'archive)
#+win32
(defun asdf-install-extractor (to-dir tarball)
(let ((name nil))
(gzip-stream:with-open-gzip-file (ins tarball)
(archive:with-open-archive (archive ins)
(let ((*default-pathname-defaults* (pathname to-dir)))
(archive:do-archive-entries (entry archive name)
(archive:extract-entry archive entry)
(unless name (setf name (archive:name entry)))))))
(string name)))
#+win32
(push 'asdf-install-extractor asdf-install:*tar-extractors*)
The list of packages in the middle were about half installed manually to get the archive extraction code working and half installed through ASDF-Install. If I recall correctly, I had to manually install: archive_0.7.0, flexi-streams-1.0.7, gzip-stream_0.2.8, salza2-2.0.7, trivial-gray-streams-2008-11-02, and a fresh copy of asdf-install. I also had to download a compiled version of freeglut.dll and tuck it into my Windows\system32 directory.
Getting SBCL to use the fresh copy of asdf-install was annoying. I ended up starting up a Command Prompt as Administrator (right click on the “command.exe” icon or menu-item and select “Run as Administrator”). Then, I went to the SBCL directory (“C:\Program Files\Steel Bank Common Lisp\1.0.29\”) and did the following:
% mklink /d asdf-install "C:\Users\Patrick\ASDF-Systems\asdf-install\asdf-install"
I had extracted the tar-ball from the ASDF-Install distribution into my ASDF-Systems directory.
Then, I went back and made my GUI code use double-buffered OpenGL windows because running Lisp to OpenGL to Windows Vista to VMWare to Quartz had some wicked flickering going on.
Two hours is a long time for something that’s supposed to be easily portable
. But, I would have spent at least 95% of that time even if I were using an all-Lisp solution. And, this is far less time than I ever spent porting anything else to Windows.
For those playing the home-game, Allegro was not seeing the definition of the FUN macro in Sheeple’s utils.lisp file while compiling the ACONSF macro further down in that same file. This was easily side-stepped (pronounced: hacked around) by moving the FUN macro declaration into a file that gets compiled before utils.lisp.
And, when I try to load cl-glut under Clozure in Mac OS X, I get a Trace/BPT Trap. I’m not sure why. I haven’t spent any time really trying to work around that problem.
If you wouldn’t mind explaining in greater detail the problems with archive that you encountered, or even just sending the problematic tarballs, I’d appreciate an email so I can try fixing those bugs. I admit that win32 development has not been a priority for archive, since the tar format is so unix-centric. Thanks!
Absolutely. I should also mention though that without archive, I’d have never even bothered trying to get all of these libraries and dependencies set up under Windows.
I am pretty sure that Josh uses a Linux box to develop Sheeple. And, I know that Zach uses a Mac at least sometimes, but it wouldn’t surprise me if his last release of ZPB-TTF was from a Linux box.
I untarred the offenders on my Mac and tarred them back up again with /usr/bin/tar on my Mac and they worked for me.
Here are the originals: sheeple_3.0.1.tar.gz and zpb-ttf.tgz.
Here is the error message (through ASDF-Install):
debugger invoked on a SIMPLE-ERROR: Can't understand typeflag: 103
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
((SB-PCL::FAST-METHOD ARCHIVE:READ-ENTRY-FROM-ARCHIVE (ARCHIVE:TAR-ARCHIVE)
#<unavailable argument>
#<unavailable argument>
#<ARCHIVE:TAR-ARCHIVE {2423CE81}>)
0]
As nearly as I can figure, this is a global extended header see the XGLTYPE in this code with reference to documentation here and some interesting info here.
As far as weak-hashtables are concerned, I wonder if you could get them across lisps by putting trivial-garbage into sheeple?
Hm. No, looking at this, it looks like CCL isn’t supported by trivial-garbage. I wonder what it would take to get it supported?
It was ECL (not CCL) where the hashtables were the trouble. (Of course, looking at trivial-garbage, I am guessing you just typoed here.) Sheeple works with CCL. (CL-OpenGL doesn’t on my Mac.)
I should poke around weak key hashtables in ECL sometime.