| CompilingFluxusForMacOSX_newone | HomePage PageList |
|
Hey there, welcome to the updated page of the CompilingFluxusForMacOSX howto. Since there were so many code changes in the development process of fluxus - the old howto of Dan got slightly outdated and after some intensive communication on the mailing-list a one was required. But i'd recommend always to have a look at the old version - especially if you are interested in compiling older versions of fluxus (<0.9). Being in a state of testing only - there are no guarenties that my (and Dans) result will also work on your mac or will lead to "unforseen consequences" - so take this text as a recommendation - not more, not less. Have Fun! greebo_at_wolke7_dot_net ============================================================= part 1: my system Currently tested it only on my 1.5Ghz Powerbook G4 with MacOS 10.4.6 and XCode 2.2 (will test it with 2.3 asap) with gcc 3.3 and gcc 4.0.1. Right now everything should work with the 4.0.1 - if it doesn't - it's worth to try the old one, especially if you have troubles with "CASTs" user@system# sudo gcc_select <version> ============================================================= part 2: dependencies "Fluxus brings together a lot of different ideas, so there are quite a few dependancies" - Fluxus homepage To get a fast overview of how things will be installed, the following list will group all the necessary software deps. Note: see the bottom of the page for updated info on getting all the dependencies -- it's much easier now! built-in software --> no additional installation required (opengl) : rendering software installed via DarwinPorts (fftw) : audio analysis (version 3 or above) (libsndfile) : audio files (libtiff) (libjpeg) (libpng) : image i/o (scons) : Construction building tool The DarwinPorts package management sytem easies the installation for quiet a lot standard unix software. So it copes with dependencies, updates and compile settings (software will be installed from source!). short installation advisory: - Get a recent version of DarwinPorts - (actual 1.2.1) - update it, if necessary via: user@system src# sudo port -d selfupdate Note that DarwinPorts will create the directory "/opt/local" as its root directory - hence you can delete DarwinPorts just by removing the directory. So now your building enivronment should be up to date and you can install the above mentioned software via: user@system src# sudo port install fftw-3 libsndfile libpng tiff scons As a sideeffect the zlib and the libjpeg will be installed as dependencies, so everything is done in this section. software installed manually (ode) : physics engine (guile) : scripting (version 1.8.0 ! or higher) (jack) : audio interface (liblo) : osc support (glew) : OpenGL Extension Wrangler Library This part will deal with software one has to install complete from source. Actually there are different reasons, either there is no (actual) version in the ports repository (guile, liblo, jack) or the ports do not a provide static libs (ode), which are necessary to make a standalone application. For some other details look into CompilingFluxusForMacOSX. Another prerequisite before we can start. It rather came in handy for me to install also this software under /opt/local/ otherwise one would maybe had to install some dependencies two or three times on a system. Therefore it is necessary to adjust the compile settings a lit bit (where it is necessary). ode: - Get ode 0.5 (will try ode 0.6 asap) user@system src# tar xvzf ode-0.5.tgz user@system src# cd ode-0.5/ user@system src/ode-0.5# make ode-lib user@system src/ode-0.5# sudo cp -r include/ode /opt/local/include/ode user@system src/ode-0.5# sudo cp lib/libode.a /opt/local/lib/libode.a user@system src/ode-0.5# sudo ranlib /opt/local/lib/libode.a Last step is necessary for the configuration of the SConstruct script, else the detection of ode could fail. ode 0.9: Updated by Matt Peddie February 27 2008 (added notes -below- by alejo duque april 20, 2008) This is for ode 0.9 on Mac OS X 10.4.11 on a Powerbook G4. DarwinPorts (MacPorts) is at version 1.6. System GCC is still 4.0.1. - Get the svn sources of ode 0.9 user@system src$ svn co https://opende.svn.sourceforge.net/svnroot/opende/trunk opende user@system src$ cd opende - In order to get things to build correctly, specify the path so that autogen will run using the up-to-date DarwinPorts GNU version of most of the auto utilities. user@system src/opende$ PATH=/opt/local/bin:$PATH ./autogen.sh I also specified arch=7450 for my particular G4 chip. Don't just copy this unless you've got the same CPU. You can find more PowerPC architecture shortcuts at the GNU GCC site and the corresponding i386/amd64 shortcuts at the same site. user@system src/opende$ ./configure --enable-release --enable-shared --with-trimesh=gimpact --with-arch=7450 It doesn't seem that ode 0.9 has an ode-lib target for make. I didn't investigate too closely, but it worked when I just built the whole thing. user@system src/opende$ make && sudo make install That should do it. It did it under OS X 10.5 using SVN code guile: - Get guile 1.8.0 user@system src# tar xvzf guile-1.8.0.tar.gz user@system src# cd guile-1.8.0 user@system src# ./configure LDFLAGS='-L/opt/local/lib -R/opt/local/lib' CPPFLAGS='-I/opt/local/include' --prefix=/opt/local/ --infodir=/opt/local/share/info/ --mandir=/opt/local/share/man CFLAGS="-no-cpp-precomp -Dmacosx" The configure script takes care of the individual settings of the DarwinPorts installation and MacOSX. LDFLAGS, CPPFLAG, --prefix, --infodir, --mandir (DarwinPorts) CFLAGS (gcc setting for MacOSX) user@system src# make user@system src# sudo make install (in my case april. 2008 i had to add this: ad$ port install gmp then version 1.8.4 compiled with no problems) jack: - Get jack 0.100.0 (will try 0.101.1 asap) and build a static library user@system src# tar xvzf jack-audio-connection-kit-0.100.0.tar.gz user@system src# cd jack-audio-connection-kit-0.100.0 user@system src/jack-audio-connection-kit-0.100.0# ./configure --enable-static LDFLAGS='-L/opt/local/lib -R/opt/local/lib' CPPFLAGS='-I/opt/local/include' --prefix=/opt/local/ --infodir=/opt/local/share/info/ --mandir=/opt/l ocal/share/man CFLAGS="-no-cpp-precomp -Dmacosx" user@system src/jack-audio-connection-kit-0.100.0# make user@system src/jack-audio-connection-kit-0.100.0# sudo make install for jack-0.102.20 you need to apply the following patch: --- drivers/dummy/dummy_driver.c.orig Sun Dec 10 16:31:55 2006 +++ drivers/dummy/dummy_driver.c Sun Dec 10 16:32:27 2006 /* this is used for calculate what counts as an xrun */ #define PRETEND_BUFFER_SIZE 4096 +#define VIDEO_SYNC_PERIOD 48000 / 30 + void FakeVideoSync( dummy_driver_t *driver ) { - static const int VIDEO_SYNC_PERIOD = 48000 / 30; static int vidCounter = VIDEO_SYNC_PERIOD; int period = driver->period_size; liblo: - Get liblo 0.23 and build a static library user@system src# tar xvzf liblo-0.23.tar.gz user@system src# cd liblo-0.23 user@system src/liblo-0.23# ./configure --enable-static LDFLAGS='-L/opt/local/lib -R/opt/local/lib' CPPFLAGS='-I/opt/local/include' --prefix=/opt/local/ --infodir=/opt/local/share/info/ --mandir=/opt/l ocal/share/man CFLAGS="-no-cpp-precomp -Dmacosx" user@system src/liblo-0.23# make user@system src/liblo-0.23# sudo make install glew: to be documented... So, now we have everything installed right under "/opt/local" ============================================================= part 3: fluxus itself Firstly, you have to check out the actual cvs content with: user@system src # cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/fluxus co fluxus Before you can build the binary with scons, you have to adjust the "SConstruct" file. 10:GuileVersionMajMin = "1.8" 11:GuilePrefix = "/opt/local" 18:LibPaths = Split("/usr/local/lib /opt/local/lib") The next few lines have to be inserted right before the line "Default(env.Program(source = Source, target = Target))". Hmm time to 'enhance' the SConscript to support our new library locations, linker flags and defines. - from the original howto 112:if ARGUMENTS.get('MACOSX', 0): 113: env.Append( CPPDEFINES = "APPLE" ) 114: Libs = Split( "m Xi Xmu Xext Xt SM ICE X11 pthread") 115: optlibs = Split( "sndfile guile fftw3 png tiff jpeg z jack ode lo") 116: for lib in optlibs: 117: Source += ["/opt/local/lib/lib"+lib+".a"] 118: env.Append( LINKFLAGS = "-framework OpenGL -framework glut -framework CoreAudio -framework CoreFoundation" ) Now, we are ready to launch the build script with user@system src/fluxus# scons MACOSX=1 If for unknown reasons some library checks fail - but you are sure they are installed, you can outcomment them in the LibList? part of the "SConstruct" file with a "#". Erm and thats it for the binary. A quick look at the dynamic dependencies shows that all we rely now is the OpenGL, glut, CoreAudio & CoreFoundation frameworks and some standard system libraries: user@system src/fluxus# otool -L fluxus fluxus: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/GLUT.framework/Versions/A/GLUT (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 368.27.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.5) /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /opt/local/lib/libpng.3.dylib (compatibility version 3.0.0, current version 3.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) ============================================================= part 4: create a package THIS PART IS A COPY OF THE ORIGINAL HOWTO SINCE I HAVE STILL SOME PROBLEMS TO CREATE MACOSX PACKAGES Finally we need to package up the binary into a Mac OS X app. Here's the contents of my Fluxus.app: Fluxus.app/ Contents/ Info.plist MacOS/ fluxus guile_scripts/ ice-9/ <contents of the guile ice-9 directory> Resources/ fluxus.icns Everything in there is pretty standard apart from the ice-9 directory which is copied directly from the guile-1.6.7 distribution. If you need more information on creating this kind of app bundle you should check out the "Bundle Programming Guide" on the apple developer website (http://www.apple.com/developer) and for more info on the Info.plist file I found the "Runtime Configuration Guidelines" document very handy too. ============================================================= Updated build instructions, again by Matt Peddie, June 29 2008: I checked out fluxus from CVS and did this on OS X 10.5.3, on a Powerbook G4 1.5GHz. Darwinports was at version 1.6. I had Apple Developer Tools 3.0. Based on my experience building this on the same computer when it had OS X 10.4.11, this should all work fine with the older Apple Developer Tools and the same version of Darwinports. - You can get all the dependencies from Darwinports except PLT Scheme with frameworks. user@system src/fluxus$ sudo port install scons ode fftw-3 jack libsndfile liblo glew libpng tiff guile freetype - Next get PLT Scheme from subversion: user@system src/fluxus$ svn checkout http://svn.plt-scheme.org/plt/trunk plt PLT Scheme has instructions for building on OS X. I did the following: user@system plt/src$ ./configure --prefix=/usr/local/ --enable-pthread --enable-libfw --enable-sdk=/Developer/SDKs/MacOSX10.5.sdk --enable-lt=glibtool PLT likes GNU libtool better than Apple libtool. I also had a strange problem where the build tools didn't escape spaces in the path to the directory in which I was building. I tried fixing bit by bit, but eventually the easiest thing to do was to simply move the plt/ directory someplace where the path to it contained no spaces and build there. Maybe I'm just stupid. - SCons seems to be very poor at figuring out whether or not libraries are installed. I've never used it before, so again, perhaps I'm missing something simple, but I just went into the SConstruct file and commented out the entries in LibList? that I knew were present. You may have to add /usr/X11/include to the include path at some point. Furthermore, SCons seems to rely on having your environment variable PLATFORM set to 'darwin' thus: user@system src/fluxus$ export PLATFORM=darwin which doesn't seem to be the default under OS X. #666666:=============================================================~~ ende |
|
This work is licensed under a Creative Commons License |