wiki:Documentation/BuildingStXWithRakefiles

Version 3 (modified by jan vrany, 8 years ago) ( diff )

--

(Re)compiling your own Smalltalk/X with Rakefiles (Linux only)

This text describes how to build and/or recompile your own Smalltalk/X jv-branch using Smalltalk/X rakefiles. Note, that rake build environment is not the official build tool for Smalltalk/X.

This page is out-of-date. Updating it is work-in-progress: see #89 and #90.

Required software

Tools

  • subversion
  • cvs
  • rake (version 10.0.3 running on ruby 1.9 - it won't work with Ruby 1.8.x!!!)
  • bison
  • flex
  • ant
  • standard C toolchain (GCC, binutils, make)

Libraries - you'll need following packages together with their "dev" part (that contain C headers etc)

Debian, Ubuntu, Mint and derivates:

sudo aptitude install ant bison flex build-essential libc6-dev libx11-dev libglib2.0-dev libwebkitgtk-dev libsoup2.4-dev libxext-dev unixodbc-dev

If you're running 64bit OS, you'll need also 32bit libraries (as Smalltalks/X is currently only 32bit)

sudo aptidude install ia32-libs libc6-dev-i386 gcc-multilib

Beware, some distributions (e.g. Ubuntu 12.04) don't create needed symlinks, even when the packages are installed correctly. To fix this issue, customize and execute following commands:

sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
sudo ln -s /usr/lib/i386-linux-gnu/libXext.so.6 /usr/lib/i386-linux-gnu/libXext.so
sudo ln -s /usr/lib/i386-linux-gnu/libXinerama.so.1 /usr/lib/i386-linux-gnu/libXinerama.so
sudo ln -s /usr/lib/i386-linux-gnu/libodbc.so.1 /usr/lib/i386-linux-gnu/libodbc.so
sudo ln -s /usr/lib/i386-linux-gnu/libodbcinst.so.1 /usr/lib/i386-linux-gnu/libodbcinst.so

Fedora 14/x86_64

(thanks to Martin Kobetic)

sudo yum install glib2.i686 libX11.i686 libXext.i686 qt-webkit.i686 libsoup.i686 libX11-devel.i686

Fedora 16/x86_64

(thanks to Martin Kobetic)

sudo yum install glib2.i686 libX11-devel.i686 libXext-devel.i686 qtwebkit.i686 libsoup.i686

Note: the list of packages may not be complete, please send us an email. If something is missing, then compilation will likely fail because of missing header file or library. Best way how to figure out which package is missing is to search for requested file on http://packages.debian.org, http://packages.ubuntu.com or similar.

Setting up a build tree

A build tree is a directory structure that contains all the sources and scripts required to compile your Smalltalk/X. Setting up a build tree is not just checking it out from a CVS/SVN or whatever as your Smalltalk/X environment may contain packages from various sources.

Downloading an existing build tree from Jenkins

The easiest way how to set up your own build tree is to download it from Jenkins server. Select a project and search for an artifact file ending with 'build_tree' (such as smalltalkx-jv-branch-6.2.1_build191_linux-gnu_x86_build_tree.tar.bz2)

To setup a build tree on your computer:

  1. download a build tree archive from Jenkins,
  2. unpack it - inside you should find a directory builder containing Rakefile,
  3. change CVS root using provided script (changeCVSroot.sh). Use :pserver:cvs@cvs.smalltalk-x.de:/cvs/stx as new CVS root unless you're member of SWING and have a shell-access to SWING servers.

The hard way - creating a build tree from scratch

To create a build tree from scratch:

  1. check out rakefiles (svn checkout https://swing.fit.cvut.cz/svn/stx/goodies/builder/trunk/rake)
  2. select a project and let rake to checkout all the sources (rake PROJECT=stx:jv-branch checkout)

Note that you'll need to setup a VPN connection to checkout some essential components of Smalltalk/X. Alternatively, you may copy them from a downloaded build tree.

(Re)compiling Smalltalk/X

Once a build tree is (correctly) set up, type

rake compile 

If it does not end up with an error, you're one of the few lucky guys! You managed to (re) compile Smalltalk/X. If not, then it's hard to say what went wrong. You may want to check [buildenvironment/troubleshooting troubleshooting page]... If it compiles, you may start your new Smalltalk/X by following command:

./projects/smalltalk/smalltalk -I --quick

in subdirectory build/stx. The -I means "do not load an image", --quick means "do not load autoloaded classes".

If you have just downloaded a build tree from Jenkins, compilation should take couple of minutes. If you have clean build tree, full compilation may take from 1-2 hours (on Intel 2GHz Core 2 Duo - GCC is really slooooow compiler).

To test compilation when using Jenkins build tree: As the Jenkins build trees does contain all the .o files, if you do a rake compile, actually nothing is really compiled - the build tool just checks that everything is compiled and that there's nothing to (re)compile. To check whether compilation really works, you may:

  1. go to build/stx/libbasic3 (or any other package, this one is good for testing as it is small and not many packages depend on it).
  2. run make clobber (not the 'make' instead of 'rake'!)
  3. run rake compile again. Now you should see individual .st files compiling.

Works? Excellent. Miracle. :-)

Updating a build tree

As the development goes, your build tree may get outdated. To update it, issue

rake update

this command will update source of all packages in the build tree. Of course, you may update individual packages manually using cvs update or svn updade. Subsequent

rake compile

should recompile the system.

Development Workflow

My (meaning JV's :-) typical development workflow is the following: I have two separate build trees, say jv1 and jv2.

  1. update and compile a build tree jv1 (rake update compile)
  2. start the smalltalk from jv1 (cd build/stx && ./project/smalltalk/smalltalk -I --quick)
  3. do the main development in Smalltalk/X IDE, as usual.
  4. once done, commit all changes back to SVN/CVS repositories.
  5. while having Smalltalk/X jv1 still running, update the second build tree jv2.
  6. check if it compiles fine, if not, fix it go to 4.
  7. close the running Smalltalk/X (jv1), go to 1.

Troubleshooting

When things go wrong, check this troubleshooting checklist for common problems (and solutions).

Note: See TracWiki for help on using the wiki.