cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to compile and run SAP/Rfc on solaris: RfcInstallUnicodeStructureU:

Former Member
0 Kudos

Hi All,

After trying a lot I want to post it here as the last chance.

- I have the unicode version of rfcsdk installed at /usr/sap/rfcsdk

- I downloaded and un-tarred saprfc-0.36. I could create 'saprfc.so' without any error.

- I believe the function call 'RfcInstallUnicodeStructureU' used by saprfc.c is located in a library 'librfcu.a'.

sapscp@moe$ strings librfcu.a | grep RfcInstallUnicodeStructureU

RfcInstallUnicodeStructureU

RfcInstallUnicodeStructureU

I am able to create the library saprfc.so without any issue but I see the following error when I try to execute test.rb.

skarumur@reality$ ruby test.rb

dirs: ["./ext/saprfc", "/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/site_ruby/1.8/sparc-solaris2.8", "/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/sparc-solaris2.8", "."]

ld.so.1: ruby: fatal: relocation error: file /usr/local/lib/ruby/site_ruby/1.8/sparc-solaris2.8/saprfc.so: symbol RfcInstallUnicodeStructureU: referenced symbol not found

Killed

NOTE: My LD_LIBRARY_PATH has the directory of librfcu.a

Thanks for any help,

Sri

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

To me, it looks like the compile process has not linked in the library 'librfcu.a'. Can you show me the complete output of the setup.rb/compile process.

Piers Harding.

Former Member
0 Kudos

Piers,

Thanks for the quick response.

- First I tried

ruby setup.rb config --with-unicode=yes

ruby setup.rb setup

- Then I manually changed the lrfc to lrfcu in the ext/saprfc/Makefile and then ran

make

ruby setup.rb install

-


BEGIN OUTPUT from setup.rb config -


skarumur@reality$ ruby setup.rb config --with-unicode=yes

---> lib

---> lib/SAP

<--- lib/SAP

<--- lib

---> ext

---> ext/saprfc

/usr/local/bin/ruby /export/home/skarumur/tmp/saprfc-0.36/ext/saprfc/extconf.rb --with-unicode=yes

invoking with-unicode ...

Modified CFLAGS: -g -O2 -Wall -DSAPwithUNICODE

Modified CFLAGS: -g -O2 -Wall -DSAPwithUNICODE

Modified CPPFLAGS:

Modified LDFLAGS:

Modified LIBPATH: $(libdir)

checking for saprfc.h... no

adding default rfcsdk location for headers ...

checking for saprfc.h... yes

checking for sapitab.h... yes

checking for main() in -lc... yes

checking for main() in -lm... yes

checking for main() in -ldl... yes

checking for main() in -lpthread... yes

checking for main() in -lstdc++... yes

checking for main() in -lrfcum... no

searching for library rfc because we cant find rfcum ...

checking for main() in -lrfc... no

last try - trying to find rfc32 for windows ...

checking for main() in -lrfcum... no

checking for main() in -lsapu16... no

DID NOT find libsapu16 - this may cause problems ...

Existing Compile protocol: $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $< ...

/export/home/skarumur/tmp/saprfc-0.36/ext/saprfc/extconf.rb:80: warning: already initialized constant COMPILE_C

modified Compile protocol: $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -E -c $< > $<.ii

perl ../../u16lit.pl -le $<.ii

$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c $<.i

mv $<.o $(TARGET).o ...

creating Makefile

<--- ext/saprfc

<--- ext

-


END OUTPUT from setup.rb config -


-


BEGIN OUTPUT from setup.rb setup -


skarumur@reality$ sudo ruby setup.rb setup

---> lib

---> lib/SAP

<--- lib/SAP

<--- lib

---> ext

---> ext/saprfc

make

gcc -I. -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.8 -I/export/home/skarumur/tmp/saprfc-0.36/ext/saprfc -fPIC -g -O2 -Wall -DSAPwithUNICODE -I/usr/sap/rfcsdk/include -DHAVE_SAPRFC_H -DHAVE_SAPITAB_H -E -c saprfc.c > saprfc.c.ii

perl ../../u16lit.pl -le saprfc.c.ii

WARNING (u16lit.pl): Overriding autodetected big-endian mode !

gcc -I. -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.8 -I/export/home/skarumur/tmp/saprfc-0.36/ext/saprfc -fPIC -g -O2 -Wall -DSAPwithUNICODE -I/usr/sap/rfcsdk/include -DHAVE_SAPRFC_H -DHAVE_SAPITAB_H -c saprfc.c.i

/usr/sap/rfcsdk/include/sapuc.h:844: warning: 'sccsidU16' defined but not used

mv saprfc.c.o saprfc.o

gcc -shared -L/usr/sap/rfcsdk/lib -lrfc -lrfc -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -o saprfc.so saprfc.o -lstdc++ -lpthread -ldl -lm -lc -ldl -lcrypt -lm -lc

ld: fatal: library -lrfc: not found

ld: fatal: library -lrfc: not found

ld: fatal: File processing errors. No output written to saprfc.so

collect2: ld returned 1 exit status

make: *** [saprfc.so] Error 1

setup.rb:658:in `command': system("make") failed (RuntimeError)

from setup.rb:667:in `make'

from setup.rb:1299:in `setup_dir_ext'

from setup.rb:1573:in `__send__'

from setup.rb:1573:in `traverse'

from setup.rb:1590:in `dive_into'

from setup.rb:1571:in `traverse'

from setup.rb:1575:in `traverse'

from setup.rb:1574:in `each'

... 8 levels...

from setup.rb:829:in `__send__'

from setup.rb:829:in `invoke'

from setup.rb:776:in `invoke'

from setup.rb:1619

-


END OUTPUT from setup.rb setup -


-


BEGIN OUTPUT from make under ext/saprfc -


skarumur@reality$ make

gcc -shared -L/usr/sap/rfcsdk/lib -lrfcu -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -o saprfc.so saprfc.o -lstdc++ -lpthread -ldl -lm -lc -ldl -lcrypt -lm -lc

-


END OUTPUT from make under ext/saprfc -


-


BEGIN OUTPUT from install -


skarumur@reality$ sudo ruby setup.rb install

rm -f InstalledFiles

---> lib

mkdir -p /usr/local/lib/ruby/site_ruby/1.8

---> lib/SAP

mkdir -p /usr/local/lib/ruby/site_ruby/1.8/SAP

install Rfc.rb /usr/local/lib/ruby/site_ruby/1.8/SAP

install Tools.rb /usr/local/lib/ruby/site_ruby/1.8/SAP

install Ticket.rb /usr/local/lib/ruby/site_ruby/1.8/SAP

install Object.rb /usr/local/lib/ruby/site_ruby/1.8/SAP

<--- lib/SAP

<--- lib

---> ext

---> ext/saprfc

mkdir -p /usr/local/lib/ruby/site_ruby/1.8/sparc-solaris2.8

install saprfc.so /usr/local/lib/ruby/site_ruby/1.8/sparc-solaris2.8/.

<--- ext/saprfc

<--- ext

-


END OUTPUT from install -


Sri

Former Member
0 Kudos

right - you don't have the dynamic load library librfcum - you seem to only have a static librfcu.a.

What you will have to do is edit setup.rb and try replacing all occurances of the string "rfcum" with "rfcu", and try again (config, setup, and install).

Cheers.

Former Member
0 Kudos

1. I do have a library librfcum.so. I guess it's not the one.

I changed the rfcum to rfcu in ext/saprfc/extconf.rb and reran clean;config;setup and install. I still have the issue.

2. Not sure if it's related but I see a warning:

ld: warning: file /usr/sap/rfcsdk/lib/librfcu.a(rfcilib.o): wrong ELF class: ELFCLASS64

Was wondering if this is related to 64/32 bit issues. There is no 32 bit unicode version. I tried 32 bit non-unicode version of rfcsdk but it starts pumping hundreds of errors like below during the compile time:

[code]<unknown> 0x40510 /usr/sap/rfcsdk_32_non_unicode/lib/librfc.a(rscpa0lib.o)

<unknown> 0x40520 /usr/sap/rfcsdk_32_non_unicode/lib/librfc.a(rscpa0lib.o)

<unknown> 0x40528 /usr/sap/rfcsdk_32_non_unicode/lib/librfc.a(rscpa0lib.o)

<unknown> 0x40538 /usr/sap/rfcsdk_32_non_unicode/lib/librfc.a(rscpa0lib.o)

<unknown> 0x40540 /usr/sap/rfcsdk_32_non_unicode/lib/librfc.a(rscpa0lib.o)

<unknown> 0x40588 /usr/sap/rfcsdk_32_non_unicode/lib/librfc.a(rscpa0lib.o)

[/code]

3. Probably not related to this issue but I wonder why I see the error about missing libsapu16 though I have libsapu16.so.

<i>checking for main() in -lsapu16... no

DID NOT find libsapu16 - this may cause problems ...

</i>

[code]

-


List of libraries in my rfcsdk

$ ls -l /usr/sap/rfcsdk/lib

total 31024

-rwxr-xr-x 1 ps8adm sapsys 8947608 Mar 2 14:16 libicudata.so.26

-rwxr-xr-x 1 ps8adm sapsys 1497560 Mar 2 14:16 libicui18n.so.26

-rwxr-xr-x 1 ps8adm sapsys 1244744 Mar 2 14:16 libicuuc.so.26

-rw-rw-r-- 1 ps8adm sapsys 10888632 Mar 4 14:04 librfcu.a

-rwxrwxr-x 1 ps8adm sapsys 8085144 Mar 5 15:29 librfcum.so

-rwxrwxr-x 1 ps8adm sapsys 241344 Mar 2 13:46 libsapu16.so

-rwxrwxr-x 1 ps8adm sapsys 220024 Mar 2 19:58 libsapu16_mt.so

-rwxrwxr-x 1 ps8adm sapsys 550528 Mar 2 20:09 libsapucum.so

-


END List of libraries in my rfcsdk

[/code]

[code]

-


BEGIN Output from setup.rb

Script started on Wed May 09 09:25:42 2007

<b>skarumur@reality$ ruby setup.rb config --with-unicode=yes</b>

---> lib

---> lib/SAP

<--- lib/SAP

<--- lib

---> ext

---> ext/saprfc

/usr/local/bin/ruby /export/home/skarumur/tmp/saprfc-0.36/ext/saprfc/extconf.rb --with-unicode=yes

invoking with-unicode ...

Modified CFLAGS: -g -O2 -Wall -DSAPwithUNICODE

Modified CFLAGS: -g -O2 -Wall -DSAPwithUNICODE

Modified CPPFLAGS:

Modified LDFLAGS:

Modified LIBPATH: $(libdir)

checking for saprfc.h... no

adding default rfcsdk location for headers ...

checking for saprfc.h... yes

checking for sapitab.h... yes

checking for main() in -lc... yes

checking for main() in -lm... yes

checking for main() in -ldl... yes

checking for main() in -lpthread... yes

checking for main() in -lstdc++... yes

checking for main() in -lrfcu... yes

checking for main() in -lsapu16... no

DID NOT find libsapu16 - this may cause problems ...

Existing Compile protocol: $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $< ...

/export/home/skarumur/tmp/saprfc-0.36/ext/saprfc/extconf.rb:80: warning: already initialized constant COMPILE_C

modified Compile protocol: $(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -E -c $< > $<.ii

perl ../../u16lit.pl -le $<.ii

$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c $<.i

mv $<.o $(TARGET).o ...

creating Makefile

<--- ext/saprfc

<--- ext

<b>skarumur@reality$ ruby setup.rb setup</b>

---> lib

---> lib/SAP

<--- lib/SAP

<--- lib

---> ext

---> ext/saprfc

make

gcc -I. -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.8 -I/export/home/skarumur/tmp/saprfc-0.36/ext/saprfc -fPIC -g -O2 -Wall -DSA

PwithUNICODE -I/usr/sap/rfcsdk/include -DHAVE_SAPRFC_H -DHAVE_SAPITAB_H -E -c saprfc.c > saprfc.c.ii

perl ../../u16lit.pl -le saprfc.c.ii

WARNING (u16lit.pl): Overriding autodetected big-endian mode !

gcc -I. -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.8 -I/export/home/skarumur/tmp/saprfc-0.36/ext/saprfc -fPIC -g -O2 -Wall -DSA

PwithUNICODE -I/usr/sap/rfcsdk/include -DHAVE_SAPRFC_H -DHAVE_SAPITAB_H -c saprfc.c.i

/usr/sap/rfcsdk/include/sapuc.h:844: warning: 'sccsidU16' defined but not used

mv saprfc.c.o saprfc.o

gcc -shared -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -o saprfc.so saprfc.o -lrfcu -lstdc++ -lpthread -ldl -lm -lc -ldl -lcryp

t -lm -lc

ld: warning: file /usr/sap/rfcsdk/lib/librfcu.a(rfcilib.o): wrong ELF class: ELFCLASS64

<--- ext/saprfc

<--- ext

<b>skarumur@reality$ sudo ruby setup.rb install</b>

rm -f InstalledFiles

---> lib

mkdir -p /usr/local/lib/ruby/site_ruby/1.8

---> lib/SAP

mkdir -p /usr/local/lib/ruby/site_ruby/1.8/SAP

install Rfc.rb /usr/local/lib/ruby/site_ruby/1.8/SAP

install Tools.rb /usr/local/lib/ruby/site_ruby/1.8/SAP

install Ticket.rb /usr/local/lib/ruby/site_ruby/1.8/SAP

install Object.rb /usr/local/lib/ruby/site_ruby/1.8/SAP

<--- lib/SAP

<--- lib

---> ext

---> ext/saprfc

mkdir -p /usr/local/lib/ruby/site_ruby/1.8/sparc-solaris2.8

install saprfc.so /usr/local/lib/ruby/site_ruby/1.8/sparc-solaris2.8/.

<--- ext/saprfc

<--- ext

<b>skarumur@reality$ ruby test/test.rb</b>

dirs: ["./ext/saprfc", "/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/site_ruby/1.8/sparc-solaris2.8", "/usr/local/lib

/ruby/site_ruby", "/usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/sparc-solaris2.8", "."]

ld.so.1: ruby: fatal: relocation error: file ./ext/saprfc/saprfc.so: symbol RfcInstallUnicodeStructureU: referenced symbol not fo

und

Killed

skarumur@reality$ exit

script done on Wed May 09 09:28:37 2007

-


END Output from setup.rb

[/code]

Former Member
0 Kudos

This is odd - I must admit to not knowing much about building software on Solaris.

Have you got the right library version 32bit or 64bit depending on your archtecture (you seem to suggest that you have 32bit?). If you don't get this right then you wont have much of a chance at all.

As you say - you have A librfcum library, but the config step didnt seem to find it, so that means Ruby mkmf tools could not identify it (perhaps related to the architecture question).

Cheers.

Former Member
0 Kudos

Piers,

I do have 64 bit Solaris. I just tried 32 bit in the spirit of leaving no stone unturned.

Tried to use 'cc' that comes with Solaris 8/9 and that resulted in:


cc -I. -I. -I/usr/local/lib/ruby/1.8/sparc-solaris2.8 -I/export/home/skarumur/tmp/saprfc-0.36/ext/saprfc -fPIC -g -O2 -Wall -DSAPwithUNICODE  -I/usr/sap/rfcsdk/include -x64 -DHAVE_SAPRFC_H -DHAVE_SAPITAB_H  -E -c saprfc.c > saprfc.c.ii
ucbcc: Warning: Option -fPIC passed to ld, if ld is invoked, ignored otherwise
ucbcc: Warning: Option -Wall passed to ld, if ld is invoked, ignored otherwise
ucbcc: Warning: Option -x64 passed to ld, if ld is invoked, ignored otherwise
ucbcc: Warning: "-c" redefines product from "source (stdout)" to "object"
"/usr/sap/rfcsdk/include/sapucx.h", line 330: Illegal number 4294967295U
"/usr/sap/rfcsdk/include/sapucx.h", line 330: Illegal number FFFFFFFFu
"/usr/sap/rfcsdk/include/saprfc.h", line 1069: RfcInit: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1653: RfcConnect: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1653: RfcOpenEx: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1688: RfcOpenEx: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1701: RfcCheckRegisterServer: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1740: RfcSetCodePage: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1770: RfcCleanupContext: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1770: RfcInstallUnicodeStructure: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1821: RfcGetFunctionInfoAsTable: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1841: RfcSncNameToAclKey: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1842: RfcIndirectCall: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1849: RfcDispatch: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1852: RfcRaiseTables: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1852: RfcInstallFunction: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1876: RfcInstallTransactionControl2: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1907: RfcGetTransID: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1915: RfcConvertBcdToChar: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1935: RfcGuiCheck: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1936: RfcDetachContext: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1936: RfcCancel: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1971: RfcSetSystemTimeout: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 1991: RfcStatistic: too much pushback
"/usr/sap/rfcsdk/include/saprfc.h", line 2002: RfcLastError: too much pushback
"/usr/sap/rfcsdk/include/sapitab.h", line 300: ItCreate: too much pushback
"/usr/sap/rfcsdk/include/sapitab.h", line 300: ItCpyLine: too much pushback
"saprfc.c", line 528: RfcLastErrorEx: too much pushback
"saprfc.c", line 589: RfcGetStructureInfoAsTable: too much pushback
"saprfc.c", line 607: RfcInstallUnicodeStructure: too much pushback
"saprfc.c", line 644: ItFree: too much pushback
"saprfc.c", line 662: RfcAllocString: too much pushback
"saprfc.c", line 666: ItCreate: too much pushback
"saprfc.c", line 721: RfcFreeString: too much pushback
"saprfc.c", line 749: RfcWaitForRequest: too much pushback
"saprfc.c", line 787: ItFill: too much pushback
"saprfc.c", line 851: RfcSendData: too much pushback
"saprfc.c", line 851: missing #endif
make: *** [saprfc.o] Error 2
setup.rb:658:in `command': system("make") failed (RuntimeError)
        from setup.rb:667:in `make'
        from setup.rb:1299:in `setup_dir_ext'
        from setup.rb:1573:in `__send__'
        from setup.rb:1573:in `traverse'
        from setup.rb:1590:in `dive_into'
        from setup.rb:1571:in `traverse'
        from setup.rb:1575:in `traverse'
        from setup.rb:1574:in `each'
         ... 8 levels...
        from setup.rb:829:in `__send__'
        from setup.rb:829:in `invoke'
        from setup.rb:776:in `invoke'
        from setup.rb:1619

It's probably easier using a Linux machine. I will give that a try when I get the bandwidth next time.

Thanks for all your help.

Sri

Former Member
0 Kudos

I'm sorry - I really can't say why you would be gettin gthese problems, as I am unfamilir with the architecture.

Have you thought of using sapnwrfc ?

Former Member
0 Kudos

I didn't try the sapnwrfc. I assume I need a Netweaver running for this. Right!

Can you direct me to the 101 on sapnwrfc?

Sri

Former Member
0 Kudos

sapnwrfc is backwardly compatible (to an extent) - you shouldn't have any trouble.

/people/piers.harding/blog/2007/02/28/netweaver-rfc-gives-the-next-generation-ruby-and-perl-connectors

And then all the documentation with the source distributions etc.

Cheers.