* [BUG] perf: cannot generate Python support without NEWT
@ 2011-03-18 14:19 Stephane Eranian
2011-03-29 18:02 ` [PATCH] perf tools: Fix NO_NEWT=1 python build error Robert Richter
0 siblings, 1 reply; 3+ messages in thread
From: Stephane Eranian @ 2011-03-18 14:19 UTC (permalink / raw)
To: LKML
Cc: Arnaldo Carvalho de Melo, Peter Zijlstra,
Frédéric Weisbecker, mingo
Arnaldo,
Looks like some define is missing during the generation of the python support.
If you don't have newt then it fails to compile:
$ make
Makefile:430: newt not found, disables TUI support. Please install
newt-devel or libnewt-dev
PERF_VERSION = 2.6.38
Makefile:430: newt not found, disables TUI support. Please install
newt-devel or libnewt-dev
...
GEN perf-archive
GEN python/perf.so
In file included from util/evsel.h:10,
from util/python.c:6:
util/hist.h:105: fatal error: newt.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] perf tools: Fix NO_NEWT=1 python build error
2011-03-18 14:19 [BUG] perf: cannot generate Python support without NEWT Stephane Eranian
@ 2011-03-29 18:02 ` Robert Richter
2011-03-30 7:17 ` [tip:perf/urgent] " tip-bot for Robert Richter
0 siblings, 1 reply; 3+ messages in thread
From: Robert Richter @ 2011-03-29 18:02 UTC (permalink / raw)
To: Stephane Eranian
Cc: LKML, Arnaldo Carvalho de Melo, Peter Zijlstra,
Frédéric Weisbecker, mingo@elte.hu
On 18.03.11 10:19:59, Stephane Eranian wrote:
> Looks like some define is missing during the generation of the python support.
> If you don't have newt then it fails to compile:
>
> $ make
> Makefile:430: newt not found, disables TUI support. Please install
> newt-devel or libnewt-dev
> PERF_VERSION = 2.6.38
> Makefile:430: newt not found, disables TUI support. Please install
> newt-devel or libnewt-dev
> ...
> GEN perf-archive
> GEN python/perf.so
> In file included from util/evsel.h:10,
> from util/python.c:6:
> util/hist.h:105: fatal error: newt.h: No such file or directory
> compilation terminated.
> error: command 'gcc' failed with exit status 1
I encountered the same problem. See my fix below.
-Robert
>From 5a64703b924b67165ec20607f7cb057231edbeae Mon Sep 17 00:00:00 2001
From: Robert Richter <robert.richter@amd.com>
Date: Tue, 29 Mar 2011 18:16:27 +0200
Subject: [PATCH] perf tools: Fix NO_NEWT=1 python build error
Fix the following build error:
GEN python/perf.so
In file included from util/evsel.h:10,
from util/python.c:6:
util/hist.h:106:18: error: newt.h: No such file or directory
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
make: *** [python/perf.so] Error 1
by passing BASIC_CFLAGS to setup.py. BASIC_CFLAGS variable contains
the -DNO_NEWT_SUPPORT switch which prevents building python c
extension with newt.
Signed-off-by: Robert Richter <robert.richter@amd.com>
---
tools/perf/Makefile | 8 ++++++--
tools/perf/util/setup.py | 7 ++++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 158c30e..207dee5 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -165,8 +165,12 @@ grep-libs = $(filter -l%,$(1))
strip-libs = $(filter-out -l%,$(1))
$(OUTPUT)python/perf.so: $(PYRF_OBJS)
- $(QUIET_GEN)python util/setup.py --quiet build_ext --build-lib='$(OUTPUT)python' \
- --build-temp='$(OUTPUT)python/temp'
+ $(QUIET_GEN)( \
+ export CFLAGS="$(BASIC_CFLAGS)"; \
+ python util/setup.py --quiet build_ext --build-lib='$(OUTPUT)python' \
+ --build-temp='$(OUTPUT)python/temp' \
+ )
+
#
# No Perl scripts right now:
#
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index e24ffad..bbc982f 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -1,13 +1,18 @@
#!/usr/bin/python2
from distutils.core import setup, Extension
+from os import getenv
+
+cflags = ['-fno-strict-aliasing', '-Wno-write-strings']
+cflags += getenv('CFLAGS', '').split()
perf = Extension('perf',
sources = ['util/python.c', 'util/ctype.c', 'util/evlist.c',
'util/evsel.c', 'util/cpumap.c', 'util/thread_map.c',
'util/util.c', 'util/xyarray.c', 'util/cgroup.c'],
include_dirs = ['util/include'],
- extra_compile_args = ['-fno-strict-aliasing', '-Wno-write-strings'])
+ extra_compile_args = cflags,
+ )
setup(name='perf',
version='0.1',
--
1.7.3.4
--
Advanced Micro Devices, Inc.
Operating System Research Center
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [tip:perf/urgent] perf tools: Fix NO_NEWT=1 python build error
2011-03-29 18:02 ` [PATCH] perf tools: Fix NO_NEWT=1 python build error Robert Richter
@ 2011-03-30 7:17 ` tip-bot for Robert Richter
0 siblings, 0 replies; 3+ messages in thread
From: tip-bot for Robert Richter @ 2011-03-30 7:17 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, eranian, hpa, mingo, peterz, robert.richter,
fweisbec, tglx, mingo
Commit-ID: 1b7155f7de119870f0d3fad89f125de2ff6c16be
Gitweb: http://git.kernel.org/tip/1b7155f7de119870f0d3fad89f125de2ff6c16be
Author: Robert Richter <robert.richter@amd.com>
AuthorDate: Tue, 29 Mar 2011 20:02:57 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 29 Mar 2011 16:46:57 -0300
perf tools: Fix NO_NEWT=1 python build error
Fix the following build error:
GEN python/perf.so
In file included from util/evsel.h:10,
from util/python.c:6:
util/hist.h:106:18: error: newt.h: No such file or directory
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
make: *** [python/perf.so] Error 1
by passing BASIC_CFLAGS to setup.py. BASIC_CFLAGS variable contains
the -DNO_NEWT_SUPPORT switch which prevents building python c
extension with newt.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <20110329180236.GA19366@erda.amd.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile | 8 ++++++--
tools/perf/util/setup.py | 7 ++++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 158c30e..207dee5 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -165,8 +165,12 @@ grep-libs = $(filter -l%,$(1))
strip-libs = $(filter-out -l%,$(1))
$(OUTPUT)python/perf.so: $(PYRF_OBJS)
- $(QUIET_GEN)python util/setup.py --quiet build_ext --build-lib='$(OUTPUT)python' \
- --build-temp='$(OUTPUT)python/temp'
+ $(QUIET_GEN)( \
+ export CFLAGS="$(BASIC_CFLAGS)"; \
+ python util/setup.py --quiet build_ext --build-lib='$(OUTPUT)python' \
+ --build-temp='$(OUTPUT)python/temp' \
+ )
+
#
# No Perl scripts right now:
#
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index e24ffad..bbc982f 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -1,13 +1,18 @@
#!/usr/bin/python2
from distutils.core import setup, Extension
+from os import getenv
+
+cflags = ['-fno-strict-aliasing', '-Wno-write-strings']
+cflags += getenv('CFLAGS', '').split()
perf = Extension('perf',
sources = ['util/python.c', 'util/ctype.c', 'util/evlist.c',
'util/evsel.c', 'util/cpumap.c', 'util/thread_map.c',
'util/util.c', 'util/xyarray.c', 'util/cgroup.c'],
include_dirs = ['util/include'],
- extra_compile_args = ['-fno-strict-aliasing', '-Wno-write-strings'])
+ extra_compile_args = cflags,
+ )
setup(name='perf',
version='0.1',
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-30 7:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18 14:19 [BUG] perf: cannot generate Python support without NEWT Stephane Eranian
2011-03-29 18:02 ` [PATCH] perf tools: Fix NO_NEWT=1 python build error Robert Richter
2011-03-30 7:17 ` [tip:perf/urgent] " tip-bot for Robert Richter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox