Begin main content

GNUstep bleeding edge

For a client project I'm looking into Mac/Linux GUI cross platform options. Naturally GNUstep is high on my list. It's been a while (maybe 10 years) since I even played with GNUstep and I've struggled a bit getting all the latest things to compile together. So, like everyone else, I'm putting together a guide for how I did it since none of the other guides seem to be up to date (and I'm sure mine will be out of date shortly too!)

I'm installing on Ubuntu 12.04, but other Linux platforms will be very similar - just the dependencies might be different.

So firstly about those package dependencies. I've done so many apt-get installs that I've lost track exactly what I needed. Something a bit like this:

sudo aptitude install build-essential git subversion ninja cmake libffi-dev libxml2-dev libgnutls-dev libicu-dev libblocksruntime-dev libkqueue-dev libpthread-workqueue-dev autoconf libtool

Make sure you've uninstalled any older clang or libobjc libraries (otherwise you'll need to be very careful with configure args etc. to specify our compiled versions) and also any older version of libdispatch

Firstly we want the trunk version of llvm/clang. Grit your teeth, because we're going to have to use subversion:

mkdir -p src/gnustep
cd src/gnustep
svn co llvm
cd llvm/tools
svn co clang
cd ..
mkdir build
cd build
cmake ..
make -j4

Now add the following to your .bashrc etc:

export PATH=$PATH:~/src/gnustep/llvm/build/bin
export CC=clang
export CXX=clang++

Now reload your bashrc:

. ~/.bashrc

Check you can find clang:

which clang
clang -v
clang++ 0v

Now we want the latest gnustep libobjc2 with all the latest modern runtime goodies:

cd ~/src/gnustep
git clone
cd gnustep-libobjc2
mkdir build
cd build
cmake ..
make -j4
sudo -E make install

Now add the following to your .bashrc:

export OBJCFLAGS="-fblocks -fobjc-runtime=gnustep"

cd ~/src/gnustep
git clone
cd gnustep-make
./configure --enable-debug-by-default --with-layout=gnustep --enable-objc-nonfragile-abi
sudo -E make install

Now add the following to your .bashrc:

. /usr/GNUstep/System/Library/Makefiles/
. ~/.bashrc

Now we can start installing gnustep itself:

cd ~/src/gnustep
git clone
cd gnustep-base
make -j4
sudo -E make install

If you get warnings about blocks during make, check that you don't have old libobjc libraries on your system. You can specify a particular libobjc library version when you build the gnustep-make package, but easier to just uninstall them.

Now lets run some tests.

make check

The gnustep-base check tests are very handy for making sure you have all the latest things. Warnings you should look out for are things like you haven't enabled blocks or subscripting. If you get warnings like that you should check your OBJCFLAGS etc. At this point I get no failures or skips:

7913 Passed tests 21 Dashed hopes

All OK!

Now we want the latest lib dispatch for all our GCD goodness:

cd ~/src/gnustep git clone git://
cd libdispatch
./configure CFLAGS="-I/usr/include/kqueue" LDFLAGS="-lkqueue -lpthread_workqueue -pthread -lm"
make clean make -j4
sudo -E make install sudo ldconfig

Now we can compile some test code from this post ( which I have pasted into a gist:

clang `gnustep-config --objc-flags` `gnustep-config --objc-libs` -lobjc blocktest.m

clang `gnustep-config --objc-flags` `gnustep-config --objc-libs` -lobjc -ldispatch -lgnustep-base Fraction.m helloGCD_objc.m

And there we are! Ready to install the other gnustep-* modules from github.

08:10 PM, 29 May 2013 by Mark Aufflick Permalink | Comments (0)


Blog Categories

software (41)
..cocoa (23)
  ..heads up 'tunes (5)
..ruby (6)
..lisp (4)
..perl (4)
..openacs (1)
mac (21)
embedded (2)
..microprocessor (2)
  ..avr (1)
electronics (3)
design (1)
photography (26) and white (6)
..A day in Sydney (18)
..The Daily Shoot (6)
food (2)
Book Review (2)


Icon of envelope Request notifications

Syndication Feed


Recent Comments

  1. Mark Aufflick: Re: the go/Inbox go/Sent buttons
  2. Unregistered Visitor: How do make a button to jump to folder
  3. Unregistered Visitor: Note I've updated the gist
  4. Unregistered Visitor: umbrello is now an available port on macPorts
  5. Unregistered Visitor: Updated version on Github
  6. Unregistered Visitor: Modification request.
  7. Unregistered Visitor: Accents and labels with spaces
  8. Unregistered Visitor: Mel Kaye - additional info
  9. Unregistered Visitor: mmh
  10. Mark Aufflick: Thank you