Building native extensions. This could take a while…
ERROR: Error installing ruby-ldap:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
–with-ldap-dir=/usr
–with-openldap2
checking for ldap.h… yes
checking for lber.h… yes
checking for ldap_ssl.h… no
checking for openssl/ssl.h… yes
checking for openssl/crypto.h… yes
checking for main() in -lcrypto… yes
checking for main() in -lssl… yes
checking for main() in -lnsl… yes
checking for main() in -lpthread… yes
checking for main() in -lresolv… yes
checking for main() in -llber… yes
checking for main() in -lldap_r… yes
checking for main() in -lldap… yes
checking for ldap_init()… yes
checking for ldap_set_option()… yes
checking for ldap_get_option()… yes
checking for ldap_start_tls_s()… yes
checking for ldap_memfree()… yes
checking for ldap_perror()… yes
checking for ldap_sort_entries()… yes
checking for ldapssl_init()… no
checking for ldap_sslinit()… no
checking for ldap_sasl_bind_s()… yes
checking for ldap_compare_s()… yes
checking for ldap_add_ext_s()… yes
checking for ldap_compare_ext_s()… yes
checking for ldap_delete_ext_s()… yes
checking for ldap_modify_ext_s()… yes
checking for ldap_search_ext_s()… yes
checking for ldap_unbind_ext_s()… yes
checking for ldap_sasl_interactive_bind_s()… yes
creating Makefile
make
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DUSE_OPENLDAP2
-DUSE_OPENLDAP -DLDAP_DEPRECATED -D_REENTRANT -DHAVE_LDAP_H
-DHAVE_LBER_H
-DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_CRYPTO_H -DHAVE_LDAP_INIT
-DHAVE_LDAP_SET_OPTION -DHAVE_LDAP_GET_OPTION -DHAVE_LDAP_START_TLS_S
-DHAVE_LDAP_MEMFREE -DHAVE_LDAP_PERROR -DHAVE_LDAP_SORT_ENTRIES
-DHAVE_LDAP_SASL_BIND_S -DHAVE_LDAP_COMPARE_S -DHAVE_LDAP_ADD_EXT_S
-DHAVE_LDAP_COMPARE_EXT_S -DHAVE_LDAP_DELETE_EXT_S
-DHAVE_LDAP_MODIFY_EXT_S
-DHAVE_LDAP_SEARCH_EXT_S -DHAVE_LDAP_UNBIND_EXT_S
-DHAVE_LDAP_SASL_INTERACTIVE_BIND_S -DRUBY_VERSION_CODE=185 -fPIC -O2
-g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
–param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -fno-strict-aliasing
-fPIC
-c ldap.c
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DUSE_OPENLDAP2
-DUSE_OPENLDAP -DLDAP_DEPRECATED -D_REENTRANT -DHAVE_LDAP_H
-DHAVE_LBER_H
-DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_CRYPTO_H -DHAVE_LDAP_INIT
-DHAVE_LDAP_SET_OPTION -DHAVE_LDAP_GET_OPTION -DHAVE_LDAP_START_TLS_S
-DHAVE_LDAP_MEMFREE -DHAVE_LDAP_PERROR -DHAVE_LDAP_SORT_ENTRIES
-DHAVE_LDAP_SASL_BIND_S -DHAVE_LDAP_COMPARE_S -DHAVE_LDAP_ADD_EXT_S
-DHAVE_LDAP_COMPARE_EXT_S -DHAVE_LDAP_DELETE_EXT_S
-DHAVE_LDAP_MODIFY_EXT_S
-DHAVE_LDAP_SEARCH_EXT_S -DHAVE_LDAP_UNBIND_EXT_S
-DHAVE_LDAP_SASL_INTERACTIVE_BIND_S -DRUBY_VERSION_CODE=185 -fPIC -O2
-g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
–param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -fno-strict-aliasing
-fPIC
-c misc.c
misc.c: In function ‘rb_ldap_get_apiinfo’:
misc.c:56: warning: implicit declaration of function ‘RARRAY_LEN’
misc.c:60: warning: implicit declaration of function ‘RARRAY_PTR’
misc.c:60: error: subscripted value is neither array nor pointer
misc.c:61: warning: implicit declaration of function ‘RSTRING_LEN’
misc.c:61: warning: implicit declaration of function ‘RSTRING_PTR’
misc.c:61: warning: passing argument 2 of ‘__builtin___memcpy_chk’ makes
pointer
from integer without a cast
misc.c:61: warning: passing argument 2 of ‘__memcpy_ichk’ makes pointer
from
integer without a cast
misc.c:64: warning: passing argument 2 of ‘__builtin___memcpy_chk’ makes
pointer
from integer without a cast
misc.c:64: warning: passing argument 2 of ‘__memcpy_ichk’ makes pointer
from
integer without a cast
misc.c: In function ‘rb_ldap_control_set_value’:
misc.c:164: warning: passing argument 2 of ‘__builtin___memcpy_chk’
makes
pointer from integer without a cast
misc.c:164: warning: passing argument 2 of ‘__memcpy_ichk’ makes pointer
from
integer without a cast
misc.c: In function ‘rb_ldap_control_set_oid’:
misc.c:237: warning: passing argument 2 of ‘__builtin___memcpy_chk’
makes
pointer from integer without a cast
misc.c:237: warning: passing argument 2 of ‘__memcpy_ichk’ makes pointer
from
integer without a cast
make: *** [misc.o] Error 1
Gem files will remain installed in
/usr/lib64/ruby/gems/1.8/gems/ruby-ldap-0.9.9
for inspection.
Results logged to
/usr/lib64/ruby/gems/1.8/gems/ruby-ldap-0.9.9/gem_make.out
I have tried to install all the yum openssl and openldap stuff that
seems
reasonable, but still get the above.
I guess it might be helpful to add that, though one file and two methods
are
listed as not found, more help would be desireable if these being
missing imply
some package I need to yum install or something. I have tried all the
various
openssl and openldap thingies, including the -devel packages, and all
that stuff
seems to be in there in good stead. This is CentOS 5 if that helps, as
well as
it’s standard pieces for the recent installs. That reminds me…I’ll
try a yum
update right now just in case that fixes it…nope, I did a complete yum
update,
and rebooted, and the gem install still fails the same way…Anyone?
misc.c: In function ‘rb_ldap_get_apiinfo’:
misc.c:56: warning: implicit declaration of function ‘RARRAY_LEN’
misc.c:60: warning: implicit declaration of function ‘RARRAY_PTR’
misc.c:60: error: subscripted value is neither array nor pointer
misc.c:61: warning: implicit declaration of function ‘RSTRING_LEN’
misc.c:61: warning: implicit declaration of function ‘RSTRING_PTR’
Hi Xeno, it looks like the code was ported to work with Ruby 1.9 and
didn’t bother maintaining 1.8.5 (or 1.8.6?) compatibility.
What happens when you add the following to misc.c?
What happens when you add the following to misc.c?
#ifndef RSTRING_PTR
define RSTRING_PTR(s) (RSTRING(s)->ptr)
#endif #ifndef RSTRING_LEN
define RSTRING_LEN(s) (RSTRING(s)->len)
#endif
I’m trying to find the gem sequence to extract it to a directory and
then
install the local directory. No such thing is mentioned in the
documentation I
am reading. Can you help me with that?
Okay, I found the sequence in the README. Sorry. It still fails, and I
tried
putting the preprocessor stuff you recommend both before and after the
two
initial includes in the file, with these results:
ruby extconf.rb
–with-ldap-dir=/usr
–with-openldap2
checking for ldap.h… yes
checking for lber.h… yes
checking for ldap_ssl.h… no
checking for openssl/ssl.h… yes
checking for openssl/crypto.h… yes
checking for main() in -lcrypto… yes
checking for main() in -lssl… yes
checking for main() in -lnsl… yes
checking for main() in -lpthread… yes
checking for main() in -lresolv… yes
checking for main() in -llber… yes
checking for main() in -lldap_r… yes
checking for main() in -lldap… yes
checking for ldap_init()… yes
checking for ldap_set_option()… yes
checking for ldap_get_option()… yes
checking for ldap_start_tls_s()… yes
checking for ldap_memfree()… yes
checking for ldap_perror()… yes
checking for ldap_sort_entries()… yes
checking for ldapssl_init()… no
checking for ldap_sslinit()… no
checking for ldap_sasl_bind_s()… yes
checking for ldap_compare_s()… yes
checking for ldap_add_ext_s()… yes
checking for ldap_compare_ext_s()… yes
checking for ldap_delete_ext_s()… yes
checking for ldap_modify_ext_s()… yes
checking for ldap_search_ext_s()… yes
checking for ldap_unbind_ext_s()… yes
checking for ldap_sasl_interactive_bind_s()… yes
creating Makefile
make
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DUSE_OPENLDAP2
-DUSE_OPENLDAP -DLDAP_DEPRECATED -D_REENTRANT -DHAVE_LDAP_H
-DHAVE_LBER_H
-DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_CRYPTO_H -DHAVE_LDAP_INIT
-DHAVE_LDAP_SET_OPTION -DHAVE_LDAP_GET_OPTION -DHAVE_LDAP_START_TLS_S
-DHAVE_LDAP_MEMFREE -DHAVE_LDAP_PERROR -DHAVE_LDAP_SORT_ENTRIES
-DHAVE_LDAP_SASL_BIND_S -DHAVE_LDAP_COMPARE_S -DHAVE_LDAP_ADD_EXT_S
-DHAVE_LDAP_COMPARE_EXT_S -DHAVE_LDAP_DELETE_EXT_S
-DHAVE_LDAP_MODIFY_EXT_S
-DHAVE_LDAP_SEARCH_EXT_S -DHAVE_LDAP_UNBIND_EXT_S
-DHAVE_LDAP_SASL_INTERACTIVE_BIND_S -DRUBY_VERSION_CODE=185 -fPIC -O2
-g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
–param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -fno-strict-aliasing
-fPIC
-c misc.c
misc.c: In function ‘rb_ldap_get_apiinfo’:
misc.c:63: warning: implicit declaration of function ‘RARRAY_LEN’
misc.c:67: warning: implicit declaration of function ‘RARRAY_PTR’
misc.c:67: error: subscripted value is neither array nor pointer
make: *** [misc.o] Error 1
—snip—
I don’t see any other of these R.*_ preprocessor functions (well, there
is an
RB.*something, but hopefully) so that maybe if you can give me an
appropriate #define for that one it might work…???
OK, we got farther since it’s no longer barfing on RSTRING_*
but RARRAY_* instead.
I don’t see any other of these R.*_ preprocessor functions (well, there
is an RB.*something, but hopefully) so that maybe if you can give me an
appropriate #define for that one it might work…???
So just add these now, and hopefully there aren’t more
incompatibilities…
#ifndef RARRAY_PTR
define RARRAY_PTR(s) (RARRAY(s)->ptr)
#endif #ifndef RARRAY_LEN
define RARRAY_LEN(s) (RARRAY(s)->len)
#endif
If upgrading your version of Ruby isn’t an option for you, I suggest
grabbing the latest 1.8.7 source and taking any other macros you might
need from the headers.
make: *** [misc.o] Error 1
So just add these now, and hopefully there aren’t more
incompatibilities…
#ifndef RARRAY_PTR
define RARRAY_PTR(s) (RARRAY(s)->ptr)
#endif #ifndef RARRAY_LEN
define RARRAY_LEN(s) (RARRAY(s)->len)
#endif
Okay, I put all this stuff into rbldap.h instead of misc.c, as I got the
same
problem for RARRAY stuff from conn.c. Then I got a compile. I haven’t
checked
to see if it works yet, and I’ll post further if it does not, but this
is a good
step to reply with thanks.
If upgrading your version of Ruby isn’t an option for you, I suggest
grabbing the latest 1.8.7 source and taking any other macros you might
need from the headers.
That is what I will prefer for my stuff, but the whole point of this
exercise is
to get a fairly standard deliverable on CentOS, so I’ll likely need to
make a
local gem for my deliverable. I will look and see about a 1.9 install,
but I’m
afraid for these purposes the rbldap.h hack will be more appropriate.
Thanks. I will reply with a note on whether this really works.