Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
nscogbuild script for a modern ubuntu 64bit system

How To Compile Cog VM on Ubuntu 12.10 64bit

Disclaimer: I used these instructions and the ubuntu_mvm script to build a Newspeak VM. However, this should be easily adaptable to a Squeak Cog build. It probably works on other modern linux systems, but I haven't tested any other distro. Please tell me if it does (not) work for you.

  • svn co

    Note: git svn clone -r 2701 didn't gave me a sane state (files missing)

  • sudo apt-get install libasound2-dev:i386

    sudo apt-get install build-essential ia32-libs gcc-multilib g++-multilib 
    libc6-i386 libc6-dev-i386 libx11-dev:i386 libbsd-dev:i386 uuid-dev:i386
    libice-dev:i386 libxext-dev:i386 mesa-common-dev:i386 libsm-dev:i386 libgl1-mesa-dev:i386
    libssl-dev:i386 libfreetype6-dev:i386 libpng12-dev:i386 libxt-dev:i386 libbsd-dev:i386

    I listed all libraries I installed while trying to make the configure checks happy. You might not need all of them.

  • download SqueakV41.sources (

  • put the sources in ~/Squeak/ or specify the path in the ubuntu_mvm script

  • use the ubuntu_mvm script (Ubuntu 12.10 64bit tested)

Further Reading

# This file should be executed in an up to date Ubuntu 64bit
# It may work on other distros, but I haven't tested them.
# Place it in the nscogbuild/unixbuild/bld directory.
# We tell gcc to compile for 32bit (through -m32 option)
# We use -O1 optimization (and not -O2) see: and
# We use the -fno-caller-saves CFLAG, see:
# configure your desired installation directory
# configure the path for the squeak sources file download link for SqueakV41.sources ->
echo -n "clean? [Yn]"
read a
case $a in
n|no|N|NO) echo "ok but this isn't safe!!";;
*) make reallyclean
test -f config.h || ../../../platforms/unix/config/configure \
CC="gcc -m32" CXX="g++ -m32" \
--with-src=nscogsrc \
--without-vm-display-fbdev --without-npsqueak \
LIBS="-ldl -luuid -lpthread" \
rm -rf ../../../$INSTALLDIR
make install prefix=`readlink -f \`pwd\`/../../../$INSTALLDIR`
(cd ../../../$INSTALLDIR
echo `pwd`
if [ -f squeak ]; then
mv squeak nsvm
ex -u NONE "+g/squeak/s/squeak/nsvm/g" +w +q nsvm
if [ -f bin/squeak ]; then
mv bin/squeak bin/nsvm
ex -u NONE "+g/squeak/s/squeak/nsvm/g" +w +q bin/nsvm
rm -rf man doc
LIBDIR="`echo lib/squeak/[0-9.-]*`"
test -f $LIBDIR/squeak && mv $LIBDIR/squeak $LIBDIR/nsvm
test -d lib/squeak && mv lib/squeak lib/nsvm
LIBDIR="`echo lib/nsvm/[0-9.-]*`"
if [ -h $SQUEAK_SOURCES ]; then
ln "`readlink $SQUEAK_SOURCES`" $LIBDIR
elif [ -f $SQUEAK_SOURCES ]; then
echo "can't find SqueakV41.sources" 1>&2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.