Bugzilla – Bug 254
waf check fails on python bindings unit test when python is disabled
Last modified: 2008-07-16 13:31:50 UTC
I just ran ran waf check in the latest ns-3-dev (changeset 3428 75f74d6b6219). I have Python 2.5.2, g++ 4.2.3, Linux 2.6.24 on x86 Ubuntu 8.04. The bottom of the waf check output is as follows: -- Running NS-3 Python bindings unit tests... Traceback (most recent call last): File "utils/python-unit-tests.py", line 2, in <module> import ns3 ImportError: No module named ns3 Command ['/usr/bin/python', 'utils/python-unit-tests.py'] exited with code 1
Can you run './waf --shell' then 'echo $PYTHONPATH'? What does it show?
Hm... and what does configure say? Maybe Python just wasn't detected and so Python bindings were not compiled? Notice that you need Python development headers, not just the python interpreter. If so, I know the problem: I need to make python unit tests not run if python bindings are not enabled.
./waf --shell echo $PYTHONPATH /home/raj/code.nsnam.org/ns-3-dev/build/debug/bindings/python:/home/raj/code.nsnam.org/ns-3-dev/bindings/python/pybindgen ./waf configure Checking for program g++ : ok /usr/bin/g++ Checking for compiler version : ok Version 4.2.3 Checking for program cpp : ok /usr/bin/cpp Checking for program ar : ok /usr/bin/ar Checking for program ranlib : ok /usr/bin/ranlib Checking for compiler could create programs : ok Checking for compiler could create shared libs : ok Checking for compiler could create static libs : ok Checking for flags -O2 -DNDEBUG : ok Checking for flags -g -DDEBUG : ok Checking for flags -g3 -O0 -DDEBUG : ok Checking for flags -Wall : ok Checking for g++ : ok Checking for -Wno-error=deprecated-declarations compilation flag support : yes Checking for header stdlib.h : ok Checking for header stdlib.h : ok Checking for header signal.h : ok Checking for library rt : ok Checking for high precision time implementation : 128-bit integer Checking for header stdint.h : ok Checking for header inttypes.h : ok Checking for header sys/inttypes.h : not found Checking for package gtk+-2.0 >= 2.12 : ok Checking for package goocanvas gthread-2.0 : not found Checking for program python : ok /usr/bin/python Checking for Python version >= 2.4.2 : ok 2.5.2 Checking for library python2.5 : ok Checking for program python2.5-config : ok /usr/bin/python2.5-config Checking for header Python.h : ok Checking for Python module pybindgen : not found WARNING <wscript> pybindgen missing Checking for program bzr : not found WARNING <wscript> the program 'bzr' is needed in order to fetch pybindgen Checking for program diff : ok /usr/bin/diff Configuration finished successfully; project is now ready to build.
A note on the above, this was after doing hg pull, hg update, and then ./waf. I think this should have "just worked" but it didn't. I'm trying to clean and then compile again just now.
(In reply to comment #3) [...] > Checking for Python module pybindgen : not > found > WARNING <wscript> pybindgen missing > Checking for program bzr : not > found > WARNING <wscript> the program 'bzr' is needed in order to fetch pybindgen OK, got it. To be able to compile Python bindings, you need to either have the required pybindgen version already installed, or have bzr installed, which is used to fetch a copy of pybindgen. This means your Python bindings are disabled. I will make unit tests skip Python tests if Python bindings are not enabled, then close the bug.
(In reply to comment #5) > (In reply to comment #3) > [...] > > Checking for Python module pybindgen : not > > found > > WARNING <wscript> pybindgen missing > > Checking for program bzr : not > > found > > WARNING <wscript> the program 'bzr' is needed in order to fetch pybindgen > > OK, got it. To be able to compile Python bindings, you need to either have the > required pybindgen version already installed, or have bzr installed, which is > used to fetch a copy of pybindgen. > > This means your Python bindings are disabled. I will make unit tests skip > Python tests if Python bindings are not enabled, then close the bug. > And might I suggest adding something about bzr to the wiki page you made about bindings?
(In reply to comment #6) [...] > And might I suggest adding something about bzr to the wiki page you made about > bindings? Indeed. Good idea. Done.