Cannot find the python SDK

Hmm, let’s try proving that it is in fact crashing when it calls that single Python function.

Edit dtool/metalibs/dtoolconfig/pydtool.cxx. Change:

void initlibdtoolconfig() {
  Py_InitModule("libdtoolconfig", python_simple_funcs);
}

To:

void initlibdtoolconfig() {
  cerr << "About to call Py_InitModule\n";
  Py_InitModule("libdtoolconfig", python_simple_funcs);
  cerr << "Done calling Py_InitModule\n";
}

Then recompile. It shouldn’t be necessary to make clean.

Then try importing libdtoolconfig, as above.

David

Here’s the tail end of the compile after making the changes to dtool/metalibs/dtoolconfig/pydtool.cxx :


Writing built/models/misc/sphere.bam
built/bin/flt2egg -pr ../= -o built/tmp/tmp.egg dmodels/src/misc/xyzAxis.flt

Reading dmodels/src/misc/xyzAxis.flt
Writing built/tmp/tmp.egg

built/bin/egg2bam -o built/models/misc/xyzAxis.bam built/tmp/tmp.egg

Writing built/models/misc/xyzAxis.bam
built/bin/egg2bam -pr ../= -o built/models/misc/Pointlight.bam dmodels/src/misc/Pointlight.egg

Writing built/models/misc/Pointlight.bam
built/bin/egg2bam -pr ../= -o built/models/misc/Dirlight.bam dmodels/src/misc/Dirlight.egg

Writing built/models/misc/Dirlight.bam
built/bin/egg2bam -pr ../= -o built/models/misc/Spotlight.bam dmodels/src/misc/Spotlight.egg

Writing built/models/misc/Spotlight.bam
built/bin/genpycode
enumerate is already present in __builtin__

Also…


bin/ppython
Python 2.3.3 (#2, Feb 17 2004, 11:45:40)
[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libdtoolconfig
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: libdtool.so: cannot open shared object file: No such file or directory
>>> dir(libdtoolconfig)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'libdtoolconfig' is not defined
>>>

Also, I did a “find” looking for “Py_InitModule” to see if it showed up in the compile and it didn’t. I believe that should have shown up if initlibdtoolconfig() was called, correct?

Allen

Py_InitModule is a function that’s part of the Python API. It wouldn’t be mentioned in the compilation output, and there’s no particular file by that name–it’s the name of a function.

Did you set LD_LIBRARY_PATH this time? Try setting that again. It looks like it wasn’t able to find your shared libraries.

David

Just to make sure I don’t shoot myself in the foot…


pwd
/home/allen/Downloads/Panda/panda3d-1.0.4

export LD_LIBRARY_PATH=file:/home/allen/Downloads/Panda/panda3d-1.0.4/built/lib

rm -fr built

makepanda/makepanda.py --everything

I did things in the order I presented in the previous post, hope that was right. Here’s the results, such as they are:

tail end of the compile


built/bin/egg2bam -o built/models/misc/sphere.bam built/tmp/tmp.egg

Writing built/models/misc/sphere.bam
built/bin/flt2egg -pr ../= -o built/tmp/tmp.egg dmodels/src/misc/xyzAxis.flt

Reading dmodels/src/misc/xyzAxis.flt
Writing built/tmp/tmp.egg

built/bin/egg2bam -o built/models/misc/xyzAxis.bam built/tmp/tmp.egg

Writing built/models/misc/xyzAxis.bam
built/bin/egg2bam -pr ../= -o built/models/misc/Pointlight.bam dmodels/src/misc/Pointlight.egg

Writing built/models/misc/Pointlight.bam
built/bin/egg2bam -pr ../= -o built/models/misc/Dirlight.bam dmodels/src/misc/Dirlight.egg

Writing built/models/misc/Dirlight.bam
built/bin/egg2bam -pr ../= -o built/models/misc/Spotlight.bam dmodels/src/misc/Spotlight.egg

Writing built/models/misc/Spotlight.bam
built/bin/genpycode
enumerate is already present in __builtin__

and…


$ cd built
$ bin/ppython
Python 2.3.3 (#2, Feb 17 2004, 11:45:40)
[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libdtoolconfig
Segmentation fault
$ bin/ppython
Python 2.3.3 (#2, Feb 17 2004, 11:45:40)
[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> dir(libdtoolconfig)

Hmm, this is stranger than I thought. It appears that it is in fact crashing before it calls initlibdtoolconfig, which means it must be crashing at static init time.

Since it does not crash when static init is run in pview, it might be some subtle problem with order of static init execution, or a name conflict on a system dynamic library, or something that is otherwise related to the fact that you are running within Python.

Maybe it is time to ask Josh to try to install Mandrake Linux so he can attempt to duplicate this problem. Josh, what do you think?

David

I agree, I need to install mandrake. But I’m already in the middle of doing the debian version. Mandrake is second in the queue.