Logo-small

5.1.3.1 Cog VM

Prepare for building: Installing Cygwin

For the brave of heart, minimal instructions can be found in the Cog branch of the Squeak VM subversion tree:

http://www.squeakvm.org/svn/squeak/branches/Cog/cygwinbuild/HowToBuild

As indicated, you will need a properly configured cygwin installation to build the Cog VM which includes subversion, make, and the appropriate gcc compiler.

As of this writing (June 2010), the Cog VM has been successfully built with Cygwin 1.7.5. The following steps will explain how to install and configure it to do so:

  • Click on the installation icon you will find there that looks like this:

Cygwin Install Icon

  • You will be prompted to Save/Run Setup.exe. Do so. Click "Next" when you see the Setup dialog box:

Cygwin Setup Step 1

  • Choose to install from the internet, and click "Next":

Cygwin Setup Step 2

  • Choose your install directory, and click "Next":

Cygwin Setup Step 3

  • Select a download directory, and click "Next":

Cygwin Setup Step 4

  • Select a direct connection, and click "Next":

Cygwin Setup Step 5

  • Select a download site (I just chose the top one), and click "Next":

Cygwin Setup Step 6

If this is the first time you have installed Cygwin, you will see the following message. Click "Ok":

Cygwin Setup Step 6a

  • Now for the important part! We need to choose the proper packages to install in order to build Cog. Expand the "Devel" item in the list:

Cygwin Setup Step 7a

  • Scroll down to the list until you find "gcc: C compiler upgrade helper." Click on "Skip" so it turns into the version number. Note that other dependent options will also be selected:

Cygwin Setup Step 7b

  • Similarly, find "make: The GNU version of the 'make' utility" and click on "Skip":

Cygwin Setup Step 7c

  • Finally, find "subversion: A version control system," and select it as well, then click "Next":

Cygwin Setup Step7d

  • Wait for the load to complete. Create a Desktop Icon and Start Menu Icon if you choose to do so:

Cygwin Setup Step 8

Congratulations! You have successfully set up Cygwin. Now it is time to get the Cog source files...

Get Cog VM sources from the Subversion repository

As indicated in the HowToBuild file referenced above, you must use subversion to download the Cog source files. First, open up a bash command shell by finding your newly installed Cygwin program icon. You should see something like this:

Subversion Step 1

The source folders that you need, and the commands to retrieve them, are also listed in HowToBuild:

svn co http://www.squeakvm.org/svn/squeak/branches/Cog/platforms
svn co http://www.squeakvm.org/svn/squeak/branches/Cog/src
svn co http://www.squeakvm.org/svn/squeak/branches/Cog/cygwinbuild

Enter each command in turn at the command prompt, press enter, and wait for the files to be retrieved:

Subversion Step 2

Subversion Step 3

Subversion Step 4

Almost there! Now all we have to do is compile the sources using the gnu "make" utility we installed earlier...

Build it!

To build the VM "as is" with no additional modifications, enter the following commands at the bash command prompt:

cd cygwinbuild
make

like so:

Make Step 1

Assuming the current source code is properly configured, a lot of activity should happen in the command prompt window, and the build will take a few minutes.

At the conclusion of the build, you should have the Cog VM binary in your build folder. But where is it? Assuming you kept the Cygwin install path in c:cygwin, leave the command prompt and navigate to your Cygwin home folder, which should be similar to:

"C:\cygwin\home\username\cygwinbuild\build\vm"

And should look something like:

Binaries Step 1

Note that "as is" the VM is called "Croquet.exe". Also note that this folder contains "SqueakFFIPrims.dll," which you will also need.

Preparing the image for first time use

To use this with a fresh pharo image, you will need to download the traditional VM, the image and sources, which you can find at

http://www.pharo-project.org/pharo-download

You will need the traditional VM to prepare the image for first time use in the Cog VM at the time of this writing.

For this example, I downloaded:

  • PharoVM-Win32-4.0.2-bin.zip
  • PharoV10.sources.zip
  • Pharo-1.1-11400-rc2dev10.06.1.zip

Unzip them, and put them all in a single folder, like this:

Prepare Image Step 1

Open up the image with Pharo.exe (you can drag the image file onto Pharo.exe). Open a workspace, execute the following code, then save and exit the image:

#(= bitAnd: bitOr: bitShift: bitXor: ~=) do:[:sel|
LargePositiveInteger removeSelector: sel.
].

Prepare Image Step 2

Try it out!

Copy Croquet.exe and SqueakFFIPrims.dll into this folder, replacing the current SqueakFFIPrims.dll, like so:

PrepareImage Step 3

Finally, open up the image you just saved with Croquet.exe (again, you can just drag the image onto Croquet.exe).

Congratulations! Hello Cog! Enjoy!

Prepare Image Step 4

Add a Note

Licensed under Creative Commons BY-NC-SA | Published using Pier |