Installing Freeimage + image_science on Leopard

If you're new here, you may want to subscribe to our RSS feed. Thanks for visiting!

So I upgraded to Leopard the other day (actually I did a clean install), and all is well until I attempted to start a rails project that uses image_science. image_science depends on Freeimage as I’m sure you’re aware, and the Freeimage install was failing spectacularly. Google to the rescue! Here’s how I got it to install:

From http://www.ruby-forum.com/topic/129554#578387

1. I started with a clean install of Leopard.
2. Install macports for 10.4
3. Install the xcode dev tools from the Leopard disk – *be sure to also install the 10.3 sdk from the xcode dev tools install*
4. sudo port install freeimage
5. cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_freeimage/work/FreeImage
and change this:

LIBRARIES_PPC = -Wl,-syslibroot /Developer/SDKs/MacOSX10.3.9.sdk
LIBRARIES_I386 = -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk
to this

LIBRARIES_PPC = -Wl,-syslibroot /Developer/SDKs/MacOSX10.3.9.sdk/usr/lib
LIBRARIES_I386 = -Wl,-syslibroot /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
6. sudo port install freeimage
7. sudo gem install -y imagescience
8. cd /Library/Ruby/Gems/1.8/gems/RubyInline-3.6.4/lib
9. edit inline.rb
look for the line

flags = @flags.join(' ')
and change it to
flags = @flags.join(' ') + ' -lruby'
10. remove ~/.ruby_inline

Some notes:

Step #5 pertains to the file Makefile.osx

Before attempting to install freeimage again in step #6, be sure to cd out of /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_freeimage/work/FreeImage
I just did a “cd ~” before “sudo port install freeimage”

Big thanks and all credit to original posters Thomas Mango and Michael Steinfeld for this information.

5 Comments

  1. Johan Laidlaw
    Posted January 29, 2009 at 2:29 am | Permalink

    Thanks for the help. I also had to change MacOSX10.3.9 to MacOSX10.5 everywhere in the Makefile.osx to make it work.

  2. Posted January 29, 2009 at 2:29 am | Permalink

    The Image Science gem has an underscore in it.

    sudo gem install -y image_science

  3. Posted January 29, 2009 at 2:29 am | Permalink

    not sure what magic led to this, but I didn’t need to install the 10.3 sdk or make any makefile mods. A file called patch-Makefile.osx-Leopard.diff seemed to automatically update the library paths.

    just
    sudo port install freeimage
    and
    sudo gem install image_science

    granted i’m running the installers 8 months later

  4. Posted January 29, 2009 at 2:29 am | Permalink

    not sure what magic led to this, but I didn’t need to install the 10.3 sdk or make any makefile mods. A file called patch-Makefile.osx-Leopard.diff seemed to automatically update the library paths.

    just
    sudo port install freeimage
    and
    sudo gem install image_science

    granted i’m running the installers 8 months later

  5. Posted January 29, 2009 at 2:29 am | Permalink

    hey ))
    its very reasonable point of view.
    Good post.
    realy good post

    thank you ;)

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">