[LTP] get_mempolicy failing to compile
$rik@nth
srikanth007m@gmail.com
Thu Jan 21 13:42:18 CET 2016
Yes it able to compile without any issues.
linaro@linaro-alip:~/Srikanth$ cat > numatest.c <<EOF
> #include <stdio.h>
> #include <numa.h>
> int main(void)
> {
> printf("%d\n", numa_max_possible_node());
> return 0;
> }
> EOF
linaro@linaro-alip:~/Srikanth$ gcc numatest.c -lnuma
linaro@linaro-alip:~/Srikanth$ ls -l
total 20
-rwxr-xr-x 1 linaro linaro 7920 Jan 21 12:26 a.out
-rw-r--r-- 1 linaro linaro 124 Jan 21 12:26 numatest.c
On 1/21/16, Jan Stancek <jstancek@redhat.com> wrote:
>
> ----- Original Message -----
>> From: "$rik@nth" <srikanth007m@gmail.com>
>> To: "Jan Stancek" <jstancek@redhat.com>
>> Cc: ltp@lists.linux.it
>> Sent: Thursday, 21 January, 2016 12:54:35 PM
>> Subject: Re: [LTP] get_mempolicy failing to compile
>>
>> My environment is ARM ubuntu and all my libs and packages are in AMR.
>
> I just noticed that config.log shows that -static is passed to gcc.
> Can you run "dpkg -L libnuma-dev" to check you have static library
> to link against?
>
> Can you link against -lnuma outside of LTP build?
>
> For example:
>
> cat > numatest.c <<EOF
> #include <stdio.h>
> #include <numa.h>
> int main(void)
> {
> printf("%d\n", numa_max_possible_node());
> return 0;
> }
> EOF
> gcc numatest.c -lnuma
>
>
>>
>> Yes still i am seeing the same issue even it is having arm libnuma-dev
>> packages and also numactl.
>>
>> On Thu, Jan 21, 2016 at 4:36 PM, Jan Stancek <jstancek@redhat.com> wrote:
>> >
>> >
>> >
>> >
>> > ----- Original Message -----
>> >> From: "$rik@nth" <srikanth007m@gmail.com>
>> >> To: "Jan Stancek" <jstancek@redhat.com>
>> >> Cc: ltp@lists.linux.it
>> >> Sent: Thursday, 21 January, 2016 11:18:17 AM
>> >> Subject: Re: [LTP] get_mempolicy failing to compile
>> >>
>> >> libnuma-dev is already installed on my system. Any reason why still it
>> >> is failing to link with libraries?
>> >
>> > It looks like you are cross-compiling, do you have it installed
>> > for target as well? (I'm assuming you're running on x86 and
>> > cross compiling for arm)
>> >
>> > Do you see the problem also if you compile for host (not
>> > cross-compile)?
>> >
>> >>
>> >> On Thu, Jan 21, 2016 at 1:06 PM, Jan Stancek <jstancek@redhat.com>
>> >> wrote:
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > ----- Original Message -----
>> >> >> From: "$rik@nth" <srikanth007m@gmail.com>
>> >> >> To: ltp@lists.linux.it
>> >> >> Sent: Wednesday, 20 January, 2016 2:22:00 PM
>> >> >> Subject: [LTP] get_mempolicy failing to compile
>> >> >>
>> >> >> Hi All,
>> >> >>
>> >> >> I am trying to compile latest snapshot from github [1] and getting
>> >> >> below
>> >> >> errors.
>> >> >>
>> >> >> arm-linux-gnueabihf-gcc -static -g -O2 -fno-strict-aliasing -pipe
>> >> >> -Wall -W -Wold-style-definition
>> >> >> -I/home/hydlnxbld84/Srikanth/ltp/testcases/kernel/include
>> >> >> -I/home/hydlnxbld84/Srikanth/ltp/testcases/kernel/syscalls/get_mempolicy/../utils
>> >> >> -I/home/hydlnxbld84/Srikanth/ltp/testcases/kernel/include
>> >> >> -I../../../../include -I../../../../include -static -pthread
>> >> >> -L/home/hydlnxbld84/Srikanth/ltp/testcases/kernel/lib
>> >> >> -L../../../../lib get_mempolicy01.c -lltp -lkerntest -lltp -o
>> >> >> get_mempolicy01
>> >> >> In file included from get_mempolicy01.c:63:0:
>> >> >> /home/hydlnxbld84/Srikanth/ltp/testcases/kernel/syscalls/get_mempolicy/../utils/common_j_h.c:
>> >> >> In function âsigterm_handlerâ:
>> >> >> /home/hydlnxbld84/Srikanth/ltp/testcases/kernel/syscalls/get_mempolicy/../utils/common_j_h.c:111:33:
>> >> >> warning: unused parameter âsigâ [-Wunused-parameter]
>> >> >> static void sigterm_handler(int sig)
>> >> >> ^
>> >> >> get_mempolicy01.c: In function âmainâ:
>> >> >> get_mempolicy01.c:197:14: warning: unused parameter âargcâ
>> >> >> [-Wunused-parameter]
>> >> >> int main(int argc, char **argv)
>> >> >> ^
>> >> >> get_mempolicy01.c:197:27: warning: unused parameter âargvâ
>> >> >> [-Wunused-parameter]
>> >> >> int main(int argc, char **argv)
>> >> >> ^
>> >> >> /tmp/cciaYvm7.o: In function `setup_uid':
>> >> >> /home/Srikanth/ltp/testcases/kernel/syscalls/get_mempolicy/../utils/common_j_h.c:64:
>> >> >> warning: Using 'getpwnam' in statically linked applications
>> >> >> requires
>> >> >> at runtime the shared libraries from the glibc version used for
>> >> >> linking
>> >> >> /tmp/cciaYvm7.o: In function `main':
>> >> >> get_mempolicy01.c:(.text.startup+0x9c): undefined reference to
>> >> >> `numa_allocate_nodemask'
>> >> >> get_mempolicy01.c:(.text.startup+0xa2): undefined reference to
>> >> >> `numa_allocate_nodemask'
>> >> >> get_mempolicy01.c:(.text.startup+0xc2): undefined reference to
>> >> >> `numa_bitmask_setbit'
>> >> >> get_mempolicy01.c:(.text.startup+0x2ce): undefined reference to
>> >> >> `numa_bitmask_clearall'
>> >> >> get_mempolicy01.c:(.text.startup+0x2e8): undefined reference to
>> >> >> `numa_bitmask_equal'
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/libkerntest.a(numa_helper.o):
>> >> >> In function `get_max_node':
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/numa_helper.c:53: undefined
>> >> >> reference to `numa_max_possible_node'
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/numa_helper.c:53: undefined
>> >> >> reference to `numa_max_possible_node'
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/libkerntest.a(numa_helper.o):
>> >> >> In function `get_nodemask_allnodes':
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/numa_helper.c:71: undefined
>> >> >> reference to `nodemask_set'
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/libkerntest.a(numa_helper.o):
>> >> >> In function `get_allowed_nodes_arr':
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/numa_helper.c:191:
>> >> >> undefined
>> >> >> reference to `nodemask_isset'
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/libkerntest.a(numa_helper.o):
>> >> >> In function `filter_nodemask_cpu':
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/numa_helper.c:126:
>> >> >> undefined
>> >> >> reference to `nodemask_isset'
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/numa_helper.c:133:
>> >> >> undefined
>> >> >> reference to `nodemask_clr'
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/libkerntest.a(numa_helper.o):
>> >> >> In function `get_max_node':
>> >> >> /home/Srikanth/ltp/testcases/kernel/lib/numa_helper.c:53: undefined
>> >> >> reference to `numa_max_possible_node'
>> >> >> collect2: error: ld returned 1 exit status
>> >> >> make[4]: *** [get_mempolicy01] Error 1
>> >> >>
>> >> >> Attached is my config log for reference.
>> >> >
>> >> > According to your log you have numa headers, but don't heave numa
>> >> > library
>> >> > to link against.
>> >> >
>> >> > #define HAVE_NUMA_H 1
>> >> > #define HAVE_NUMAIF_H 1
>> >> >
>> >> > NUMA_CPPFLAGS=''
>> >> > NUMA_LIBS=''
>> >> >
>> >> > Both should come from numactl devel package. To unblock compilation
>> >> > you can edit include/config.h and set any numa related options to 0.
>> >> > Then make clean && make should work.
>> >> >
>> >> > Regards,
>> >> > Jan
>> >> >
>> >> >>
>> >> >>
>> >> >> [1] https://github.com/linux-test-project/ltp
>> >> >>
>> >> >> --
>> >> >> Thanks & Regards,
>> >> >> M.Srikanth Kumar.
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Mailing list info: http://lists.linux.it/listinfo/ltp
>> >> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Thanks & Regards,
>> >> M.Srikanth Kumar.
>> >>
>>
>>
>>
>> --
>> Thanks & Regards,
>> M.Srikanth Kumar.
>>
>
--
Thanks & Regards,
M.Srikanth Kumar.
More information about the Ltp
mailing list