Inkscape with OpenMP support on OS X Lion: First attempt at build script (WIP)
On 03/02/2012 23:03, ~suv wrote:
due to license restrictions in MacOs X, there are problems with compile Inkscape with OpenMP support.
The underlying issue is the rather old version of GCC Apple provides with Xcode [1] . Due to license changes in GCC, Apple will never upgrade to a later GCC version than 4.2.1, and eventually drop GCC completely in favor of CLANG. Building Inkscape with a custom-installed newer GCC version doesn't work out-of-the-box due to ABI conflicts in linked C++interface libraries [2].
Update: Since the time I had discussed the details impeding OpenMP support on Mac OS X with Kris on irc, I did manage to produce stable builds of 0.48.2, 0.48.x and current trunk with full OpenMP support (64bit builds with GCC 4.6.2 (MacPorts) on OS X 10.7.2 Lion). I'm currently working on a shell script as 'proof-of-concept' and to allow easier testing of the build setup on other systems. The script does not create a bundled osx application yet (this might be added later on).
[1] http://article.gmane.org/gmane.comp.graphics.inkscape.devel/36355 [2] http://wiki.inkscape.org/wiki/index.php/FAQ#On_Linux.2C_Inkscape_crashes_with_.22invalid_pointer.22_message
quoted from https://bugs.launchpad.net/inkscape/+bug/200415
Attached is an initial attempt (WIP) of a build script which allows to compile the following Inkscape versions on OS X 10.7.2 Lion in 64bit with OpenMP support (using GCC 4.6.2):
- Inkscape 0.48.2 (from tar ball) - Inkscape 0.48.x (from lp:inkscape/0.48.x) - Inkscape trunk (from lp:inkscape) with cairo devel 1.11.2 - Inkscape mesh (from lp:~tavmjong-free/inkscape/mesh) with cairo master
What the script basically does: ------------------------------- - rebuilds all C++ interfaces outside of MacPorts with GCC 4.6.2 (libsigc++, glibmm, atkmm, cairomm, pangomm, gtkmm) - builds cairo-devel (+ cairomm, pangomm, gtkmm) for trunk - builds cairo-master (+ cairomm, pangomm, gtkmm) for mesh branch - builds inkscape with GCC 4.6.2, linking to the new libs
What it does not (yet): ----------------------- - create universal binaries or - create an osx application bundle - build with Quartz backend of GTK+ - fancy error handling: if something fails and you can't figure out how to fix it, you might simply delete $localSRC and $inkPREFIX and try again (or use './osx-build-inkgcc46.sh del_all) - optimize to the max (ATM everything is compiled with -02) - ...
Prerequisites are: ================== - OS X Lion (tested on 10.7.2 with Xcode 4.2.1) - MacPorts (up-to-date), gtk2 with X11 backend (!) - port 'inkscape' installed in MacPorts (for all dependencies) - ports autoconf, automake and dbus-glib installed in MacPorts - port 'gcc46' installed in MacPorts (for the compiler) - $PATH is set up accordingly for MacPorts (the script does not override nor try to verify it in any way)
How to use it: ============== 1a) edit the script file and adjust the paths for: LIBPREFIX (MacPorts install prefix) localSRC (directory to unpack the sources and compile) inkPREFIX (top-level dir for installation of inkscape+dependents) 1b) optionally reuse (clone or branch) local repos for inkscape 0.48.x, trunk, pixman, cairo and / or inkscape mesh branch (see script) 2) use a build target as command line argument: release | branch | trunk | mesh for example:
$ ./osx-build-inkgcc46.sh trunk
3) grab a cup of coffee and wait for the build to finish 4) launch the inkscape binary with its full path name Note: DYLD_LIBRARY_PATH is needed for trunk and mesh (as displayed in a note if the installation was successful), for example:
$ DYLD_LIBRARY_PATH=$inkPREFIX/cairo-devel/lib $inkPREFIX/trunk/bin/inkscape
5) updating local source trees of inkscape branch, trunk and mesh: you can update from parent branch and rebuild by rerunning the script with the same target. The script ought to test and detect already installed libs as well as the local repo, pull new revisions and rebuild as needed. Alternatively, you can cd into '$localSRC/inkscape-trunk/build' (or '$localSRC/inkscape-mesh/build'), and use 'bzr pull', 'make && make install' as usual.
Note: you can install multiple targets without changing $inkRPEFIX (the builds install into different sub-directories)
Feedback, comments, improvements, test and bug reports about the script (to me personally, or here on the list - not in the bug tracker) would be welcome :)
** (inkscape:79650): WARNING **: the script is unstable and buggy in its current state - use at your own risk ;-). It was _not_ written with regular Mac users in mind - ideally it would be improved/reworked and extended to allow to create precompiled osx application bundles of trunk (and experimental feature branches), which then could be uploaded and shared for testing.
~suv
participants (1)
-
~suv