Contact Search RSS Feed

Building a Pharo/Squeak VM from first Principles

I've been building and modifying Squeak VMs for a couple of years, but each time I started afresh it took me considerable amount of time to set up a working toolchain. Changes in Pharo, VMMaker, platform C code, make files, in system libraries etc. can introduce subtle problems and the official documentation typically is obsolete. To help me – and others – be faster next time, I wrote the following step-by-step guide to build a Unix VM on OSX 10.6.

0. Preparation

Make sure you have xcode installed (http://developer.apple.com/tools/xcode/).
Install cmake >= 2.6.2 from http://www.cmake.org/

Create a work directory on your desktop (it is important it has no spaces!):

mkdir ~/Desktop/vmbuilding; cd ~/Desktop/vmbuilding

Let’s download a fresh Pharo image for later testing. In case you are behind a proxy, set the variable http_proxy to make wget work.

export http_proxy=http://<proxy server>
wget http://gforge.inria.fr/frs/download.php/25397/Pharo1.0-10508-rc2dev10.01.2.zip
unzip Pharo1.0-10508-rc2dev10.01.2.zip

Next we check out the VM platform-specific C sources and make files

svn co http://squeakvm.org/svn/squeak/trunk/platforms/ -r 2151

Note the use of hardcoded revision numbers to make sure these instructions still work in the future.

1. Compile from existing source

We start by compiling the source that come with Subversion. This allows us to test the basic setup without the sources we will generate ourselves.

cd platforms; mkdir build; cd build
../unix/cmake/configure --without-RomePlugin --without-vm-display-Quartz
make

If you got here without any errors you can try to start the new VM. Since Quartz does not work anymore on Snow Leopard, we use X11 as display driver and hence have to start up X11 first:

open /Applications/Utilities/X11.app
./squeak ~/Desktop/vmbuilding/Pharo1.0-10508-rc2dev10.01.2/Pharo1.0-10508-rc2dev10.01.2.image &

The Pharo image should start up now. Print “SmalltalkImage current vmVersion”, which shows the version of the image from which the VM source was built.
The result should be 'Squeak3.10.2 of ''5 June 2008'' [latest update: #7179]'.

Print and store the result of “1 tinyBenchmarks” then quit the image.

2. Install VMMaker

Start up the same image with your Mac VM:
open ~/Desktop/vmbuilding/Pharo1.0-10508-rc2dev10.01.2/Pharo1.0-10508-rc2dev10.01.2.image

In a workspace in the Pharo image do the following. If you are behind a proxy first let Pharo know. Then load VMMaker through the following Metacello config (thanks Torsten!):

HTTPSocket useProxyServerNamed: '<proxy server>' port: <port>.
Gofer new
      squeaksource: 'MetacelloRepository';
      package: 'ConfigurationOfVMMaker';
      load.
((Smalltalk at: #ConfigurationOfVMMaker) project version: '1.2') load

This takes some time. When it finished loading, we open the VMMaker GUI:

Preferences disable: #raiseDeprecatedWarnings.
VMMakerTool openInWorld

3. Configure VMMaker and generate sources

First let’s backup the original sources

mv ../unix/src ../unix/src_original

In the VMMaker GUI:
Change path to platform code: /Users/<user>/Desktop/vmbuilding/platforms
Change path to generated sources: /Users/<user>/Desktop/vmbuilding/platforms/unix/src
Don’t forget to accept the changed field by cmd-s. Leave the other settings unchanged.

Make all plugins internal (right-click in list of plugins). Then select as not built (you can drag and drop between lists): Aio, FFT, FT2, InternetConfig, MacMenubar, Mpeg3, QuickTime, Security, Sound, TestOSA

Select as external:  B3DAccelerator, FFI, FileCopy, HostWindow, MIDI, UUID, XDisplayControl.

Note, that I haven't cared to make Freetype work and have just excluded it above. In a related blog post, Laurent describes how to patch Freetype to compile on Linux.

Evaluate the following expression to force the use of LF for line breaks (else the awk script triggered by cmake does not properly work).

MultiByteFileStream defaultToLF.

Click the button Entire to generate the VM sources in the directory ./unix/src/. After the VMMaker has completed, save and quit the image.

4. Compile the new sources

We create a new build directory and compile the source we created in step 3.

mkdir ../build_new; cd ../build_new
../unix/cmake/configure --without-vm-display-Quartz
make
./squeak ~/Desktop/vmbuilding/Pharo1.0-10508-rc2dev10.01.2/Pharo1.0-10508-rc2dev10.01.2.image &

If you get here without an error, you made it! Congrats! ;)

5. Benchmarks

A good way to test the healthiness of a new VM is to run the tiny benchmarks.

1 tinyBenchmarks

The result should be similar to the ones you obtained in step 1.

On my MacBook Pro 10.6.2 with 2.4GHz Intel Core 2 Duo, gcc 4.0.1 I got
479400749 bytecodes/sec; 12303286 sends/sec.

Posted by Adrian Lienhard on March 11, 2010

Seasidehosting now runs Pharo

I'm happy to announce that www.seasidehosting.st now supports Pharo!

There are no special settings or configurations needed. Get a Pharo/Seaside image, for instance from www.seaside.st/download/pharo, install your application, and upload it to seasidehosting.st.

Before, Pharo was not supported because the special VM used did not run closure images. Since many people asked for support of Pharo, we've updated the VM. It took some time, but as promised, we managed to finish it before the upcoming Pharo 1.0 release.

I'd like to thank ESUG and netstyle.ch for their continuous support of SeasideHosting!

Posted by Adrian Lienhard on January 28, 2010

Pharo Sprint in Lille, France

Aoround 20 people attended the Pharo sprint in Lille, France, which took place from 17th to 20th October 2009. Our main target was to finish version 1.0. We managed to fix several long-standing problems and eventually the unit tests – over 7000 in total – all passed. As a result we published a first release candidate replacing the current beta version.

Another area of work was to start off 1.1-alpha. Since we are going to provide maintenance updates for 1.0 after its release, there are now two parallel update streams. For version 1.1 we defined the following milestones:

New preferences system

Integrate Alien

Improve code quality (e.g., make selected Lint tests pass)

Continuous integration system

It was a great sprint with many enthusiastic people who were eager to take Pharo one step further. Thanks to everyone, and especially to Stef and his group for the hosting and INRIA for the financial support.

Posted by Adrian Lienhard on October 22, 2009

PhD thesis awarded the Ernst Denert-Stiftung Prize

My PhD thesis, Dynamic Object Flow Analysis, has been awarded the 2009 Ernst Denert-Stiftung Prize for Software Engineering. This renowned prize is awarded every year for the best dissertation and carries a value of €5000.  I received the award during the annual GI conference (Gesellschaft für Informatik E.V) in Germany last week.

My thesis is available online and can be ordered as a book (see Publications).

lienhard1.jpg (700 KB)

Receiving the award from Prof. Dr. Ernst Denert during the annual GI conference.

Congratulations

Congratulations!
Looks like you did quite a good job, though! :)

Pharo Goes Beta

External Page: pharo.png (43 KB)

More than 1.5 years after Pharo was born, we are happy to announce the first beta release! At this point, there are still known problems, but no major changes will be introduced anymore.

The system is stable enough to get serious testing now. Various people already reported that they are using Pharo in their (commercial) projects.

 

In spring of 2008, Pharo was started as a fork of Squeak 3.9. The name "Pharo" evolved from suggestions like Beacon, Tombolo, Atoll, Lagoon, Lighthouse, etc. Our mission statement is the following:

Pharo's goal is to deliver a clean, innovative, open-source Smalltalk environment. By providing a stable and small core system, excellent developer tools, and maintained releases, Pharo is an attractive platform to build and deploy mission critical Smalltalk applications. Pharo is MIT licensed and is steered by a board of benevolent dictators. The board makes final decisions if no consensus can be reached within the community. Pharo fosters a healthy ecosystem of both private and commercial contributors who advance and maintain the core system and its external packages.

Until today the core image has seen 400 batches of updates. The following list gives an overview of important achievements:

Integration of Polymorph GUI and widgets

Integration of FreeType font support with subpixel anti aliasing

Menu cleanups and operating system menu support for OS X

Removal of EToys, MVC, MorphicExtras, SqueakMap, Sound, and various cruft

Full block closure support

MIT license clean

Reduction of the memory footprint

Many enhancements, such as regex, new input sensor, new preference browser

800 closed issues in the bug tracker

 

The increasing number of people that contribute and use Pharo indicates that the project is on the right track. Here are just three excerpts from mails posted to the mailing list during the last two months:

"Pharo is the most exciting thing to come along for me in quite awhile!" – Steve Wirts (June 19)

"[...] you have an organization which is able to deliver"
– Janko Mivšek (June 23)

"I absolutely believe Pharo is 100% on the right track, and a critical component in a potential Smalltalk resurgence." – Robert Peters (July 9)

Also the download statistic of the Pharo image shows that Pharo has already found quite some interest (lines show number of downloads per month for the Squeak-dev resp. Pharo image):

picture_7.png (40 KB)

Thanks to Damien Cassou for building Pharo images and providing the statistics

 

What's left for the final release of 1.0? The list of open issues for milestone 1.0 tracks the remaining tasks. Also, we need to decide on the packages (developer tools) that are integrated in the official Pharo image by default. But we don't plan to keep the beta tag forever, so stay tuned...

Posted by Adrian Lienhard on July 31, 2009

Pharo Sprint in Bern (July 4, 2009)

Yesterday, we sprinted for almost 12 hours and I am quite amazed what we achieved during this time.

We focused on fixing and integrating the issues relevant for the upcoming 1.0 release. In total, 18 batches of updates were pushed into the stream. During the sprint, the bug tracker has been updated 135 times!

We also made progress fixing failing tests, improving the speed of OmniBrowser (David and Alex), writing the Pharo by Example book (Oscar), and creating a first version of http://en.wikipedia.org/wiki/Pharo.

The 10 participants were: Alexandre Bergel, Andreas Leidig, David Röthlisberger, Fabrizio Perin, Lukas Renggli, Niko Schwarz, Oscar Nierstrasz, Philippe Marschall, Stef Ducasse, and me (taking the pictures).

Many thanks to http://scg.unibe.ch to host the sprint and sponsor the pizza!

Concentrated working atmosphere...
Niko, Alex, and Andreas
Stef, Lukas, and Philippe

Posted by Adrian Lienhard on July 5, 2009

Cool sprint

Indeed it was intense. I could not program after...
We should redo that in the fall.

Alright

I'll be around

Looks ...

like I missed a nice and productive sprint :).

Tags

Archive

2010>>
January
February
March
April
May
June
July
August
September
October
November
December

Contact

 

 

 

Cmsbox and netstyle.ch

Adrian Lienhard
Terrassenweg 18
3012 Bern, SWITZERLAND
Phone: +41 31 356 42 56


Institute postal address

Physical address

Adrian Lienhard
Institut für Informatik (IAM)
Universität Bern
Neubrückstrasse 10
3012 Bern, SWITZERLAND

Institut für Informatik (IAM)
Schützenmattstrasse 14
3012 Bern
Room 102

Messaging & Social Networks

Twittertwitter.com/adrianlienhard
Linkedinwww.linkedin.com/in/adrianlienhard
Facebookwww.facebook.com/adrianlienhard
Skypealienhard
ICQ12377774

Send me a message!

CMSBOX Powered by cmsbox