cancel
Showing results for 
Search instead for 
Did you mean: 

Compiling Perl SAPNWRFC 0.24 under Solaris 9 Sparc 64bit

Former Member
0 Kudos

<br>I think I have a 32/64bit issue with SAP NW SDK 7.11 under Solaris 9 Sparc 64bit . "Make" gives the following error:

<br>

<br>perl Makefile.PL

<br>No libsapnwrfc installation found, usually in /usr/sap/nwrfcsdk

<br>Which libsapnwrfc build path do you want to link against? /opt/sapnwrfc

<br>================================================

<br>BUILD INFORMATION

<br>================================================

<br>source opt:

<br>addlibs opt:

<br>embed_manifest opt:

<br>ADD_CFLAGS: -DSAPwithUNICODE -DSAPonUNIX -D__NO_MATH_INLINES -fPIC -DSAPwithTHREADS

<br>sapnwrfc dir: /opt/sapnwrfc

<br>libraries: -lm -ldl -lrt -lpthread -L/opt/sapnwrfc/lib -lsapnwrfc -lsapucum

<br>include dir: /opt/sapnwrfc/include

<br>sapnwrfc header: /opt/sapnwrfc/include/sapnwrfc.h

<br>sapnwrfc candidate: /opt/sapnwrfc; /opt/sapnwrfc/include; sapnwrfc

<br>================================================

<br>Writing Makefile for SAPNW::Connection

<br>Writing Makefile for sapnwrfc

<br>lahn# make

<br>cp lib/SAPNW/pm_to_blib blib/lib/SAPNW/pm_to_blib

<br>Skip blib/lib/SAPNW/Connection.xs (unchanged)

<br>cp lib/SAPNW/Connection.bs blib/lib/SAPNW/Connection.bs

<br>cp lib/SAPNW/Connection.c blib/lib/SAPNW/Connection.c

<br>cp lib/SAPNW/Connection.o blib/lib/SAPNW/Connection.o

<br>Skip blib/lib/SAPNW/Rfc.pm (unchanged)

<br>cp lib/SAPNW/Makefile blib/lib/SAPNW/Makefile

<br>Skip blib/lib/SAPNW/RFC/Parameter.pm (unchanged)

<br>Skip blib/lib/SAPNW/Makefile.PL (unchanged)

<br>Skip blib/lib/SAPNW/Connection.pm (unchanged)

<br>Skip blib/lib/SAPNW/Base.pm (unchanged)

<br>cp lib/SAPNW/Connection.i blib/lib/SAPNW/Connection.i

<br>Skip blib/lib/SAPNW/RFC/FunctionCall.pm (unchanged)

<br>cp lib/SAPNW/Connection.ii blib/lib/SAPNW/Connection.ii

<br>Skip blib/lib/sapnwrfc.pm (unchanged)

<br>Skip blib/lib/SAPNW/RFC/FunctionDescriptor.pm (unchanged)

<br>make[1]: Entering directory `/var/tmp/sapnwrfc-0.24/lib/SAPNW'

<br>Skip ../../blib/lib/SAPNW/Rfc.pm (unchanged)

<br>Skip ../../blib/lib/SAPNW/Connection.pm (unchanged)

<br>Skip ../../blib/lib/SAPNW/Base.pm (unchanged)

<br>Running Mkbootstrap for SAPNW::Connection ()

<br>chmod 644 Connection.bs

<br>rm -f ../../blib/arch/auto/SAPNW/Connection/Connection.so

<br>LD_RUN_PATH="/usr/lib:/opt/sapnwrfc/lib" gcc -G -L/usr/local/lib Connection.o -o ../../blib/arch/auto/SAPNW/Connection/Connection.so \

<br>ld: fatal: file /opt/sapnwrfc/lib/libsapnwrfc.so: wrong ELF class: ELFCLASS64

<br>ld: fatal: file /opt/sapnwrfc/lib/libsapucum.so: wrong ELF class: ELFCLASS64

<br>ld: fatal: File processing errors. No output written to ../../blib/arch/auto/SAPNW/Connection/Connection.so

<br>collect2: ld returned 1 exit status

<br>make[1]: *** [../../blib/arch/auto/SAPNW/Connection/Connection.so] Error 1

<br>make[1]: Leaving directory `/var/tmp/sapnwrfc-0.24/lib/SAPNW'

<br>make: *** [subdirs] Error 2

<br>

<br>#####

<br>

<br>My configuration:

<br>

<br>Summary of my perl5 (revision 5 version 8 subversion 😎 configuration:

<br> Platform:

<br> osname=solaris, osvers=2.9, archname=sun4-solaris

<br> uname='sunos 5.9 generic sun4u sparc sunw,ultra-5_10 solaris '

<br> config_args='-Dcc=gcc'

<br> hint=recommended, useposix=true, d_sigaction=define

<br> usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef

<br> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef

<br> use64bitint=undef use64bitall=undef uselongdouble=undef

<br> usemymalloc=n, bincompat5005=undef

<br> Compiler:

<br> cc='gcc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',

<br> optimize='-O',

<br> cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include'

<br> ccversion='', gccversion='3.4.6', gccosandvers='solaris2.9'

<br> intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321

<br> d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16

<br> ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8

<br> alignbytes=8, prototype=define

<br> Linker and Libraries:

<br> ld='gcc', ldflags =' -L/usr/local/lib '

<br> libpth=/usr/local/lib /usr/lib /usr/ccs/lib

<br> libs=-lsocket -lnsl -ldb -ldl -lm -lc

<br> perllibs=-lsocket -lnsl -ldl -lm -lc

<br> libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a

<br> gnulibc_version=''

<br> Dynamic Linking:

<br> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '

<br> cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

<br>

<br>

<br>Characteristics of this binary (from libperl):

<br> Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO

<br> Built under solaris

<br> Compiled at May 8 2007 03:46:29

<br> @INC:

<br> /usr/local/lib/perl5/5.8.8/sun4-solaris

<br> /usr/local/lib/perl5/5.8.8

<br> /usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris

<br> /usr/local/lib/perl5/site_perl/5.8.8

<br> /usr/local/lib/perl5/site_perl

<br>

<br>#####

<br>

<br>Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/specs

<br>Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77

<br>Thread model: posix

<br>gcc version 3.4.6

<br>

<br>#####

<br>

<br>GNU Make 3.81

<br>Copyright (C) 2006 Free Software Foundation, Inc.

<br>This is free software; see the source for copying conditions.

<br>There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

<br>PARTICULAR PURPOSE.

<br>

<br>This program built for sparc-sun-solaris2.9

<br>

<br>

<br>

<br>#####

<br>

<br>Any suggestions how to make "make" run succesfully? Is it possible to edit the Makefile to achieve "64bit awareness"?

<br>

<br> Just found, that I have a 32bit PERL:

<br>file /usr/local/bin/perl

<br> ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped

<br><br>Edited by: Axel Dahlke on Jul 29, 2009 4:01 PM

Edited by: Axel Dahlke on Jul 29, 2009 4:03 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi there, does anyone have any thoughts on my question?

Should I start a new thread (to avoid hijacking this one)?

Thanks much!

Former Member
0 Kudos

This indeed looks like a platform specific binary type issue.

Firstly, please go to CPAN and use the latest version 0.29 http://search.cpan.org/dist/sapnwrfc/ - altho this will not fix your problem. Are you sure that you have the correct SAP NW RFSSDK for your architecture from the SAP service portal? Additionally, you can refer to the OSS notes for compiling help - https://service.sap.com/sap/support/notes/1056696 .

Cheers.

Former Member
0 Kudos

I'm sure I have the correct SDK:

<br>

<br> file libsapnwrfc.so

<br>libsapnwrfc.so: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, dynamically linked, not stripped

<br>

<br>SAPNWRFC versions higher than 0.24 require PERL 5.10 but I'm at 5.8. My UNIX-admins are somewhat reluctant to install 5.10 as there seems to be no "offical" PERL 5.10 from Sun (may be I convince them to install from scratch).

<br>After reading the note (thank you for the hint) I'm still wondering where to specify these compiler flags

<br><br>Axel

Former Member
0 Kudos

Perl 5.8 should be fine - just modify the Makefile.PL.

Can you use ldd to check the library dependencies are intact?

The perl Makfile.PL --addlibs='-lsomethingwacky'

option --addlibs should work, as per the help instructions. Let me know if this is not the case.

Other places to look are in lib/SAPNW/Makefile.PL - the $ADDITIONAL_LIBS variable gets passed through.

Cheers.

Former Member
0 Kudos

Seems, that on complile-time there are no 64bit-libraries available, there's only /usr/lib and usr/local/lib in the lib-path:

/opt/sapnwrfc/lib> ldd libsapnwrfc.so

libdl.so.1 => /usr/lib/64/libdl.so.1

libnsl.so.1 => /usr/lib/64/libnsl.so.1

libsocket.so.1 => /usr/lib/64/libsocket.so.1

libCstd.so.1 => /usr/lib/64/libCstd.so.1

libCrun.so.1 => /usr/lib/64/libCrun.so.1

libm.so.1 => /usr/lib/64/libm.so.1

libw.so.1 => /usr/lib/64/libw.so.1

libuuid.so.1 => /usr/lib/64/libuuid.so.1

libc.so.1 => /usr/lib/64/libc.so.1

libmp.so.2 => /usr/lib/64/libmp.so.2

/usr/platform/SUNW,Sun-Fire-V490/lib/sparcv9/libc_psr.so.1

Fortunately this is my last day before my well earned vaction on the (hopefully) sunny beaches of Denmark, so the next time I will be back on this matter is somewhere in the end of August.

Thanks for your hints so far.

Axel

Former Member
0 Kudos

It sounds like your compiler is operating in 32bit mode - I'm sorry - I'm not very familiar with Solaris these days, but I would be checking this next.

Cheers.

Former Member
0 Kudos

Hi Piers, and others:

I'm on a 64bit platform.

I initially ran into this same issue (32/64 bit incompatiblity) but I set my complier flag to generate 64 bit executables.

That got me past the compliation issues.

When running the test however the module won't load:

perl ptest.pl

Can't load '/usr/local/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0/auto/SAPNW/Connection/Connection.so' for module SAPNW::Connection: Invalid argument at /usr/local/lib/perl5/5.10.1/IA64.ARCHREV_0/DynaLoader.pm line 200.

at /usr/local/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0/sapnwrfc.pm line 18

Compilation failed in require at /usr/local/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0/sapnwrfc.pm line 18.

BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0/sapnwrfc.pm line 18.

Compilation failed in require at ptest.pl line 5.

BEGIN failed--compilation aborted at ptest.pl line 5.

file /usr/local/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0/auto/SAPNW/Connection/Connection.so

/usr/local/lib/perl5/site_perl/5.10.1/IA64.ARCHREV_0/auto/SAPNW/Connection/Connection.so: ELF-64 shared object file - IA64

Did I mess things up?

Is anyone using the SAPNWRFC modules on a 64 bit platform?

Thanks much!