You are not logged in.

#1 2013-02-27 05:40:28

wych
Member
Registered: 2012-02-18
Posts: 11

[Sloved]A Problem of Could not find the Python.h while install ns-3

hey, I got a problem when compiling & install ns3
I was following the tutorial :download ns-3 using mercurial and build with waf,after run this "./waf -d debug --enable-examples --enable-tests configure" I got output with "Could not find the python development headers ".
I have both python3 and python2 installed,and system path is set to python2,and the Python.h is just there in /usr/include/,I have no idea how to fix it,any one can help me?
Here's the build log http://paste.kde.org/682700/

Last edited by wych (2013-02-28 10:21:38)


tonight is the night.

Offline

#2 2013-02-27 13:26:19

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [Sloved]A Problem of Could not find the Python.h while install ns-3

From the build log:

['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-fno-strict-aliasing', '-march=x86-64', '-mtune=generic', '-fstack-protector', '-march=x86-64', '-mtune=generic', '-fstack-protector', '-fno-strict-aliasing', '-fno-strict-aliasing', '-march=x86-64', '-mtune=generic', '-fstack-protector', '-march=x86-64', '-mtune=generic', '-fstack-protector', '-I/usr/include/python2.7', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYEMBED=1', '-D_FORTIFY_SOURCE=2', '-DNDEBUG', '-D_FORTIFY_SOURCE=2', '-D_FORTIFY_SOURCE=2', '-DNDEBUG', '-D_FORTIFY_SOURCE=2', '../test.cpp', '-c', '-o', 'test.cpp.1.o']
err: In file included from /usr/include/limits.h:26:0,
                 from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/include-fixed/limits.h:169,
                 from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/include-fixed/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/include-fixed/limits.h:34,
                 from /usr/include/python2.7/Python.h:19,
                 from ../test.cpp:2:
/usr/include/features.h:330:4: 错误:#warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
cc1plus: all warnings being treated as errors

Try this:

export CXXFLAGS="-O2"

or export the full CXXFLAGS from /etc/makepkg.conf

Last edited by teekay (2013-02-27 13:28:46)

Offline

#3 2013-02-28 10:21:16

wych
Member
Registered: 2012-02-18
Posts: 11

Re: [Sloved]A Problem of Could not find the Python.h while install ns-3

teekay wrote:

From the build log:

['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-fno-strict-aliasing', '-march=x86-64', '-mtune=generic', '-fstack-protector', '-march=x86-64', '-mtune=generic', '-fstack-protector', '-fno-strict-aliasing', '-fno-strict-aliasing', '-march=x86-64', '-mtune=generic', '-fstack-protector', '-march=x86-64', '-mtune=generic', '-fstack-protector', '-I/usr/include/python2.7', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DPYTHONDIR="/usr/local/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python2.7/site-packages"', '-DHAVE_PYEMBED=1', '-D_FORTIFY_SOURCE=2', '-DNDEBUG', '-D_FORTIFY_SOURCE=2', '-D_FORTIFY_SOURCE=2', '-DNDEBUG', '-D_FORTIFY_SOURCE=2', '../test.cpp', '-c', '-o', 'test.cpp.1.o']
err: In file included from /usr/include/limits.h:26:0,
                 from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/include-fixed/limits.h:169,
                 from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/include-fixed/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/include-fixed/limits.h:34,
                 from /usr/include/python2.7/Python.h:19,
                 from ../test.cpp:2:
/usr/include/features.h:330:4: 错误:#warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
cc1plus: all warnings being treated as errors

Try this:

export CXXFLAGS="-O2"

or export the full CXXFLAGS from /etc/makepkg.conf

thank you! It's done!


tonight is the night.

Offline

Board footer

Powered by FluxBB