[R-gui] R-wxPython and dynamic linking issues

James Wettenhall wettenhall at wehi.edu.au
Wed Jun 23 16:12:05 CEST 2004


Vaidotas,

On Wed, 23 Jun 2004, Vaidotas Zemlys wrote:
> Ok, I did that and then installed RSPython. The options 
> appeared when linking in installation output, but that did 
> not change a thing. I still get
>         Error in Python call: /usr/lib/python2.2/lib-dynload/parser.so:  
> undefined symbol: _Py_TrueStruct

OK, then this means that you have to build the Python 2.2.x 
shared modules linked against libpython2.2.so
i.e. in the Python 2.2.3 Makefile, you will see:

# Build the shared modules
sharedmods: $(BUILDPYTHON)
        case $$MAKEFLAGS in \
        *-s*) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
        *) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
        esac

You somehow have to make sure that libpython2.2.so is used and 
not libpython2.2.a 
It might be as simple as adding libpython2.2.so after
OPT='$(OPT)' or somewhere near there (remembering spaces on 
either side of it and remembering that backslash (\) means a 
continuation of the same line.  Hopefully you'll understand that 
I have had to insert extra backslashes because of unwanted 
line-wrapping in my email software.

You should try to work out what all of the make variables above 
are doing and in particular, you probably want change:
LDLIBRARY=      libpython$(VERSION).a
to:
LDLIBRARY=      libpython$(VERSION).so

and use "man gcc" to make sure you understand options like -E.


I guess you know how to run a configure script, e.g. if you want 
to customize the installation location, you can use --prefix, 
e.g.
./configure --prefix=/usr/local
[Edit Makefile]
make
make install

I have a feeling that I really should be telling you how to edit 
the configure script not the Makefile, but I can't see how to do 
that right now.

After you have finished building Python and its modules with 
libpython2.2.so, you can check that one of the modules depends 
on libpython2.2.so with ldd, e.g.
cd /usr/local/lib/python2.2/lib-dynload/
ldd parser.so

Hope this helps,
James



More information about the R-SIG-GUI mailing list