file_logo

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.

General notes. Not currently using a common framework for gtk, as this is not ready for distribution yet per the gtk-osx.sf.net 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"?>
    <moduleset>
    
      <repository type="tarball" name="sourceforge" default="yes" 
    	      href="http://downloads.sourceforge.net/project/"/>
    
      <repository type="tarball" name="gnu" default="yes"
    	      href="http://mirrors.ecvps.com/gnu/"/>
    
      <repository type="tarball" name="offis" default="yes"
    	      href="ftp://dicom.offis.de/pub/dicom/offis/software/"/>
    
      <autotools id="dcmtk" makeinstallargs="install install-lib" autogen-sh="configure">
        <branch repo="offis" module="dcmtk/dcmtk360/dcmtk-3.6.0.tar.gz"
    	    version="3.6.0"/>
      </autotools>
    
      <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" 
                version="0.10.7"/> 
      </autotools>
    
      <autotools id="gsl" autogen-sh="configure">
        <branch repo="gnu" module="gsl/gsl-1.15.tar.gz"
    	    version="1.15"/>
      </autotools>
    
      <autotools id="volpack" autogen-sh="configure">
        <branch repo="sourceforge" module="amide/volpack/1.0c7/volpack-1.0c7.tgz"
    	    version="1.0c7"/>
      </autotools>
    
      <autotools id="amide" autogenargs="--enable-amide-debug=no --enable-native-gtk-osx=yes" autogen-sh="configure">
        <branch repo="sourceforge" module="amide/amide/1.0.0/amide-1.0.0.tgz"
    	    version="1.0.0"/>
        <dep package="libgnomecanvas"/>
        <dep package="xmedcon"/>
        <dep package="gsl"/>
        <dep package="dcmtk"/>
        <dep package="volpack"/>
      </autotools>
    
    </moduleset>
    

  3. GTK-OSX install:
      Goto http://www.gtk-osx.sourceforge.net
    
      follow Building GTK-OSX directions
    
      will need to add the following in .bashrc:
           export PATH=/opt/amide-1.0.0/inst/bin:/Users/loening/.local/bin:$PATH
      and run "source .bashrc" to load this into the shell
      
      will need to install GIT
    
      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. will need to edit .jhbuildrc-custom
      with the moduleset and setup_sdk edits suggested under the
      "Snow Leopard" 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
    
      will also have to edit .jhbuildrc, change:
         _root = os.path.expanduser("~/gtk")
      to 
         _root = os.path.expanduser("/opt/amide-[VERSION]")
      where [VERSION] is the current amide version.
    
      need to build:
    	jhbuild bootstrap
    	jhbuild build meta-gtk-osx-bootstrap
    	jhbuild build meta-gtk-osx-core
      

  4. GTK-OSX additional modules:
      jhbuild build gconf
      jhbuild build libart_lgpl
      jhbuild -m Source/jhbuild/modulesets/gnome2/gnome-suites-2.32.modules buildone libgnomecanvas
    

  5. 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]
      cd /opt/amide-[VERSION]/source/dcmtk-3.6.0
      cd dcmdata/libsrc
      make mkdictbi
      ./mkdictbi ../data/dicom.dic ../data/private.dic > dcdictbi.cc
      make
      cd ../..
      make install
      make install-lib
    
      notes/todo 
      * dcmtk is currently built as static library. ideal would be a shared lib
    

  6. XMedCon:
      jhbuild -m amide/amide.modules buildone xmedcon
    
      notes/todo
    
      * 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.
    

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

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

  9. FFMPEG:
      (to get the latest version)
      svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
      cd ffmpeg
    
    
      ./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
      make install
      cd /opt/amide-[VERSON]/inst/include
      ln -s ./ ffmpeg
    

  10. 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).
    
    

  11. 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 launcher.sh
    file from the gtk/source/amide-XYZ/macosx directory.
    
    Edit launcher.sh, and insert the current [VERSION] where specified
    near the top.
    
    then:
    $ jhbuild shell
    $ export PATH=$PREFIX/bin:~/.local/bin:$PATH
    $ ige-mac-bundler amide.bundle
    

  12. To finish up things in the AMIDE.app package, copy the following from /opt/amide-[VERSION]/inst into the following locations:
      Resources/lib/libavcodec.dll
      Resources/lib/libavutil.dll
      Resources/lib/libavcore.dylib
      Resources/libexec/ [whole directory]
      Resources/lib/GConf [whole directory]
    
    To make sure our built software isn't written over:
      cp /opt/amide-[VERSION] to a new location
    
    To finish up the package in the Resources directory:
      ln -s ./ inst
      mkdir -p var/lib/dbus
    
    And finally:
      zip -r  --symlinks amide-[VERSION]_osx_v1.zip AMIDE.app
    





last modified AML 2011-11-09 Validate: CSS & HTML Project hosted by: SourceForge.net Logo