Ferret 0.9.4 C extensions and Macbook Pro

Hello,

I am developing on a MacBook Pro.
I had installed make and the gcc compiler in order to
take advantage of the C extensions, and I installed the ferret 0.9.4
gem.
When I installed the gem, it compiled the C extensions as part of the
installation
process for the gem, and I received this output:

Attempting remote installation of ‘ferret’
Building native extensions. This could take a while…
dyld: Library not loaded: /usr/i686-apple-darwin8/lib/libgcc_s.1.dylib
Referenced from: /usr/bin/gcc
Reason: image not found
make: *** [analysis.o] Trace/BPT trap
dyld: Library not loaded: /usr/i686-apple-darwin8/lib/libgcc_s.1.dylib
Referenced from: /usr/bin/gcc
Reason: image not found
make: *** [analysis.o] Trace/BPT trap
ruby extconf.rb install --remote ferret
creating Makefile

make
gcc -fno-common -O -pipe
-I/Users/ryan/Desktop/building/min/framework/include -fno-common -pipe
-fno-common -fno-common -I.
-I/Applications/Locomotive2/Bundles/rails112.locobundle/i386/lib/ruby/1.8/i686-darwin8.6.1
-I/Applications/Locomotive2/Bundles/rails112.locobundle/i386/lib/ruby/1.8/i686-darwin8.6.1
-I. -O -pipe -I/Users/ryan/Desktop/building/min/framework/include -c
analysis.c

make install
gcc -fno-common -O -pipe
-I/Users/ryan/Desktop/building/min/framework/include -fno-common -pipe
-fno-common -fno-common -I.
-I/Applications/Locomotive2/Bundles/rails112.locobundle/i386/lib/ruby/1.8/i686-darwin8.6.1
-I/Applications/Locomotive2/Bundles/rails112.locobundle/i386/lib/ruby/1.8/i686-darwin8.6.1
-I. -O -pipe -I/Users/ryan/Desktop/building/min/framework/include -c
analysis.c
Successfully installed ferret-0.9.4
Installing RDoc documentation for ferret-0.9.4…

It appears that it cannot find the dynamic library for the gcc compiler.

I have read about others online that had similiar problems with
compiling C programs, and they just get
rid of the value for the DYLD_FALLBACK_LIBRARY_PATH environment
variable:

DYLD_FALLBACK_LIBRARY_PATH=

Before it was set to
/Applications/Locomotive2/Bundles/rails112.locobundle/i386/lib

But, I can’t do this before I install the gem b/c I also need the
dynamic
libraries in the
/Applications/Locomotive2/Bundles/rails112.locobundle/i386/lib
directory.

I have even copied the libgcc_s.1.dylib file to the
/Applications/Locomotive2/Bundles/rails112.locobundle/i386/lib
directory, and
it said that it found it but could not map to it when it tries to
compile the C extensions.

I have noticed that this dynamic library file is in the /usr/lib
directory
instead of the /usr/i686-apple-darwin8/lib directory.

Are there any ideas on how I can work around this or fix it?

Thanks,

Aaron

On 7/12/06, Aaron H. [email protected] wrote:

ruby extconf.rb install --remote ferret

Before it was set to
directory, and

Aaron

Hi Aaron,

I (sadly) don’t have a mac so I don’t know how the “fallback” path
works but could you please check what your DYLD_LIBRARY_PATH is set
to. Maybe you need to add /usr/lib there although I would have thought
it would be checked by default.

Cheers,
Dave

Hi Aaron,

I (sadly) don’t have a mac so I don’t know how the “fallback” path
works but could you please check what your DYLD_LIBRARY_PATH is set
to. Maybe you need to add /usr/lib there although I would have thought
it would be checked by default.

Cheers,
Dave

Hi Dave,

Thanks for the tip. What I ended up doing was setting the
DYLD_FALLBACK_LIBRARY_PATH environment variable like this:

export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/usr/lib

and everything compiled fine.
The C extensions provided me with a tremendous performance improvement
over the
all Ruby version.

Thanks Again,

Aaron