There are currently three version of VMMaker at source.squeak.org
- VMMaker (legacy package for building the old Standard Interpreter)
- VMMaker.oscog (Eliot Miranda’s current work supporting Stackinterpreter, Cog, newspeak, Spur etc)
- VMMaker-oscog (Pharo branch of VMMaker.oscog)
By luck or design, VMMaker uses CMAKE for its config/build work and somehow CMAKE knows enough to detect my system is linux64 and ignores
the compat32 libs. This gives me a native 64 bit virtual machine. Since I want to port StackInterpreter and eventually Cog to native 64, I thought
it would be important to get the feel of the old VMMaker process before advancing to the StackInterpreter in VMMaker.oscog
There are 3 exercises I went through.
- Build 64 bit native VM that runs a 32 bit image
- Build a 64 bit native VM compiled to support a 64 bit image downloaded from the Jenkins build server
- Generate my own 64 bit image and run that on the VM built in 2 above.
This post is the quick-n-dirty of exercise 1 of the 3.
The following is an exercise to gain experience in generating a vm and a 64 bit image.
We will be using a current system with a Cog VM to generate an out-dated, slower Interpreter VM.
See David T. Lewis’ work: How to build a standard VM with Squeak on Linux at href=”http://wiki.squeak.org/squeak/6177″>http://wiki.squeak.org/squeak/6177
Below are my short-hand notes on his work.
#PREREQUISITS AND ASSUMPTIONS
32-bit compatability libs installed and working (Slackware used Alien-Bob compat32, Ubuntu etc have their own flavors of this)
in instruction below….
replace Squeak4.5-* with your actual version
replace VMMaker-dtl.345 with the latest version of VMMaker from Monticello
replace update-dtl.15.mcm with the latest version of VMMaker from Monticello
replace /home/tty/ with your home directory
replace ~/usr/src/smalltalk/buildStandardVM32 with your preference
optional: I have a dual boot system. One boot is Slackware 14.1 with the 32 bit compat libs, the other is a pure 64 bit system with no compat libs.
both boots share the same /home directory which is mounted on its own disk.
#CREATE WORKING DIRECTORY
#DOWNLOAD SQUEAK TO BUILD DIRECTORY
Download http://ftp.squeak.org/4.5/Squeak-4.5-All-in-One.zip to ~/usr/src/smalltalk/buildStandardVM32
#DOWNLOAD BUILD ENVIRONMENT TO SAME DIRECTORY AS .image
svn co http://squeakvm.org/svn/squeak/trunk
ln -s trunk/platforms platforms
Tools-> Monticello Browser
Open->(scroll down in left hand pane to..)update->update-dtl.15.mcm->Load (this installs lates VMMaker and dependencies)
(N.B. VMMaker is standard interpreter, VMMaker-oscog is pharo branch of cog, VMMaker.oscog is squeak branch of Cog, we are building the standard interpreter, so use VMMaker)
Save your image.
#CONFIGURE AND RUN VMMAKER TO GENERATE C SOURCE CODE: TWO METHODS
#RUNNING VMMaker GUI method
#enter fields in gui:
Interpreter class name: Interpreter
Path to platforms code: /home/tty/usr/src/smalltalk/buildStandardVM32/Squeak-4.5-All-in-One.app/Contents/Resourcesplatforms <–N.B. this is the soft link you created earlier
path to generated sources:/home/tty/usr/src/smalltalk/buildStandardVM32/Squeak-4.5-All-in-One.app/Contents/Resources/src
#drag-n-drop plugins (these worked for me, others may as well, your mileage may vary. I am just keeping it simple for pedantic purposes)
#Buttons to push
[Clean out] (next to Path to generated sources:) cleans out the directory
Generate: [Entire] (Second row from top, wait for the whirring,clicking and blinkenlights to stop)
[Save] (saves this configuration to a file for loading later)
#RUNNING VMMaker scripting method
Open Workspace and DoIt
initializeInternal: #(BalloonEnginePlugin BitBltSimulation DeflatePlugin FilePlugin LargeIntegersPlugin LocalePlugin SecurityPlugin SocketPlugin)
external: #(SocketPlugin ZipPlugin B2DPlugin)) generateEntire
save and quit Squeak.
#CREATE INSTALL DIRECTORY, CONFIGURE,MAKE,MAKE-INSTALL
mkdir /home/tty/usr/local/standardVM32 <–where I want the new vm executable to be installed, your path is your preference used in –prefix= below
../platforms/unix/cmake/configure –prefix=/home/tty/usr/local/standardVM32 –without-gl <
/home/tty/usr/local/standardVM32/lib/squeak/4.12.13-/squeakvm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
(file command shows it is a native 64 app)
#OPTIONAL reboot to pure 64 bit system if you have one.
#CONFIGURE RUN ENVIRONMENT AND LAUNCH (N.B. I like to keep my build and run environments separate. )
cp ../buildStandardVM32/Squeak-4.5-All-in-One.zip ./
mv Squeak-4.5-All-in-One.app/Contents/Resources/Squeak4.5-13680.* ./
mv Squeak-4.5-All-in-One.app/Contents/Resources/SqueakV41.sources ./
rm -Rf Squeak-4.5-All-in-One.app/
rm -Rf __MACOSX
mv Squeak-4.5-All-in-One.zip ~/
Squeak4.5-13680.changes Squeak4.5-13680.image SqueakV41.sources (N.B. we now have a pristine setup. executables and libs are in ~/usr/local/standardVM32 and bare minimum here image,changes, sources)
#make a bash script startStandardVM32.sh with the following contents
/home/tty/usr/local/standardVM32/lib/squeak/4.12.13-/squeakvm -vm-sound-ALSA -vm-display-X11 -xshm Squeak4.5-13680.image
chmod 0755 startStandardVM32.sh
Toolbar menu->Help->About This System.