brianmario / charlock_holmes

Character encoding detection, brought to you by ICU
MIT License
1.04k stars 142 forks source link

Install failure on RedHat #23

Open richmidwinter opened 11 years ago

richmidwinter commented 11 years ago

Using RedHat 6 I try and run a gem install charlock_holmes but it fails:

gem install charlock_holmes
Building native extensions.  This could take a while...
ERROR:  Error installing charlock_holmes:
    ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for main() in -licui18n... no
which: no brew in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
checking for main() in -licui18n... no

***************************************************************************************
*********** icu required (brew install icu4c or apt-get install libicu-dev) ***********
***************************************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby
    --with-icu-dir
    --without-icu-dir
    --with-icu-include
    --without-icu-include=${icu-dir}/include
    --with-icu-lib
    --without-icu-lib=${icu-dir}/lib
    --with-icui18nlib
    --without-icui18nlib
    --with-icui18nlib
    --without-icui18nlib

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/charlock_holmes-0.6.9 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/charlock_holmes-0.6.9/ext/charlock_holmes/gem_make.out
tgaff commented 11 years ago

this worked on centOS 6:

sudo yum install libicu-devel
gem install charlock_holmes -- --with-icu-dir=/usr/lib/icu/
krantiparisa commented 11 years ago

using RHEL 6.3 and not able to install

gem install charlock_holmes -- --with-icu-dir=/usr/lib/icu/ Building native extensions. This could take a while... ERROR: Error installing charlock_holmes: ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb --with-icu-dir=/usr/lib/icu/ mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/charlock_holmes-0.6.9.4 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/gem_make.out

tubit commented 11 years ago

Did you install patch / patchutils? After that I was able to install charlock_holmes.

fenglyu commented 9 years ago

Using RedHat 6.3, and I tried to run gem install charlock_holmes -v '0.6.9.4' with root but got the same error, This is quite frustrating cause it has been two days and I still have no clue even I tried compiling icu4c from source

The wired thing is that I am able to installed it on CentOS6.5 and 6.6, but not on Redhat 6.3, although libicu and libicu-devel are the same version on both OS.

# gem install charlock_holmes -v "0.6.9.4"
Building native extensions.  This could take a while...
Successfully installed charlock_holmes-0.6.9.4
Parsing documentation for charlock_holmes-0.6.9.4
Done installing documentation for charlock_holmes after 0 seconds
1 gem installed
# cat /etc/redhat-release 
CentOS release 6.5 (Final)
# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.3 (Santiago)
# gem install  charlock_holmes -v '0.6.9.4'
Building native extensions.  This could take a while...
ERROR:  Error installing charlock_holmes:
        ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb
checking for main() in -licui18n... no
which: no brew in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
checking for main() in -licui18n... no

***************************************************************************************
*********** icu required (brew install icu4c or apt-get install libicu-dev) ***********
***************************************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/ruby
        --with-icu-dir
        --without-icu-dir
        --with-icu-include
        --without-icu-include=${icu-dir}/include
        --with-icu-lib
        --without-icu-lib=${icu-dir}/lib
        --with-icui18nlib
        --without-icui18nlib
        --with-icui18nlib
        --without-icui18nlib

extconf failed, exit code 1

Gem files will remain installed in /usr/local/lib/ruby/gems/2.1.0/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/charlock_holmes-0.6.9.4/gem_make.out

Here is a section from the log mkmf.log

      1 have_library: checking for main() in -licui18n... -------------------- no
      2 
      3 "gcc -o conftest -I/usr/local/include/ruby-2.1.0/x86_64-linux -I/usr/local/include/ruby-2.1.0/ruby/backward -I/usr/local/include/ruby-2.1.0 -I.     -O3 -fno-fa        st-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-st        rings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L. -fstack-protector -rdynamic -Wl,-        export-dynamic     -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static  -lpthread -lrt -ldl -lcrypt -lm   -lc"
      4 checked program was:
      5 /* begin */
      6 1: #include "ruby.h"
      7 2:
      8 3: int main(int argc, char **argv)
      9 4: {
     10 5:   return 0;
     11 6: }
     12 /* end */
     13 
     14 "gcc -o conftest -I/usr/local/include/ruby-2.1.0/x86_64-linux -I/usr/local/include/ruby-2.1.0/ruby/backward -I/usr/local/include/ruby-2.1.0 -I.     -O3 -fno-fa        st-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-st        rings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L. -fstack-protector -rdynamic -Wl,-        export-dynamic     -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -licui18n  -lpthread -lrt -ldl -lcrypt -lm   -lc"
     15 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/libicui18n.so: undefined reference to `operator delete(void*)@GLIBCXX_3.4'
     16 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/libicui18n.so: undefined reference to `vtable for __cxxabiv1::__class_type_info@CXXABI_1.3'
     17 /usr/lib64/libicuuc.so.42: undefined reference to `__cxa_call_unexpected@CXXABI_1.3'
     18 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/libicui18n.so: undefined reference to `__gxx_personality_v0@CXXABI_1.3'
     19 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/libicui18n.so: undefined reference to `operator delete[](void*)@GLIBCXX_3.4'
     20 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/libicui18n.so: undefined reference to `vtable for __cxxabiv1::__si_class_type_info@CXXABI_1.3'
     21 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/libicui18n.so: undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info@CXXABI_1.3'
     22 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/libicui18n.so: undefined reference to `operator new[](unsigned long)@GLIBCXX_3.4'
     23 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/libicui18n.so: undefined reference to `__cxa_pure_virtual@CXXABI_1.3'
     24 collect2: ld returned 1 exit status
     25 checked program was:
     26 /* begin */
     27  1: #include "ruby.h"
     28  2:
     29  3: /*top*/
     30  4: extern int t(void);
     31  5: int main(int argc, char **argv)
     32  6: {
     33  7:   if (argc > 1000000) {
     34  8:     printf("%p", &t);
     35  9:   }
     36 10:
     37 11:   return 0;
     38 12: }
:set nu