Numeric compiling problem under QNX 4.25
zhonghua.m.yang at gmail.com
Wed Apr 4 17:47:29 EDT 2007
On Apr 3, 2:52 pm, Robert Kern <robert.k... at gmail.com> wrote:
> ZMY wrote:
> > On Apr 3, 10:51 am, Robert Kern <robert.k... at gmail.com> wrote:
> >> ZMY wrote:
> >>> Is "ld" part of make command? I am not familiar with compiling with
> >>> make in general.
> >> No, it's the linker. I takes the object files (.o) which are generated by the
> >> compiler (cc, I imagine) and links them together into the shared library (.so).
> >> make is a program that can automate builds given instructions, but Numeric
> >> doesn't use it, nor do most other Python packages.
> >>> Most other extensions (including math, os, struct, cPickle) from
> >>> Python 2.2 works when I install python on QNX.
> >> No, I was wondering if you could build any other third-party extension modules.
> >> Did you install Python from source? When building extension modules, Python uses
> >> whatever linker was used to build itself.
> >> --
> >> Robert Kern
> >> "I have come to believe that the whole world is an enigma, a harmless enigma
> >> that is made terrible by our own mad attempt to interpret it as though it had
> >> an underlying truth."
> >> -- Umberto E
> > Dear Robert,
> > Looks like you are right. Here is what I got when I compile the
> > Python2.2 from source (or I believe so):
> > $ sudo make SHELL=/usr/local/bin/bash
> > Password:
> > case $MAKEFLAGS in \
> > *-s*) CC='cc' LDSHARED='ld' OPT='-DNDEBUG -O' ./python -E //6/openqnx/
> > Python-2.2/setup.py -q build;; \
> > *) CC='cc' LDSHARED='ld' OPT='-DNDEBUG -O' ./python -E //6/openqnx/
> > Python-2.2/setup.py build;; \
> > esac
> > running build
> > running build_ext
> > building 'regex' extension
> > skipping //6/openqnx/Python-2.2/Modules/regexmodule.c (build/temp.qnx-
> > O-PCI-2.2/regexmodule.o up-to-date)
> > skipping //6/openqnx/Python-2.2/Modules/regexpr.c (build/temp.qnx-O-
> > PCI-2.2/regexpr.o up-to-date)
> > ld build/temp.qnx-O-PCI-2.2/regexmodule.o build/temp.qnx-O-PCI-2.2/
> > regexpr.o -L/usr/local/lib -o build/lib.qnx-O-PCI-2.2/regex.so
> > unable to execute ld: No such file or directory
> > ....
> > If there is no 'ld' linker, what should be used instead??
> I don't know. I've never used QNX. It looks like the Python binaries were built
> with a linker that you don't have on your system. Usually, you have to use the
> same compiler/linker combination to build extension modules that you used to
> build Python itself.
> Robert Kern
> "I have come to believe that the whole world is an enigma, a harmless enigma
> that is made terrible by our own mad attempt to interpret it as though it had
> an underlying truth."
> -- Umberto Eco
I finally figured out how to install Numeric Python on QNX4. To my
understanding of a QNX programmer's lecture, the problem of QNX4 is
that it doesn't support dynamic linking, so the linker can't link the
new compiled object files with existing python binary. The new module
must be built together with python itself.
What I did was:
1) copy every file in /Lib, /Src, /Include from Numeric/ into the
corresponding directories in /openqnx/Python2.2/ (I put *object files
2) change Modules/Setup to include following (ranlib and arraytypes
don't work, but I got modules I need)
_numpy _numpymodule.c arrayobject.c ufuncobject.c
#ranlib ranlibmodule.c ranlib.c
# arraytypes arraytypes.c
3) install from source by make
Thanks a lot for all your help again!
More information about the Python-list