Issues with Python netsnmp Extension Module on Solaris 10

"Michael Becker" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Version info
$ uname -a
SunOS osswlg1 5.10 Generic_118833-33 sun4u sparc SUNW,Netra-240
$ python -V
Python 2.5.1
net-snmp-5.4.2.1
$ cc -V
cc: Sun C 5.8 Patch 121015-06 2007/10/03

First of all I ran into an error when I tried running "python setup.py
build"
The main issue was that the cc command the build executed did not
include the correct include options to include the net-snmp header
files:
cc -DNDEBUG -O -xcode=pic32 -I/usr/local/include/python2.5 -c netsnmp/
client_intf.c -o build/temp.solaris-2.10-sun4u-2.5/netsnmp/
client_intf.o
"netsnmp/client_intf.c", line 3: cannot find include file: <net-snmp/
net-snmp-config.h>
"netsnmp/client_intf.c", line 4: cannot find include file: <net-snmp/
net-snmp-includes.h>

I manually added the needed include options as follows and the
compilation completed without error (though with many warnings):
cc -DNDEBUG -O -xcode=pic32 -I/usr/local/include/python2.5 -I../
include -c netsnmp/client_intf.c -o build/temp.solaris-2.10-sun4u-2.5/
netsnmp/client_intf.o

At this point I was able to successfully execute "python setup.py
install" as root and it appeared to run as expected without error

The issue I now have is when I try to import the module:
>>> import netsnmp
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "build/bdist.solaris-2.10-sun4u/egg/netsnmp/__init__.py", line
1, in <module>
 File "build/bdist.solaris-2.10-sun4u/egg/netsnmp/client.py", line 1,
in <module>
 File "build/bdist.solaris-2.10-sun4u/egg/netsnmp/client_intf.py",
line 7, in <module>
 File "build/bdist.solaris-2.10-sun4u/egg/netsnmp/client_intf.py",
line 6, in __bootstrap__
ImportError: ld.so.1: python: fatal: relocation error: file /home/
<redacted>/.python-eggs/netsnmp_python-1.0a1-py2.5-solaris-2.10-
sun4u.egg-tmp/netsnmp/client_intf.so: symbol timersub: referenced
symbol not found

I did a little digging and it looks like timersub is not defined in
Solaris 10. It looks like it may be in Solaris 11
http://kindurl.com/docs.sun.com/timersub-3c-operations-on-timeval and
opensolaris
http://kindurl.com/mail.opensolaris.org/add-timeradd-and-timersub-to

This seems like a pretty standard issue with Solaris as I've found
other libraries that use ifdef to define this function:
http://kindurl.com/src.opensolaris.org/cross-reference-rbridges
http://kindurl.com/cr.opensolaris.org/racoon2-work-framed-sdiff-lib
http://kindurl.com/cr.opensolaris.org/racoon2-work-cdiff-lib-missing

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.