Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

SAP::Rfc module with unicode

by regexes (Hermit)
on Nov 17, 2009 at 09:57 UTC ( [id://807642]=perlquestion: print w/replies, xml ) Need Help??

regexes has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks,

This is not a direct perl question but it has to do with the use of a perl module. Maybe somebody here can enlighten me. :-)

I'm trying to use the CPAN module SAP::Rfc against a unicode SAP system and am having a problem getting the module to make successfully.

It mentions in the module Readme that unicode is supported with the special unicode version of the SAP RFCSDK. Ok.. I have that SDK. http://cpansearch.perl.org/src/PIERS/SAP-Rfc-1.55/README

This is what I'm using:

Debian version 5.0.3
Perl v5.10.0 built for x86_64-linux-gnu-thread-multi
SAP RFCSDK Unicode.

The make and make test with non-unicode works fine... (skipping the make results below)..

hostblabla:/tmp/saprfctest/SAP-Rfc-1.55# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/00use....ok + t/01sap....ok + All tests successful. Files=2, Tests=7, 1 wallclock secs ( 0.14 cusr + 0.01 csys = 0.15 C +PU) hostblabla:/tmp/saprfctest/SAP-Rfc-1.55#
The problem appears when running the test against a unicode system. I can make everything OK, however, the tests fail. I don't know if this is a problem with the Makefile, perl version, module, or the OS.
hostblabla:/tmp/saprfctest/SAP-Rfc-1.55# perl Makefile.PL --unicode O-ohhh -unicode!! /usr/local/lib does not seem to contain the librfcu (or librfcum) libr +ary files /usr/lib does not seem to contain the librfcu (or librfcum) library fi +les Found rfcum installed in /usr/sap/rfcsdk Which librfc build path do you want to link against? [/usr/sap/rfcsdk]
The make finishes successfully... here the test:
hostblabla:/tmp/saprfctest/SAP-Rfc-1.55# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/00use....Can't load '/tmp/saprfctest/SAP-Rfc-1.55/blib/arch/auto/SAP +/Rfc/Rfc.so' for module SAP::Rfc: /tmp/saprfctest/SAP-Rfc-1.55/blib/a +rch/auto/SAP/Rfc/Rfc.so: undefined symbol: memsetU16 at /usr/lib/perl +/5.10/DynaLoader.pm line 196. at t/00use.t line 4 Compilation failed in require at t/00use.t line 4. BEGIN failed--compilation aborted at t/00use.t line 4. t/00use....dubious + Test returned status 2 (wstat 512, 0x200) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/01sap....Can't load '/tmp/saprfctest/SAP-Rfc-1.55/blib/arch/auto/SAP +/Rfc/Rfc.so' for module SAP::Rfc: /tmp/saprfctest/SAP-Rfc-1.55/blib/a +rch/auto/SAP/Rfc/Rfc.so: undefined symbol: memsetU16 at /usr/lib/perl +/5.10/DynaLoader.pm line 196. at t/01sap.t line 4 Compilation failed in require at t/01sap.t line 4. BEGIN failed--compilation aborted at t/01sap.t line 4. t/01sap....dubious + Test returned status 2 (wstat 512, 0x200) DIED. FAILED tests 1-6 Failed 6/6 tests, 0.00% okay Failed Test Stat Wstat Total Fail List of Failed ---------------------------------------------------------------------- +--------- t/00use.t 2 512 1 1 1 t/01sap.t 2 512 6 11 1-6 Failed 2/2 test scripts. 7/7 subtests failed. Files=2, Tests=7, 0 wallclock secs ( 0.08 cusr + 0.01 csys = 0.09 C +PU) Failed 2/2 test programs. 7/7 subtests failed. make: *** [test_dynamic] Error 2

Undefined symbol: memsetU16.... I've search on perlmonks and googled but can't seem to find an answer.

Anybody know how to get around this problem?

regexes

Replies are listed 'Best First'.
Re: SAP::Rfc module with unicode
by cdarke (Prior) on Nov 17, 2009 at 11:58 UTC
    I don't know this particular module, but you probably need to set environment variable LD_LIBRARY_PATH to the SAP directory which contains Rfc.so and the other SAP library files. Do this from the shell (export or setenv) before running the make.
      Thanks for the response... I thought of that before but, unfortunately, it didn't change anything.
      hostblabla:# echo $LD_LIBRARY_PATH /tmp/saprfctest/SAP-Rfc-1.55/blib/arch/auto/SAP/Rfc:/usr/sap/rfcsdk
      The make test throws the same error.
      undefined symbol: memsetU16 at /usr/lib/perl/5.10/DynaLoader.pm line 1 +96
      This leads me to believe that something is maybe messed up with the Dynaloader module in my perl distribution. But I'm just guessing...
Re: SAP::Rfc module with unicode
by almut (Canon) on Nov 17, 2009 at 16:49 UTC

    My guess would be that the wrong mix of libraries have been linked.

    AFAICT, Rfc.xs itself does not directly reference memsetU16, it uses memsetU instead, which presumably is mapped to memsetU16 (the UTF-16 variant — also see an old proposal) somewhere in one of the SAP libs when compiled with Unicode support. The correct library which provides the implementation of the symbol, however, doesn't seem to have been specified to the linker... (which - with memsetU16 being an indirect dependency - wouldn't necessarily produce an error at build-time, but only at run-time...)

    I can't be more specific (as I don't have the SAP libs), but the following tools might help to narrow down on where the problem lies:  ldd (list shared lib dependencies), and nm or objdump (list symbols a lib provides/references).  For example, try

    $ ldd ./blib/arch/auto/SAP/Rfc/Rfc.so

    to find out which (SAP-)libs the module's XS component has in fact been linked against (and what they map to at load time).  Then something like

    $ objdump -tT /path/to/sap-libs/libsapu16.so | grep memsetU $ objdump -ftT /path/to/sap-libs/* | grep 'file format\|memsetU'

    to hunt for which libs implement (type ".text") or reference (type "*UND*") the respective memsetU* function(s) ... — You get the idea.   (As I said, my guess would be that the lib which does provide memsetU16 will not show up in the ldd output.)

    With that info you'll likely have a better chance of figuring out what went wrong with perl Makefile.PL, and how to fix it...  Good luck!

      I've run into a similar problem now and here are the results from ldd and objdump as mentioned above:


      $ ldd ~/SAP_RFC/INSTALL/lib/perl/5.10.1//auto/SAP/Rfc/Rfc.so linux-vdso.so.1 => (0x00007fff643df000) libm.so.6 => /lib/libm.so.6 (0x00007f0882898000) libdl.so.2 => /lib/libdl.so.2 (0x00007f0882694000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0882477000) libc.so.6 => /lib/libc.so.6 (0x00007f0882115000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f0881e01000) librfcum.so => ~/SAP_RFC/rfcsdk//lib/librfcum.so (0x00007f0881 +749000) /lib64/ld-linux-x86-64.so.2 (0x00007f0882d36000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f0881533000) librt.so.1 => /lib/librt.so.1 (0x00007f088132b000)

      $ objdump -tT ~/SAP_RFC/rfcsdk/lib/libsapu16.so | grep memsetU 0000000000008640 g F .text 00000000000001c6 memsetU1 +6 00000000000089fc g F .text 000000000000000a memsetU 0000000000008640 g DF .text 00000000000001c6 Base memsetU1 +6 00000000000089fc g DF .text 000000000000000a Base memsetU

      $ objdump -ftT ~/SAP_RFC/rfcsdk/lib/* | grep 'file format\|memsetU' ~/SAP_RFC/rfcsdk/lib/libicudata.so.34: file format elf64-x86-64 ~/SAP_RFC/rfcsdk/lib/libicui18n.so.34: file format elf64-x86-64 ~/SAP_RFC/rfcsdk/lib/libicuuc.so.34: file format elf64-x86-64 objdump: rfcilib.o: not a dynamic object rfcilib.o: file format elf64-x86-64 0000000000000000 *UND* 0000000000000000 memsetU16 objdump: cpictlib.o: not a dynamic object cpictlib.o: file format elf64-x86-64 00000000000057d0 g F .text.hot 00000000000001c6 memsetU16 000000000005445e g F .text.unlikely 000000000000000a memsetU objdump: rsec4lib.o: not a dynamic object objdump: rsec4lib.o: file format elf64-x86-64 rscpa0lib.o: not a dynamic object rscpa0lib.o: file format elf64-x86-64 0000000000000000 *UND* 0000000000000000 memsetU16 objdump: rscpuc2lib.o: not a dynamic object rscpuc2lib.o: file format elf64-x86-64 ~/SAP_RFC/rfcsdk/lib/librfcum.so: file format elf64-x86-64 00000000001fecf0 l F .text 00000000000001e3 memsetU1 +6 00000000001ec78e l F .text 000000000000000a memsetU ~/SAP_RFC/rfcsdk/lib/libsapu16_mt.so: file format elf64-x86-64 0000000000008ba0 g F .text 00000000000001e3 memsetU1 +6 0000000000008d97 g F .text 000000000000000a memsetU 0000000000008ba0 g DF .text 00000000000001e3 Base memsetU1 +6 0000000000008d97 g DF .text 000000000000000a Base memsetU ~/SAP_RFC/rfcsdk/lib/libsapu16.so: file format elf64-x86-64 0000000000008640 g F .text 00000000000001c6 memsetU1 +6 00000000000089fc g F .text 000000000000000a memsetU 0000000000008640 g DF .text 00000000000001c6 Base memsetU1 +6 00000000000089fc g DF .text 000000000000000a Base memsetU ~/SAP_RFC/rfcsdk/lib/libsapucum.so: file format elf64-x86-64 0000000000038d90 g F .text 00000000000001e3 memsetU1 +6 000000000002ce6e g F .text 000000000000000a memsetU 0000000000038d90 g DF .text 00000000000001e3 libsapucum.so memset +U16 000000000002ce6e g DF .text 000000000000000a libsapucum.so memset +U
Re: SAP::Rfc module with unicode
by ajt (Prior) on Apr 15, 2014 at 13:52 UTC

    I know this is a long shot - it's a long time ago, but did you ever get it to work. I'm having the same problem today...


    --
    ajt

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://807642]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-18 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found