force gem to compile 64-bit libraries

JL's Avatar


08 Nov, 2011 02:14 PM

I am trying to install fastthread gem on solaris with sun studio compiler and 64-bit ruby, but it is trying to build a 32-bit How can I force it to build a 64-bit library? Here is what I get:

# gem install fastthread-1.0.7.gem         
Building native extensions.  This could take a while...
ERROR:  Error installing fastthread-1.0.7.gem:
        ERROR: Failed to build gem native extension.

        /opt/pkg/bin/ruby18 extconf.rb
creating Makefile

cc -I. -I/opt/pkg/lib/ruby/1.8/i386-solaris2 -I/opt/pkg/lib/ruby/1.8/i386-solaris2 -I. -D_REENTRANT -I/usr/include -I/opt/pkg/include/db4  -I/opt/pkg/include   -KPIC -O -features=extensions -D_REENTRANT -I/usr/include -I/opt/pkg/include/db4 -I/opt/pkg/include  -KPIC  -c fastthread.c
cc -G -o fastthread.o -L. -L/opt/pkg/lib -R/opt/pkg/lib -L. -L/opt/SUNWspro/lib -Wl,-R/opt/SUNWspro/lib -L/usr/lib -Wl,-R/usr/lib -L/opt/pkg/lib -Wl,-R/opt/pkg/lib    -R /opt/pkg/lib -L/opt/pkg/lib -lruby18  -lpthread -lrt -ldl -lcrypt -lm -B static -lsunmath -B dynamic -lm -lpthread -lrt  -lc
ld: fatal: file /opt/pkg/lib/ wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to
*** Error code 2
make: Fatal error: Command failed for target `'


  1. Support Staff 1 Posted by Nick Quaranto on 04 Aug, 2012 06:46 PM

    Nick Quaranto's Avatar

    Sorry, this comment was buried in our spam inbox.

    Is this still happening?

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac