From: Travis Vachon Subject: libxenstat python bindings Date: Mon, 17 Oct 2005 10:10:44 -0400 Message-ID: <1129558244.18539.8.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7BIT Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi I seem to be having a little trouble with libxenstat, and was wondering if the xenstat guys might be able to help. I've pulled the xen-unstable.hg tree and done a somewhat clean install (ie, post-make uninstall, as well as deleting the relevant libxenstat libraries). Next, I entered the tools/xenstat/libxenstat directory and modified the Makefile so that the shared libraries would be installed. I've included my Makefile below. I ran: make make install make python-bindings make install-python-bindings Next, I started a python session and entered: import xenstat and got the following output. > Python 2.3.5 (#2, Sep 4 2005, 22:01:42) > [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import xenstat > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.3/site-packages/xenstat.py", line 5, in ? > import _xenstat > ImportError: /usr/local/lib/python2.3/site-packages/_xenstat.so: undefined symbol: xenstat_init > Any thoughts? Thanks! Travis Makefile: # libxenstat: statistics-collection library for Xen # Copyright (C) International Business Machines Corp., 2005 # Author: Josh Triplett # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. XEN_ROOT=../../.. include $(XEN_ROOT)/tools/Rules.mk LINUX_ROOT := $(XEN_ROOT)/linux-2.6-xen-sparse INSTALL = install INSTALL_PROG = $(INSTALL) -m0755 -D INSTALL_DATA = $(INSTALL) -m0644 -D prefix=/usr/local includedir=$(prefix)/include libdir=$(prefix)/lib LDCONFIG=ldconfig MAKE_LINK=ln -sf MAJOR=0 MINOR=0 LIB=src/libxenstat.a SHLIB=src/libxenstat.so.$(MAJOR).$(MINOR) SHLIB_LINKS=src/libxenstat.so.$(MAJOR) src/libxenstat.so OBJECTS=src/xenstat.o src/xen-interface.o SONAME_FLAGS=-Wl,-soname -Wl,libxenstat.so.$(MAJOR) WARN_FLAGS=-Wall -Werror CFLAGS+=-Isrc -I$(XEN_LIBXC) LDFLAGS+=-Lsrc all: $(LIB) $(SHLIB) $(LIB): $(OBJECTS) $(AR) rc $@ $^ $(RANLIB) $@ $(SHLIB): $(OBJECTS) $(CC) $(LDFLAGS) $(SONAME_FLAGS) -shared -o $@ $(OBJECTS) src/xenstat.o: src/xenstat.c src/xenstat.h src/xen-interface.h $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $< src/xen-interface.o: src/xen-interface.c src/xen-interface.h $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $< src/libxenstat.so.$(MAJOR): $(LIB) $(MAKE_LINK) $(