AMIDE: Amide's a Medical Imaging Data Examiner


Notes on compiling AMIDE and associated programs on Mac OS X and creating an app bundle

This is a long, involved process, and assumes a good command of standard GNU build environments. Be aware that these notes are fragmentary and may contain bugs and omissions.

At present, (amide 1.0.1) I'm building on OS X 10.6 and it works for both 10.6 and 10.7. It's unclear if building on 10.7 will create a binary that also works on 10.6.

General notes. Not currently using a common framework for gtk, as this is not ready for distribution yet per the site. As such, all libraries (including GTK) will be included in the AMIDE app bundle.

  1. XCode: Need to have XCode installed

  2. amide.modules: Create a file containing the following called amide/amide.modules
    <?xml version="1.0"?>
    <!DOCTYPE moduleset SYSTEM "moduleset.dtd">
    <?xml-stylesheet type="text/xsl" href="moduleset.xsl"?>
      <repository type="tarball" name="sourceforge" default="yes" 
      <repository type="tarball" name="gnu" default="yes"
      <repository type="tarball" name="offis" default="yes"
      <autotools id="dcmtk" makeinstallargs="install install-lib" autogen-sh="configure">
        <branch repo="offis" module="dcmtk/dcmtk360/dcmtk-3.6.0.tar.gz"
      <autotools id="xmedcon" autogenargs="--disable-tpc" autogen-sh="configure">
        <branch repo="sourceforge" module="xmedcon/XMedCon-Source/0.10.7/xmedcon-0.10.7.tar.bz2" 
      <autotools id="gsl" autogen-sh="configure">
        <branch repo="gnu" module="gsl/gsl-1.15.tar.gz"
      <autotools id="volpack" autogen-sh="configure">
        <branch repo="sourceforge" module="amide/volpack/1.0c7/volpack-1.0c7.tgz"
      <autotools id="amide" autogenargs="--enable-amide-debug=no --enable-native-gtk-osx=yes" autogen-sh="configure">
        <branch repo="sourceforge" module="amide/amide/1.0.1/amide-1.0.1.tgz"
        <dep package="libgnomecanvas"/>
        <dep package="xmedcon"/>
        <dep package="gsl"/>
        <dep package="dcmtk"/>
        <dep package="volpack"/>

  3. GTK-OSX install:
      follow Building GTK-OSX directions
      will need to add the following in .bashrc:
           export PATH=~/.local/bin:$PATH
      and run "source .bashrc" to load this into the shell
      If your version of OS X/X Code does not include GIT, will need to
      install it.
      Will need to add this line to the beginning of .jhbuildrc-custom as
      apple's version of libiconv does not play well with the standard
      Will need to setup for 32bit building, as 64bit is currently poorly
      supported by GTK-OSX, and would build an application that only works
      for 10.6/10.7. Will need to edit .jhbuildrc-custom with the
      moduleset and setup_sdk edits suggested under the "Snow Leopard and
      Lion" portion of the building page, except use the following for the
      setup_sdk line:
           setup_sdk(target="10.6", sdk_version="10.6", architectures=["i386"])
      Also should probably add:
           build_policy = "updated-deps"
      to the end of .jhbuildrc-custom to prevent rebuilding dependencies
      that have already been built
      you may also have to edit .jhbuildrc and change:
         os.environ["CC"] = "/usr/bin/gcc-42"
         os.environ["CXX"] = "/usr/bin/g++-42"
         os.environ["CC"] = "/usr/bin/gcc"
         os.environ["CXX"] = "/usr/bin/g++"
      need to build:
    	jhbuild bootstrap
    	jhbuild build meta-gtk-osx-bootstrap
    	jhbuild build meta-gtk-osx-core

  4. Hack to get gtk 2.24.6 to work - a change in gdk_quartz_gc_update_cg_context was made that broke the pixbuf support in libgnomecanvas.

    Get this patch: gtk+-2.24.6_libgnomecanvas_fix.diff.

      jhbuild shell
      cd gtk/source/gtk+-2.24.6
      patch -p1 < gtk+-2.24.6_libgnomecanvas_fix.diff
      make install	      
  5. GTK-OSX additional modules:
      jhbuild build libart_lgpl
      jhbuild -m Source/jhbuild/modulesets/gnome2/gnome-suites-2.32.modules buildone libgnomecanvas

  6. DCMTK: to get dcmtk running
      CFLAGS=-D_DARWIN_C_SOURCE CXXFLAGS=-D_DARWIN_C_SOURCE jhbuild -m amide/amide.modules buildone dcmtk
      [then do the following to get the dictionary built into the library]
      jhbuild shell
      cd ~/gtk/source/dcmtk-3.6.0
      cd dcmdata/libsrc
      make mkdictbi
      ./mkdictbi ../data/dicom.dic ../data/private.dic >
      cd ../..
      make install
      make install-lib
      * dcmtk is currently built as static library. ideal would be a shared lib

  7. XMedCon:
      jhbuild -m amide/amide.modules buildone xmedcon
      * As of version 0.10.7, need to pass the configure option
      --disable-tpc to configure out the Turku ECAT7 library stuff, as it
      errors out during building. A patch to fix this problem has been
      submitted to xmedcon.
      * xmedcon binary errors out, appears to be a problem with
      gtk_style_get_font in fancy.c. It's okay for now, as all we really
      need for amide is the library.

  8. Volpack:
      jhbuild -m amide/amide.modules buildone volpack

  9. GSL:
      jhbuild -m amide/amide.modules buildone gsl

  10. FFMPEG:
      (to get the latest version)
      svn checkout svn:// ffmpeg
      cd ffmpeg
      note, the below configure script doesn't recognize ~ as the home directory
      ./configure --prefix=/Users/loening/gtk/inst --enable-shared --disable-static --arch=x86_32
      [ edit config.mak, add "-arch i386" to the end of CFLAGS and LDFLAGS]
      make install
      cd ~/gtk/inst/include
      ln -s ./ ffmpeg

  11. AMIDE:
      jhbuild -m amide/amide.modules buildone amide
      When building amide, it'll give you errors about being unable to
      import libxml2. I haven't gotten around to fixing this, it's only a
      problem with the help files so I'm skipping it for now. Just use
      option 2 (ignore errors and continue).

  12. BUNDLING:. Using ige-mac-bundler-0.6.0.tar.gz
    unpack, cd into the directory
       make install
    grab the amide.bundle, amide.icns, amide.plist, gtkrc, and
    file from the gtk/source/amide-XYZ/macosx directory.
    Edit, and insert the current [VERSION] where specified
    near the top.
    $ jhbuild shell
    $ export PATH=$PREFIX/bin:~/.local/bin:$PATH
    $ ige-mac-bundler amide.bundle

  13. To get the gdkpixbuf loaders working correctly (needed to export JPEG's)
      gdk-pixbuf-query-loaders | \
      sed 's#/Users/.*loaders/#@executable_path/../Resources/lib/gdk-pixbuf-2.0/loaders/#' \
      > ~/Desktop/

  14. And finally:
      zip -r amide-[VERSION]

last modified AML 2011-11-25 Validate: CSS & HTML Project hosted by: Logo