Forum: Ruby-Gnome 2 failing to install atk from gem

8e6374c0ef7b66942f34798e31edf014?d=identicon&s=25 "Dobai-Pataky Bálint" <dpblnt@gmail.com> (Guest)
on 2011-01-31 21:30
(Received via mailing list)
Attachment: gem_make.out (60 KB)
Hi,

I tried to install ruby-gtk2 from gem, but got an error building atk
(attached)
Is there something i could do to make it compile?
Thanks
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2011-01-31 23:56
(Received via mailing list)
Hi,

2011/2/1 Dobai-Pataky Blint <dpblnt@gmail.com>:

> I tried to install ruby-gtk2 from gem, but got an error building atk
> (attached)
> Is there something i could do to make it compile?

Could you try without "-Wl,--no-undefined" link option?

And could you show us your Makefile?


Thanks,
--
kou
16cf9621fcc1017b6f428d2d7806f63d?d=identicon&s=25 Mamoru Tasaka (Guest)
on 2011-02-01 06:46
(Received via mailing list)
Kouhei Sutou wrote, at 02/01/2011 07:56 AM +9:00:
> And could you show us your Makefile?
>
>
> Thanks,
> --
> kou
>

I see build error on glib2 0.90.6 gem (and perhaps also on other 0.90.6
gems)
like:

make
gcc -I. -I. -I/usr/lib/ruby/1.8/i386-linux -I.
-I/usr/lib/ruby/site_ruby/1.8/i386-linux  -I/usr/lib/ruby/1.8/i386-linux
-DHAVE_RB_DEFINE_ALLOC_FUNC -DHAVE_RB_BLOCK_PROC -DHAVE_OBJECT_ALLOCATE
-DHAVE_NODE_ATTRASGN -DHAVE_UNISTD_H -DHAVE_G_SPAWN_CLOSE_PID
-DHAVE_G_THREAD_INIT -DHAVE_G_MAIN_DEPTH -DHAVE_G_LISTENV
-DHAVE_RB_CHECK_ARRAY_TYPE -DHAVE_RB_EXEC_RECURSIVE
-DHAVE_RUBY_SET_CURRENT_SOURCE -DHAVE_RB_CURR_THREAD
-DRUBY_GLIB2_COMPILATION  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
-fasynchronous-unwind-tables -Wall -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -pthread  -c glib-enum-types.c
gcc -shared -o glib2.so rbgutil.o rbgobj_param.o rbglib_win32.o
rbgobj_boxed.o rbgobj_typeinstance.o rbglib_timer.o rbgobj_enums.o
rbglib_pollfd.o rbglib_iochannel.o rbglib_keyfile.o rbglib_threads.o
rbglib_maincontext.o rbgobj_type.o rbgobj_valuearray.o rbgobject.o
rbgobj_typemodule.o rbgutil_callback.o rbgobj_strv.o rbglib_shell.o
rbglib_completion.o rbgobj_typeinterface.o rbglib_error.o
rbgobj_object.o rbgobj_paramspecs.o rbglib.o rbglib_int64.o
rbgobj_closure.o rbgobj_typeplugin.o rbglib_unicode.o rbglib_spawn.o
rbgobj_fundamental.o rbglib_fileutils.o rbglib_i18n.o rbglib_messages.o
rbglib_bookmarkfile.o rbglib_convert.o glib-enum-types.o rbgobj_signal.o
rbglib_source.o rbglib_utils.o rbgobj_value.o rbglib_mainloop.o
rbgobj_valuetypes.o rbgobj_convert.o -L. -L/usr/lib -L.  -rdynamic
-Wl,-export-dynamic -pthread -pthread    -lruby  -lgobject-2.0
-lglib-2.0 -lgthread-2.0 -lrt -lgthread-2.0 -lrt -lglib-2.0 -lpthread
-lrt -ldl -lcrypt -lm   -lc
/usr/bin/ld: i386:x86-64 architecture of input file `rbgutil.o' is
incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `rbgobj_param.o' is
incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `rbglib_win32.o' is
incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `rbgobj_boxed.o' is
incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file
`rbgobj_typeinstance.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `rbglib_timer.o' is
incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `rbgobj_enums.o' is
incompatible with i386 output
....
....
rbgobj_enums.o: In function `flags_initialize':
/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2/rbgobj_enums.c:693:
undefined reference to `rb_num2uint'
rbgobj_enums.o: In function `flags_coerce':
/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2/rbgobj_enums.c:888:
undefined reference to `rb_num2uint'
rbgobj_enums.o: In function `rbgobj_get_flags':
/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2/rbgobj_enums.c:551:
undefined reference to `rb_num2uint'
rbglib_iochannel.o: In function `ioc_set_buffer_size':
/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2/rbglib_iochannel.c:563:
undefined reference to `rb_num2uint'
rbglib_iochannel.o: In function `ioc_write_unichar':
/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2/rbglib_iochannel.c:435:
undefined reference to `rb_num2uint'
rbglib_iochannel.o:/home/kou/work/ruby/ruby-gnome2/glib2/ext/glib2/rbglib_iochannel.c:438:
more undefined references to `rb_num2uint' follow
/usr/bin/ld: rbgutil.o: file class ELFCLASS64 incompatible with
ELFCLASS32
/usr/bin/ld: final link failed: File in wrong format
collect2: ld returned 1 exit status
make: *** [glib2.so] Error 1


This is because glib2 0.90.6 gem contains pre-compiled .o objects and
i386 gcc/ld
fail to use them. Build failure Dobai may be related to this issue
(although I use i686
and Dobai uses x86_64).

Would you release "clean" gem again?

Regards,
Mamoru
8e6374c0ef7b66942f34798e31edf014?d=identicon&s=25 "Dobai-Pataky Bálint" <dpblnt@gmail.com> (Guest)
on 2011-02-01 07:17
(Received via mailing list)
Attachment: Makefile (395 Bytes)
Which Makefile?
This is what I did:
cd /usr/local/lib64/ruby/gems/1.8/gems/atk-0.90.6/
ruby extconf.rb

And that generated a Makefile. I attached it. Is that what you asked
for?
8e6374c0ef7b66942f34798e31edf014?d=identicon&s=25 "Dobai-Pataky Bálint" <dpblnt@gmail.com> (Guest)
on 2011-02-01 07:25
(Received via mailing list)
Attachment: Makefile (6 KB)
Or it might be this one you asked for.
8e6374c0ef7b66942f34798e31edf014?d=identicon&s=25 "Dobai-Pataky Bálint" <dpblnt@gmail.com> (Guest)
on 2011-02-01 07:38
(Received via mailing list)
I found the way to remove "-Wl,--no-undefined" ,
it was in the second Makefile where ldflags options are defined.
I removed it and compiled atk with the following result:
# make
(cd ext/atk && make)
make[1]: Entering directory
`/usr/local/lib64/ruby/gems/1.8/gems/atk-0.90.6/ext/atk'
x86_64-pc-linux-gnu-gcc -shared -o atk.so rbatktable.o rbatkvalue.o
rbatkdocument.o rbatkimage.o rbatkstate.o rbatk.o rbatkselection.o
rbatktextrectangle.o rbatkcomponent.o rbatkregistry.o
rbatkgobjectaccessible.o rbatkimplementor.o rbatknoopobjectfactory.o
rbatkobject.o rbatkrelationset.o rbatktext.o rbatkhypertext.o
rbatknoopobject.o rbatkinits.o rbatkstateset.o rbatkeditabletext.o
rbatkrelation.o rbatkstreamablecontent.o rbatkhyperlink.o rbatkutil.o
rbatkobjectfactory.o rbatkaction.o rbatktextrange.o -L. -L/usr/lib64
-Wl,-R/usr/lib64 -L. -Wl,-O1 -Wl,--as-needed -rdynamic
-Wl,-export-dynamic -pthread    -Wl,-R -Wl,/usr/lib64 -L/usr/lib64
-lruby18  -latk-1.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0
-lpthread -lrt -ldl -lcrypt -lm   -lc
make[1]: Leaving directory
`/usr/local/lib64/ruby/gems/1.8/gems/atk-0.90.6/ext/atk'
make -f Makefile.lib
make[1]: Entering directory
`/usr/local/lib64/ruby/gems/1.8/gems/atk-0.90.6'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory
`/usr/local/lib64/ruby/gems/1.8/gems/atk-0.90.6'

Then i ran 'gem install atk' hoping that it'll use the already compiled
stuff, but failed again, and the Makefile is regenerated, containing the
"-Wl,--no-undefined"  option. How can i prevent that option from being
regenerated?

Thanks

Balint
8e6374c0ef7b66942f34798e31edf014?d=identicon&s=25 "Dobai-Pataky Bálint" <dpblnt@gmail.com> (Guest)
on 2011-02-01 08:22
(Received via mailing list)
This is how i was able to install it: gem install gtk2 --
--with-ldflags='-L. -Wl,-O1 -Wl,--as-needed -rdynamic
-Wl,-export-dynamic'

Thanks
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2011-02-02 13:07
(Received via mailing list)
Hi,

The attached Makefile is what I asked for. Thanks!!!

I've released 0.90.8 gem.
Since the release, you don't need to add --with-ldflags.

Thanks,
--
kou

In <4D47A73E.9020702@gmail.com>
  "Re: [ruby-gnome2-devel-en] failing to install atk from gem" on Tue,
01 Feb 2011 08:25:02 +0200,
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2011-02-02 13:09
(Received via mailing list)
Hi,

In <4D4797AC.7040809@ioa.s.u-tokyo.ac.jp>
  "Re: [ruby-gnome2-devel-en] failing to install atk from gem" on Tue,
01 Feb 2011 14:18:36 +0900,
  Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> wrote:

> I see build error on glib2 0.90.6 gem (and perhaps also on other 0.90.6 gems)
> like:
...
> This is because glib2 0.90.6 gem contains pre-compiled .o objects and i386
gcc/ld
> fail to use them. Build failure Dobai may be related to this issue (although I
use i686
> and Dobai uses x86_64).
>
> Would you release "clean" gem again?

Ahh...
I've released 0.90.7 gems.
They don't include *.o. :-o


Thanks,
--
kou
8e6374c0ef7b66942f34798e31edf014?d=identicon&s=25 "Dobai-Pataky Bálint" <dpblnt@gmail.com> (Guest)
on 2011-02-03 16:39
(Received via mailing list)
You're fast,
Thank you
Balint
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.