cyclictest 主要是用于测试系统延时,进而判断系统的实时性
使用版本
rt-tests-2.6.tar.gz
numactl v2.0.16
问题
编译时,需要先编译 numactl
,不然会有以下报错:
arm-linux-gnueabihf-gcc -D VERSION=2.6 -c src/cyclictest/cyclictest.c -Wall -Wno-nonnull -Wextra -O2 -g -D_GNU_SOURCE -Isrc/include -o bld/cyclictest.o
In file included from src/cyclictest/cyclictest.c:33:
src/cyclictest/rt_numa.h:18:10: fatal error: numa.h: 没有那个文件或目录#include <numa.h>^~~~~~~~
compilation terminated.
Makefile:106: recipe for target 'bld/cyclictest.o' failed
make: *** [bld/cyclictest.o] Error 1
编译 numactl
文件下载 https://github.com/numactl/numactl/tree/v2.0.16
编译命令:
./autogen.sh
./configure CC=arm-linux-gnueabihf-gcc --host=arm prefix=~/git/numactl-2.0.16/build
make install
这是主要用到编译生成的 lib
及 include
里的文件
编译 cyclictest
下载文件 :
https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/
打开 Makefile
文件:
在 RTTESTLIB
后面加上 -L/home/XXX/git/numactl-2.0.16/build/lib
在 CPPFLAGS
后面加上 -I/home/XXX/git/numactl-2.0.16/build/include
RTTESTLIB = -lrttest -L$(OBJDIR) -L/home/XXX/git/numactl-2.0.16/build/lib
CPPFLAGS += -D_GNU_SOURCE -Isrc/include -I/home/XXX/git/numactl-2.0.16/build/include
然后使用编译命令
make CROSS_COMPILE=arm-linux-gnueabihf- LDFLAGS=-static
即可在目录中看到 cyclictest