On Fri, Aug 22, 2008 at 2:45 PM, Subrata Modak <[EMAIL PROTECTED]> wrote: > On Sat, 2008-08-23 at 00:07 +0530, Vijay Kumar wrote: >> Subrata Modak <[EMAIL PROTECTED]> wrote: >> > make[4]: Entering directory >> > `/root/subrata/ltp/ltp-intermediate-20080820/testcases/kernel/syscalls/move_pages' >> > cc -Wall -I../../include -g -Wall -I../../../../include -Wall -c -o >> > move_pages_support.o move_pages_support.c >> > cc -Wall -I../../include -g -Wall -I../../../../include -Wall >> > move_pages01.c move_pages_support.o -L../../../../lib -lltp -lnuma -lrt >> > -o move_pages01 >> > move_pages01.c: In function main: >> > move_pages01.c:101: warning: implicit declaration of function >> > numa_move_pages >> >> Hi Subrata, >> as pointed out by Jin Bing Guo, only recent versions of libnuma have >> support for move_pages(). It is necessary to check if move_pages() >> support is available before compiling the test cases. >> >> Changelog: >> >> * Check if move_pages() support is available in libnuma. >> >> Signed-off-by: Vijay Kumar <[EMAIL PROTECTED]> > > Yes, it solves the issue on 2.6.16.21-0.8-ppc64. Thanks for the patch. > It is merged now. > > Regards-- > Subrata > >> >> testcases/kernel/syscalls/move_pages/Makefile | 19 ++++++++++++++++++- >> 1 files changed, 18 insertions(+), 1 deletions(-) >> >> diff --git a/testcases/kernel/syscalls/move_pages/Makefile >> b/testcases/kernel/syscalls/move_pages/Makefile >> index 77cdbd9..4f861ed 100644 >> --- a/testcases/kernel/syscalls/move_pages/Makefile >> +++ b/testcases/kernel/syscalls/move_pages/Makefile >> @@ -19,12 +19,29 @@ >> CFLAGS += -I../../../../include -Wall >> LDLIBS += -L../../../../lib -lltp -lnuma -lrt >> >> -ifeq ($(HAS_NUMA),yes) >> +check_numa_move_pages = $(shell \ >> + if echo -e \ >> + "\#include <numa.h>\n\ >> + int main() \ >> + { \ >> + numa_move_pages(0, 0, NULL, NULL, NULL, 0); \ >> + return 0; \ >> + }" | $(CC) -xc -lnuma - > /dev/null 2>&1 ; \ >> + then echo yes ; \ >> + else echo no ; fi) >> + >> +HAS_NUMA_MOVE_PAGES := $(call check_numa_move_pages) >> + >> +ifeq ($(HAS_NUMA_MOVE_PAGES),yes) >> SRCS = $(wildcard *.c) >> TARGETS = $(patsubst %.c, %, $(wildcard *[0-9].c)) >> endif >> >> all: $(TARGETS) >> +ifeq ($(HAS_NUMA_MOVE_PAGES),no) >> + @echo "Note: Libnuma with move_pages support is required for" \ >> + "move_pages testcases."; >> +endif >> >> move_pages_support.o: move_pages_support.h move_pages_support.c
As promised earlier... Output: [EMAIL PROTECTED] ~ $ make -rf Makefile.example VERBOSE=1 # 1 "<stdin>" # 1 "<built-in>" # 1 "<command line>" # 1 "<stdin>" stdio.h Makefile.example:22: STDIO => 1 # 1 "<stdin>" # 1 "<built-in>" # 1 "<command line>" # 1 "<stdin>" 1/numa.h Makefile.example:28: NUMA => 1 /tmp/ccueUqA8.o: In function `main': :(.text+0x4c): undefined reference to `numa_move_pages' collect2: ld returned 1 exit status Makefile.example:31: HAS_NUMA_MOVE_PAGES => 0 Makefile.example:34: HAS_RTPRIO => 1 make: `all' is up to date. [EMAIL PROTECTED] ~ $ make -rf Makefile.example VERBOSE=0 Makefile.example:22: STDIO => 1 Makefile.example:28: NUMA => 1 Makefile.example:31: HAS_NUMA_MOVE_PAGES => 0 Makefile.example:34: HAS_RTPRIO => 1 make: `all' is up to date. # ======================== # Proof of concept defines. # ======================== # Just for PoC output -- change $(REDIR) to the 2nd option later in release Makefiles. ifeq ($(VERBOSE),1) REDIR := 1>&2 else REDIR := >&/dev/null endif # # Add the following define blocks to your Makefile. # define __has_header HAS_$(1) := $(shell echo -e '$(2)' | $(CC) $(CFLAGS) $(CPPFLAGS) -E - $(REDIR) && echo 1 || echo 0; $(RM) -- -.o >& /dev/null) endef define __has_compile_support HAS_$(1) := $(shell echo -e '$(2)\nint main (void) { $(3) ; return 0; }' | $(CC) $(CFLAGS) $(CPPFLAGS) -xc - $(REDIR) && echo 1 || echo 0; $(RM) -- -.o >& /dev/null) endef # # End # KERNEL_HEADERS := /usr/src/linux # Need to reference the kernel headers for numa.h CFLAGS += -I$(KERNEL_HEADERS)/include # Examples $(eval $(call __has_header,STDIO,stdio.h)) $(warning STDIO => $(HAS_STDIO)) $(eval $(call __has_header,NUMA,linux/numa.h)) $(warning NUMA => $(HAS_NUMA)) $(eval $(call __has_compile_support,NUMA_MOVE_PAGES,#include <stdlib.h>\n#include <linux/numa.h>,numa_move_pages(0, 0, NULL, NULL, NULL, 0);)) $(warning HAS_NUMA_MOVE_PAGES => $(HAS_NUMA_MOVE_PAGES)) $(eval $(call __has_compile_support,RTPRIO,#include <sys/resource.h>,int foo=RLIMIT_RTPRIO;)) $(warning HAS_RTPRIO => $(HAS_RTPRIO)) # Stub so make doesn't [EMAIL PROTECTED] about not finding targets. all: ; ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list