我正在尝试DPDK在Alpine Linux 上安装。我在Docker中运行Alpine Linux。这是我正在使用的步骤:
docker pull alpine docker run -it alpine /bin/sh wget https://git.dpdk.org/dpdk-stable/snapshot/dpdk-stable-16.11.8.tar.gz tar -xzf dpdk-stable-16.11.8.tar.gz cd dpdk-stable-16.11.8 apk add --no-cache make gcc libc-dev bsd-compat-headers linux-headers musl-dev apk add numactl-dev --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted make install T=x86_64-native-linuxapp-gcc
安装失败,并显示以下错误和警告:
make [5]:对于’depdirs’不做任何事情。
配置完成
==建立lib
==建立lib / librte_compat
==建立lib / librte_eal
==构建lib / librte_eal / common
==构建lib / librte_eal / linuxapp
==构建lib / librte_eal / linuxapp / eal
CC eal_hugepage_info.o /dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:在“ clear_hugedir”函数中: /dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:229:8:警告:函数'openat'的隐式声明;你是说'popen'吗?[-Wimplicit函数声明] fd = openat(dir_fd,dirent-> d_name,O_RDONLY); ^ ~~~~~ popen /dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:229:8:警告:“ openat”的嵌套外部声明[-Wnested-externs] /dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:229:39:错误:未声明'O_RDONLY'(在此功能中首次使用)fd = openat(dir_fd,dirent-> d_name ,O_RDONLY); ^ ~~~~~~~ /dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:229:39:注意:对于每个未声明的标识符,每个出现在其上的功能都只报告一次 /dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:在函数“ eal_hugepage_info_init”中: /dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:320:26:警告:函数'open'的隐式声明;你是说'popen'吗?[-Wimplicit函数声明] hpi-> lock_descriptor = open(hpi-> hugedir,O_RDONLY); ^ ~~~ popen /dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:320:26:警告:“ open”的嵌套外部声明[-Wnested-externs] /dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:320:45:错误:未声明“ O_RDONLY”(此功能首次使用)hpi-> lock_descriptor = open(hpi-> hugedir,O_RDONLY); ^ ~~~~~~~~ make [7]:*** [/dpdk/dpdk-stable-16.11.8/mk/internal/rte.compile-pre.mk:140:eal_hugepage_info.o]错误1 make [6]:*** [/dpdk/dpdk-stable-16.11.8/mk/rte.subdir.mk:63:eal]错误2 make [5]:*** [/dpdk/dpdk-stable-16.11.8/mk/rte.subdir.mk:63:linuxapp]错误2 make [4]:*** [/dpdk/dpdk-stable-16.11.8/mk/rte.subdir.mk:63:librte_eal]错误2 make [3]:*** [/dpdk/dpdk-stable-16.11.8/mk/rte.sdkbuild.mk:80:lib]错误2 make [2]:*** [/dpdk/dpdk-stable-16.11.8/mk/rte.sdkroot.mk:127:全部]错误2 make [1]:*** [/dpdk/dpdk-stable-16.11.8/mk/rte.sdkinstall.mk:86:pre_install]错误2
制作:*** [/dpdk/dpdk-stable-16.11.8/mk/rte.sdkroot.mk:101:安装]错误2
更新1
我修复了一些错误,但是现在出现了新的错误。以下是更新的步骤:
docker pull alpine docker run -it alpine /bin/sh wget https://git.dpdk.org/dpdk-stable/snapshot/dpdk-stable-16.11.8.tar.gz tar -xzf dpdk-stable-16.11.8.tar.gz cd dpdk-stable-16.11.8 apk add --no-cache make gcc libc-dev bsd-compat-headers linux-headers musl-dev apk add numactl-dev --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted 添加#include <fcntl.h>到lib/librte_eal/common/include/rte_common.h 添加CFLAGS += -D_GNU_SOURCE到lib/librte_eal/linuxapp/eal/Makefile make install T=x86_64-native-linuxapp-gcc
现在安装失败,并出现以下错误:
make [5]:对于’depdirs’不做任何事情。配置完成
CC eal_vfio_mp_sync.o /dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c:在函数'vfio_mp_sync_send_fd'中: /dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c:75:17:错误:'struct cmsghdr'没有名为'__cmsg_data'的成员memcpy((chdr).__ cmsg_data,&(fd) ,sizeof(fd)); \ ^ /dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c:187:2:注意:在宏“ FD_TO_CMSGHDR”的扩展中FD_TO_CMSGHDR(fd,* chdr); ^ ~~~~~~~~~~~~~ /dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c:在函数'vfio_mp_sync_receive_fd'中: /dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c:78:24:错误:'struct cmsghdr'没有名为'__cmsg_data'的成员memcpy(&(fd),(chdr).__ cmsg_data ,sizeof(fd))^ /dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c:228:2:注意:在宏'CMSGHDR_TO_FD'的扩展中CMSGHDR_TO_FD(* chdr,fd); ^ ~~~~~~~~~~~~~ make [7]:*** [/dpdk-stable-16.11.8/mk/internal/rte.compile-pre.mk:140:eal_vfio_mp_sync.o]错误1 make [6]:*** [/dpdk-stable-16.11.8/mk/rte.subdir.mk:63:eal]错误2 make [5]:*** [/dpdk-stable-16.11.8/mk/rte.subdir.mk:63:linuxapp]错误2 make [4]:*** [/dpdk-stable-16.11.8/mk/rte.subdir.mk:63:librte_eal]错误2 make [3]:*** [/dpdk-stable-16.11.8/mk/rte.sdkbuild.mk:80:lib]错误2 make [2]:*** [/dpdk-stable-16.11.8/mk/rte.sdkroot.mk:127:全部]错误2 make [1]:*** [/dpdk-stable-16.11.8/mk/rte.sdkinstall.mk:86:pre_install]错误2 制作:*** [/dpdk-stable-16.11.8/mk/rte.sdkroot.mk:101:安装]错误2 如果你在看看/usr/include/x86_64-linux-gnu/bits/socket.h,struct cmsghdr定义如下: /* Structure used for storage of ancillary data object information. */ struct cmsghdr { size_t cmsg_len; /* Length of data in cmsg_data plus length of cmsghdr structure. !! The type should be socklen_t but the definition of the kernel is incompatible with this. */ int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ #if __glibc_c99_flexarr_available __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ #endif };
什么__glibc_c99_flexarr_available啊 我可以以某种方式使它可用吗?
更新2
我尝试使用它代替,musl-dev但是错误仍然相同。
然后按照建议,我glibc在Alpine Linux上安装了它,而不是使用它musl。请按照此处的步骤操作。现在我得到这样的错误:
在/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal.c:48:0中包含的文件中:
/usr/include/limits.h:124:26:致命错误:limits.h:没有此类文件或目录
#include_next