Browse files

Windows 7, Boost and LLVM 3 part 2

This is a major commit (too big sorry!) that touches nearly every file
in the repo.  There are three signficiant changes represented here:

Firstly there are changes to the extempore lang type system to support
upcoming changes in llvm 3.0+.  These are generally behind the scenes
changes but do slightly effect the syntax and semantics of bind-type.

By default extempore still builds (and expects) against the LLVM 2.8
and 2.9 branches.  Also the examples/extempore_lang.scm file is
for the 2.8 and 2.9 branches.  If you want to use LLVM 3.0+ you will
need to compile against a build of the LLVM 3.0+ branch (still in beta)
and set the EXT_LLVM_3 flag:

./all -DEXT_LLVM_3

Additionally there is a patch required to make the LLVM 3.0 branch
compatible.  You'll need to install this patch before you build
LLVM 3.0.  The LLVM src code patch is supplied as a download option
from github: click on downloads on the main extempore github page
and download the llvm 3 patch.

The second major change is to promote cross platform compatibility
by utilizing the boost libraries.  I'm not much of a fan of boost
to be honest but it seems to be the best of a bad bunch of options
at the moment.  This change largely effects networking and threading
code.  As there is quite a lot of threading and networking code
in extempore this change touches on many parts of the system and
potentially adds new bugs/instability.  I hope this is isn't the
case but ...

By default Extempore will still compile with the old code in place
(i.e. pthreads and unix sockets).  If you want to compile against
the boost libraries (instead if pthreads and unix sockets) you
need to set the EXT_BOOST property.


or if you want boost and LLVM 3


Finally the boost changes have been made in large part to support
Windows.  Or more specifically 64bit Windows 7 - I'm not going to bother
supporting anything ealier.  It MAY work on other Windows systems,
but I'm not going to be bother testing on them.  Everything currently
works nicely on Windows 7 64bit.  I'm am using this at work at the moment
and so can confirm that it is operational and stable.

There is NO official build support for Windows at the moment.  I will
put a zip file containing my extremetly hacky MSVS 2010 project up
on github (in downloads - same as patch file) for those who want to
build their own.  You will also obviously need to install and build
the Boost, LLVM and PortAudio libraries yourself.  If someone would
like to put together a nice cmake project for all of this that would
be wonderful - until that happens your on your own ;)

Because it's a hastle to build all of this on windows I have also put
a pre-built extempore binary for windows in github downloads.  this
is for convenience only.
  • Loading branch information...
1 parent b5ffd5c commit 3a52ed0f2625c2528f3a7cfceb878b717887bfb9 @digego committed Sep 20, 2011
@@ -7,53 +7,58 @@ Prerequisites
Extempore has some library dependencies.
On linux and OSX:
- - LLVM (version 2.8)
- - pthread
+ - LLVM (version 2.8, 2.9 or 3.0)
+ - pthread (if not using boost)
+ OR boost (if not using pthread)
- pcre (Perl Compatible Regular Expressions)
- - glfw (a light weight opengl lib)
On linux you will also need:
- portaudio
- mesa GL (opengl)
- - glut
- (optionally jack)
On OSX you also need the following frameworks:
- opengl
- coreaudio
- cocoa
- - glut
+On Windows 7
+ - LLVM (version 2.8, 2.9 or 3.0)
+ - pcre
+ - boost
+ - portaudio
Most of these are pretty standard and you will probably already have
them on your system (or they will be easy to install). The three that
you are most likely to need to download, compile and install yourself
-are PCRE, GLFW and LLVM (version 2.8). You can find them here:
+are PCRE, PORTAUDIO and LLVM. You can find them here:
PCRE you can get from:
- GLFW you can get from:
+ PORTAUDIO you can get from:
LLVM you can get from:
-PCRE and GLFW should build from the most recent source and should
-"just work". LLVM must be version 2.8. All three should build fine
-with standard defaults - although you do need to provide an install
-location for LLVM. So a simple './configure', then 'make' and then
-'make install' should be sufficient for PCRE and GLFW. LLVM will just
-require an additional build location, so something like './configure
---prefix=~/Documents/ext_llvm' then 'make -j2' and then 'make install'
+PCRE and PortAudio should build from the most recent source and should
+"just work". LLVM must be version 2.8,2.9,3.0. All three should
+build fine with standard defaults - although you do need to provide an
+install location for LLVM. So a simple './configure', then 'make' and
+then 'make install' should be sufficient for PCRE and PORTAUDIO. LLVM
+will require an additional build location, so something like
+'./configure --prefix=~/Documents/ext_llvm' then 'make -j2' and then
+'make install'.
-PCRE and GLFW should be installed in the usual locations
+PCRE and PortAudio should be installed in the usual locations
(i.e. somewhere that gcc can find). LLVM is a special case. You'll
need to do ONE of either (a) copy config/llvm.bash.sample to
config/llvm.bash and edit it according to the prefix install location
you set for LLVM. OR (b) set the EXT_LLVM_DIR shell variable to point
to the prefix install location for LLVM. Make sure you download
-version 2.8 of LLVM!
-(i.e. $ export EXT_LLVM_DIR=~/Documents/ext_llvm)
+version 2.8, 2.9 or 3.0 of LLVM! (i.e. $ export
Once all of the library dependencies for your platform are installed,
you can build extempore using:
@@ -62,6 +67,21 @@ you can build extempore using:
Voila ... you should be done.
+There are a couple of extra build arguments that you may need to use
+1) If you are building against LLVM version 3.0+ you to define
+2) If you wish to build against the boost library you
+need to define EXT_BOOST.
+So to build against LLVM 3.0+ with boost support you would use the
+build command:
+ ./all.bash -DEXT_LLVM_3 -DEXT_BOOST
Ubuntu GNU/Linux Installation
@@ -70,6 +90,9 @@ You'll need some dependencies:
$ sudo apt-get install libpthread-stubs0 libpcre3 libpcre3-dev libglfw2
libglfw-dev glutg3 libglut3 libglut3-dev portaudio19-dev
+If you want to build against the boost libraries you'll also need:
+ $ sudo apt-get install libboost-dev
For now you need to build LLVM from source (it will take some time):
$ wget
@@ -86,25 +109,41 @@ Now you can build Extempore:
$ export EXT_LLVM_DIR=~/Documents/ext_llvm
$ ./all.bash
+OR with LLVM 3.0 and Boost and JACK
NOTE1: If you want to compile against Jack instead of portaudio
provide all.bash with a -DJACK_AUDIO argument (and make sure
that the jack libs and headers are installed correctly!)
-NOTE2: If you are running Ubuntu in VirtualBox (on OSX but also
- possibly on other hosts as well) then you will need to make a
- small source modification and then compile and install glfw
- manually. I haven't spent the time to investigate this properly
- but the following hack will fix it in the short term:
- The required source change is a one liner:
- uninstall any glfw packages that you have installed
- download the glfw 2.7 source
- open the file glfw-2.7/lib/x11/x11_window.c
- then search in the file for GLX_DRAWABLE_TYPE
- comment out the body of the if statement
- now compile and install as normal
+Windows support is new but functional. Boost is mandatory for Extempore
+on WindowYou will need to build BOOST,
+PORTAUDIO and LLVM 3.0+ for yourself. These can all be built as static
+libs. Unfortunately there is currently no build process supported so
+you're on your own. I have an MSVS 2010 project for extempore that
+can get you started if you send me an email.
+Below are a few notes that may help to get you on the right track.
+Some Early Windows Build Notes (for me so I don't forget)
+(a) Make sure you install CMake
+(b) Use CMake to Build LLVM (choose 64bit option)
+(c) Make sure portaudio msvc general project settings are set to static lib
+(d) boost command line for bjam is:
+:> bjam --build-dir=<dir> toodset=msvc link=static address-model=64 --build-type=complete stage
+(e) extempore msvs project settings needs "PCRE_STATIC" to be defined if you want to build against pcre static libs
+(f) extmepore msvs project needs EXT_BOOST and EXT_LLVM_3 to both be defined
+(g) pcreposix.lib needs to come before pcre.lib in link list
@@ -115,8 +154,9 @@ For example:
$ ./extempore runtime
-Once you've started extempore you can connect using either Telnet or
-Emacs (using the included extras/extempore.el file)
+Once you've started extempore you can connect using either Telnet,
+Emacs (using the included extras/extempore.el file), or vim (using
+the included extras/extempore.vim).
If using Telnet the default extempore port to connect to is
7099. Additionally extempore currently takes a second argument (1 for
@@ -1,3 +1,5 @@
Extempore is a new live-coding environment which borrows a core
foundation from the Impromptu environment
( Extempore is named as a nod to the
@@ -9,6 +11,10 @@ end-users. Binaries will be made available when the project reaches a
more user friendly state.
+See the INSTALL notes for build instructions.
Current Status:
@@ -22,9 +28,9 @@ Extempore's support for 3rd party libraries is fully dynamic. This
means that Extempore binds to dynamic libraries at runtime. There are
a number of example libraries which can be found in the libs
directory. Many (although not all) of these libraries require you to
-install a 3rd party library (.so for linux .dylib for OSX). In
-particular there is an 'example' DSP library and a library binding
-Extempore to the Horde3D game engine.
+install a 3rd party library (.so for linux .dylib for OSX, dll for
+Windows). In particular there is an 'example' DSP library and a
+library binding Extempore to the Horde3D game engine.
Although Extempore is immature it is worth mentioning that it is
already being used to develop some substantial audiovisual software.
@@ -33,10 +39,7 @@ already being used to develop some substantial audiovisual software.
Open Source - Open Platform:
-Extempore currently builds on both OSX and Linux platforms and should
-easily port to any UNIX environment. The project intends to also
-extend to the Windows platform at some point in the not to distant
+Extempore currently builds on OSX, Linux and Windows 7 platforms.
The project is released under a BSD style licence.
@@ -49,37 +52,3 @@ developer!
I have started a google group called "Extempore" Joining this group is
probably your best first step in getting involved.
-Here is a list of just a few of the things off the top of my head that
-would be very useful contributions for people to make.
-1) Developer documentation. Doco describing the overall layout of the
-system, the task scheduling system, the various FFI interfaces, any
-build requirements etc.. Of course I'm happy to help with this but it
-would be really great if someone could make a start on this *as they
-learn the system*. That way the doco would be a practical guide from
-someone who is also going through the motions of learning their way
-around. (also a good opportunity to clean up the code!)
-2) End user documentation repo. From experience with the Impromptu
-project it would be great if someone could start working on end-user
-documentation (particularly function documentation) right from the
-outset. This means doco can be added as the system grows rather than
-tagging it on as an after thought. It would be great to integrate the
-doco repository directly into the language infrastructure this time
-3) At this stage Emacs is the only *supported* editor. However, this
-support is extremely rudimentary. It would be excellent if someone
-with some emacs hacking skills could ramp up the extempore.el. It
-would be nice to have some of the features of impromptu's editor
-(better support for keyword highlighting, context sensitive tie in to
-the help system, decent tab-completion and alike)
-4) Port to Windows. Should be reasonably straight forward at the moment.
-5) It would be great to get some kind of basic web site in place.
-6) Most importantly there are many decisions to make in terms of
-development ideas and priorities so join the google group and get your
-hands dirty.
@@ -1,6 +1,7 @@
case $(uname) in
+ *NT*) EXTEMPORE_OS=windows ;;
Linux) EXTEMPORE_OS=linux ;;
Darwin) EXTEMPORE_OS=darwin ;;
*) echo Unsupported OS: $(uname) >&2 ; exit 1 ;;
0 build/ 100644 → 100755
No changes.
@@ -1,4 +1,4 @@
-PLATFORM_LIBS := -lportaudio -lglut /usr/lib/mesa/
+PLATFORM_LIBS := -pthread -lboost_thread -lboost_system -lboost_filesystem -lm -lpcre -lglfw -lportaudio -lglut /usr/lib/mesa/
@@ -2,6 +2,11 @@
;; A basic introduction to the Extempore Language and Compiler
+;; These examples are for Extempore lang for LLVM
+;; versions 2.8 and 2.9.
+;; For recent changes to extempore lang check out
+;; the extempore_lang_3.scm file which supports LLVM 3.0+
;; multiple a * 5
;; note that type infercing works out the type
@@ -8,12 +8,18 @@
;; NOTE!:
;; a) You will need to load the horde3d_lib.scm to bind to Horde3D
-;; b) YOu will need to change the resource path to match your system!
+;; b) You will need to change the resource path to match your system!
+;; (resource path set on line 102)
-(define libglu (sys:open-dylib ""))
-(bind-lib libglu gluLookAt [double,double,double,double,double,double,double,double,double]*)
+(define libglu (if (string=? "Linux" (sys:platform))
+ (sys:open-dylib "")
+ (if (string=? "Windows" (sys:platform))
+ (sys:open-dylib "Glu32.dll")
+ #f)))
+(bind-lib libglu gluLookAt [void,double,double,double,double,double,double,double,double,double]*)
(bind-lib libglu gluPerspective [void,double,double,double,double]*)
(bind-lib libglu gluErrorString [i8*,i32]*)
@@ -22,12 +28,12 @@
(* f (/ 3.141592 180.0))))
;; globals
-(bind-val _knight H3DNode 0)
-(bind-val light H3DNode 0)
-(bind-val _particleSys H3DNode 0)
-(bind-val _particleSys2 H3DNode 0)
-(bind-val _cam H3DNode 0)
-(bind-val _hdrPipeRes H3DNode 0)
+(bind-val _knight i32 0)
+(bind-val light i32 0)
+(bind-val _particleSys i32 0)
+(bind-val _particleSys2 i32 0)
+(bind-val _cam i32 0)
+(bind-val _hdrPipeRes i32 0)
(bind-val _x float 5.0)
(bind-val _y float 3.0)
(bind-val _z float 19.0)
@@ -38,12 +44,12 @@
(bind-val _curFPS float 30.0)
(bind-val _weight float 1.0)
(bind-val _animTime float 0.0)
-(bind-val _forwardPipeRes H3DNode 0)
-(bind-val _deferredPipeRes H3DNode 0)
-(bind-val _fontMatRes H3DNode 0)
-(bind-val _panelMatRes H3DNode 0)
-(bind-val _logoMatRes H3DNode 0)
-(bind-val env H3DNode 0)
+(bind-val _forwardPipeRes i32 0)
+(bind-val _deferredPipeRes i32 0)
+(bind-val _fontMatRes i32 0)
+(bind-val _panelMatRes i32 0)
+(bind-val _logoMatRes i32 0)
+(bind-val env i32 0)
(definec resize
@@ -180,11 +186,12 @@
(define opengl-test
(lambda (time degree)
- (glx:swap-buffers pr2)
+ (gl:swap-buffers pr2)
(callback (+ time 500) 'opengl-test (+ time 1000) (+ degree 0.01))))
-(define pr2 (glx:make-ctx ":0.0" #f 0.0 0.0 1024.0 768.0))
+(define pr2 (gl:make-ctx ":0.0" #f 0.0 0.0 1024.0 768.0))
(resize 1024.0 768.0)
-(opengl-test (now) 0.0)
+(opengl-test (now) 0.0)
Oops, something went wrong.

0 comments on commit 3a52ed0

Please sign in to comment.