New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to build #10

Closed
mookie- opened this Issue Feb 26, 2012 · 14 comments

Comments

Projects
None yet
10 participants
@mookie-
Copy link

mookie- commented Feb 26, 2012

Hi,
I have the following problem build charlock_holmes.

I'm using Gentoo with ruby 1.9.3p125.

Can someone please tell me what I'm doing wrong or whats missing.

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby19 extconf.rb 
checking for main() in -licui18n... yes
checking for main() in -licui18n... yes
checking for unicode/ucnv.h... yes
  -- tar zxvf file-5.08.tar.gz
  -- ./configure --prefix=/home/gitlab/.gem/ruby/1.9.1/gems/charlock_holmes-0.6.8/ext/charlock_holmes/dst/ --disable-shared --enable-static --with-pic
  -- make -C src install
  -- make -C magic install
checking for main() in -lmagic_ext... yes
checking for magic.h... yes
creating Makefile

make
compiling converter.c
common.h:23:14: warning: ‘charlock_new_str’ defined but not used
common.h:32:14: warning: ‘charlock_new_str2’ defined but not used
compiling encoding_detector.c
common.h:14:14: warning: ‘charlock_new_enc_str’ defined but not used
compiling ext.c
common.h:14:14: warning: ‘charlock_new_enc_str’ defined but not used
common.h:23:14: warning: ‘charlock_new_str’ defined but not used
common.h:32:14: warning: ‘charlock_new_str2’ defined but not used
linking shared-object charlock_holmes.so
converter.o: In function `rb_converter_convert':
converter.c:(.text+0x80): undefined reference to `ucnv_convert_48'
converter.c:(.text+0xc0): undefined reference to `ucnv_convert_48'
converter.c:(.text+0x139): undefined reference to `u_errorName_48'
encoding_detector.o: In function `rb_get_supported_encodings':
encoding_detector.c:(.text+0x9f): undefined reference to `uenum_count_48'
encoding_detector.c:(.text+0xca): undefined reference to `uenum_next_48'
encoding_detector.c:(.text+0x12e): undefined reference to `uenum_next_48'
encoding_detector.c:(.text+0x16d): undefined reference to `uenum_next_48'
encoding_detector.c:(.text+0x1b1): undefined reference to `uenum_next_48'
encoding_detector.c:(.text+0x1fd): undefined reference to `uenum_next_48'
encoding_detector.o:encoding_detector.c:(.text+0x23e): more undefined references to `uenum_next_48' follow
encoding_detector.o: In function `rb_encdec__alloc':
encoding_detector.c:(.text+0x774): undefined reference to `u_errorName_48'
./libmagic_ext.a(compress.o): In function `uncompressgzipped':
/home/gitlab/.gem/ruby/1.9.1/gems/charlock_holmes-0.6.8/ext/charlock_holmes/src/file-5.08/src/compress.c:357: undefined reference to `inflateInit2_'
/home/gitlab/.gem/ruby/1.9.1/gems/charlock_holmes-0.6.8/ext/charlock_holmes/src/file-5.08/src/compress.c:363: undefined reference to `inflate'
/home/gitlab/.gem/ruby/1.9.1/gems/charlock_holmes-0.6.8/ext/charlock_holmes/src/file-5.08/src/compress.c:370: undefined reference to `inflateEnd'
collect2: ld returned 1 exit status
make: *** [charlock_holmes.so] Error 1
@ondrowan

This comment has been minimized.

Copy link

ondrowan commented Mar 13, 2012

+1

I have the same issue on Gentoo.

@mauritslamers

This comment has been minimized.

Copy link

mauritslamers commented Mar 17, 2012

+1

The problem here is the linking. The source of it seems to be underlinking in some way (See: http://wiki.mandriva.com/en/Underlinking)
When removing -Wl,--no-undefined from the make file (in ext/charlock_holmes/) the module links without issues.

@mauritslamers

This comment has been minimized.

Copy link

mauritslamers commented Mar 17, 2012

The default setting of -Wl, --no-undefined in the rubygems config causes problems under Gentoo it seems.
Removing the setting in /usr/lib/ruby/1.9.1/i686-linux/rbconfig.rb allows charlock_holmes to link.

@mookie-

This comment has been minimized.

Copy link

mookie- commented Mar 17, 2012

Thank you very much mauritslamers!
Is this now solved and I should close it or just a workaround?

@mauritslamers

This comment has been minimized.

Copy link

mauritslamers commented Mar 17, 2012

I think this is a problem with Gentoo and rubygems, and not charlock_holmes specifically (see also https://github.com/fractaloop/libv8/issues/8). I would say that it is a workaround, because having to adjust the main configuration of rubygems to get it working should not be necessary. Perhaps the link to the libv8 problem has more info on how to do it properly.

@a3li

This comment has been minimized.

Copy link

a3li commented May 27, 2012

I wrote an ebuild for this and use the following patch (that also removes bundled code):

https://github.com/a3li/a3li-overlay/blob/master/dev-ruby/charlock_holmes/files/extconf.patch

@alexeik

This comment has been minimized.

Copy link

alexeik commented May 28, 2012

+1 same issue on cygwin.

@alexeik

This comment has been minimized.

Copy link

alexeik commented May 29, 2012

patch for extconf.rb has helped me

@alexeik

This comment has been minimized.

Copy link

alexeik commented May 29, 2012

you know) "world of sources" is world of shit)
one sources cant be applied to any open OS .
sad sad sad.

@globalcitizen

This comment has been minimized.

Copy link

globalcitizen commented Sep 20, 2012

Thanks a3li, that solved things for me, too. I must compliment you on your handy position at the top of the layman overlays list ;)

@dscherger

This comment has been minimized.

Copy link

dscherger commented Jan 4, 2013

replacing
CONFIG["LDFLAGS"] = "-L. -Wl,-O1 -Wl,--as-needed -rdynamic -Wl,-export-dynamic -Wl,--no-undefined"
with
CONFIG["LDFLAGS"] = "-L. -Wl,-O1 -Wl,--as-needed -rdynamic -Wl,-export-dynamic"
in /usr/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb
works for me on gentoo with ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

@edouard-lopez

This comment has been minimized.

Copy link

edouard-lopez commented Mar 24, 2013

@mauritslamers @dscherger modification work for me too with dev-lang/ruby-1.9.3_p392 ebuild

@cup

This comment has been minimized.

Copy link

cup commented Apr 19, 2014

@brianmario can we get a new release? No release in 2 years, and this issue was fixed by #41 11 months ago.

@brianmario

This comment has been minimized.

Copy link
Owner

brianmario commented May 11, 2014

Pushing a new release shortly, sorry it took so long!

@brianmario brianmario closed this May 11, 2014

methodmissing pushed a commit to bear-metal/charlock_holmes that referenced this issue Jul 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment