Bug 1250

Summary: waf configure do not check for Python.h (python-dev)
Product: ns-3 Reporter: Marcos Talau <talau>
Component: build systemAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: RESOLVED FIXED    
Severity: normal CC: john.abraham.in, ns-bugs, talau, tomh
Priority: P5    
Version: pre-release   
Hardware: All   
OS: All   
Attachments: build/config.log
./waf -v

Description Marcos Talau 2011-08-22 15:40:33 UTC
$ cd ns-allinone-3.12-RC1/ns-3.12-RC1

$ ./waf configure
[...]
'configure' finished successfully (5.336s)

$ ./waf
[...]
[ 979/1359] cxx: src/visualizer/model/visual-simulator-impl.cc -> build/debug/src/visualizer/model/visual-simulator-impl_389.o
../src/visualizer/model/visual-simulator-impl.cc:20:20: fatal error: Python.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/tmp/ns-allinone-3.12-RC1/ns-3.12-RC1/build'
Build failed:  -> task failed (err #1): 
        {task: cxx visual-simulator-impl.cc -> visual-simulator-impl_389.o}


After install package python-dev this was fixed.
Comment 1 Gustavo J. A. M. Carneiro 2011-08-22 16:11:32 UTC
Please attach the file build/config.log.
Comment 2 Marcos Talau 2011-08-23 14:03:16 UTC
Created attachment 1221 [details]
build/config.log

Sorry for the delay. Attached :)
Comment 3 Gustavo J. A. M. Carneiro 2011-08-23 14:24:21 UTC
Does the directory /usr/include/python2.6 contain a Python.h file?
Also, could you attach the output of "./waf -v"?  Sorry for not asking sooner.
Comment 4 Marcos Talau 2011-08-23 15:28:19 UTC
Created attachment 1222 [details]
./waf -v

./waf -v
Comment 5 Marcos Talau 2011-08-23 15:29:01 UTC
(In reply to comment #3)
> Does the directory /usr/include/python2.6 contain a Python.h file?

No. When I install the package 'python2.6-dev' this file is created.

> Also, could you attach the output of "./waf -v"?  Sorry for not asking sooner.

No problem.. Attached.
Comment 6 Gustavo J. A. M. Carneiro 2011-08-23 16:12:26 UTC
I don't get it, the compilation line includes -I/usr/include/python2.6, and you say the file /usr/include/python2.6/Python.h exists, yet the compilation error is:

../src/visualizer/model/visual-simulator-impl.cc:20:20: fatal error: Python.h: No such file or directory

It appears the ns-3 build system is doing everything right, yet the compilation still fails, so I'm inclined to believe something on your system is not right.  Can you double-check that /usr/include/python2.6/Python.h exists and is readable by your user?
Comment 7 Marcos Talau 2011-08-23 17:27:13 UTC
(In reply to comment #6)
> I don't get it, the compilation line includes -I/usr/include/python2.6, and you
> say the file /usr/include/python2.6/Python.h exists, yet the compilation error
> is:
> 

Hey :\   Wait here, you don't understand me. Has I said at first comment, when I have the package 'python-dev' installed the build is completed without any errors. This BUG was created to inform that when python headers are not present, the build system fails. I think that 'waf configure' *needs* to check if a build dependency is present on the system, right? :)
Comment 8 Gustavo J. A. M. Carneiro 2011-08-23 17:38:01 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > I don't get it, the compilation line includes -I/usr/include/python2.6, and you
> > say the file /usr/include/python2.6/Python.h exists, yet the compilation error
> > is:
> > 
> 
> Hey :\   Wait here, you don't understand me. Has I said at first comment, when
> I have the package 'python-dev' installed the build is completed without any
> errors. This BUG was created to inform that when python headers are not
> present, the build system fails. I think that 'waf configure' *needs* to check
> if a build dependency is present on the system, right? :)

Ah, I see, I hadn't understood it.  In any case, your system is unusual that python-config exists even when python-dev is not installed.  Until now, in the systems I found  python-config was only installed then the python headers and library were installed.
Comment 9 Tom Henderson 2011-08-24 00:30:48 UTC
downgrading from release blocker
Comment 10 John Abraham 2011-08-24 15:37:30 UTC
(In reply to comment #9)
> downgrading from release blocker

This problem can also be seen on a fresh installation of Ubuntu 11. Installing python-dev fixes it
Comment 11 Gustavo J. A. M. Carneiro 2011-08-25 14:24:49 UTC
changeset:   7462:287082f2be5c
tag:         tip
user:        Gustavo J. A. M. Carneiro  <gjc@inescporto.pt>
date:        Thu Aug 25 19:24:06 2011 +0100
summary:     Bug 1250 - waf configure do not check for Python.h (python-dev)