Image Science on Leopard

by Adam Maddox Nov 5th, 2007 at 4:37 PM

Updated: Monday 18th February 2008. Correction to makefile again! Apparently the previous change didn’t take =) Thanks to Peter Dunord for pointing this out.

Updated: Wednesday 21st November 2007. Corrections made to Makefile.osx naming and rubyinline install added to list.

Here is a quick guide to getting image_science working on your new leopard install. Full Credit to Michael Steinfeld for his directions on the ruby forum.

1. Install and update ruby_inline

1.1 Install

sudo gem install RubyInline

1.2 Update

cd /Library/Ruby/Gems/1.8/gems/RubyInline-3.6.4/lib
mate inline.rb

replace

flags = @flags.join(' ')

with

flags = @flags.join(' ') + ' -lruby'
cd 
rm -rdf ./ruby_inline

2. Ensure that xCode was installed with 10.3.9 support

2.1 Install from the leopard disk.

Links below show screenshots for installing 10.3.9 support

2.2 Check if you have it installed

$ ls /Developer/SDKs/
MacOSX10.3.9.sdk 
MacOSX10.4u.sdk
MacOSX10.5.sdk

3. Download FreeImage

Link

4. Edit Makefile.osx LIBRARIES

mate ~/Downloads/FreeImage/Makefile.osx

replace lines

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

with

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

5. Install Free Image (ignore ppc symbol errors)

cd FreeImage
make
sudo make install

6. Install Image Science

sudo gem install image_science

7. Test

irb
>> require 'image_science'
>> true

Thanks to Tim Lucas for the corrections via James Hill.

Blog_1_blog_column_imageBlog_2_blog_column_imageBlog_3_blog_column_imageBlog_5_blog_column_image