【发布时间】:2018-10-10 20:22:14
【问题描述】:
我正在尝试在 Alpine Linux 上安装 DPDK。我在 Docker 中运行 Alpine Linux。以下是我正在使用的步骤:
docker pull alpinedocker run -it alpine /bin/shwget https://git.dpdk.org/dpdk-stable/snapshot/dpdk-stable-16.11.8.tar.gztar -xzf dpdk-stable-16.11.8.tar.gzcd dpdk-stable-16.11.8apk add --no-cache make gcc libc-dev bsd-compat-headers linux-headers musl-devapk add numactl-dev --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrustedmake install T=x86_64-native-linuxapp-gcc
安装失败并出现以下错误和警告:
make[5]: 'depdirs' 无事可做。
配置完成
== 构建库
== 构建 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-function-declaration] 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:8:警告:“openat”的嵌套外部声明 [-Wnested-externs]
/dpdk/dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:229:39: error: 'O_RDONLY' undeclared (第一次在这个函数中使用) 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-function-declaration] hpi->lock_descriptor = open(hpi->hugedir, O_RDONLY); ^~~~ 打开
/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: error: 'O_RDONLY' undeclared (第一次在这个函数中使用) 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: all] 错误2
make[1]: *** [/dpdk/dpdk-stable-16.11.8/mk/rte.sdkinstall.mk:86: pre_install] 错误2
make: *** [/dpdk/dpdk-stable-16.11.8/mk/rte.sdkroot.mk:101: install] 错误2
更新 1
我修复了一些错误,但现在出现了新错误。 以下是更新的步骤:
docker pull alpinedocker run -it alpine /bin/shwget https://git.dpdk.org/dpdk-stable/snapshot/dpdk-stable-16.11.8.tar.gztar -xzf dpdk-stable-16.11.8.tar.gzcd dpdk-stable-16.11.8apk add --no-cache make gcc libc-dev bsd-compat-headers linux-headers musl-devapk 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' 无事可做。 配置完成
== 构建库
== 构建 lib/librte_compat
== 构建 lib/librte_eal
== 构建 lib/librte_eal/common
== 构建 lib/librte_eal/linuxapp
== 构建 lib/librte_eal/linuxapp/eal
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: all] 错误2
make[1]: *** [/dpdk-stable-16.11.8/mk/rte.sdkinstall.mk:86: pre_install] 错误2
make: *** [/dpdk-stable-16.11.8/mk/rte.sdkroot.mk:101: install] 错误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
我尝试使用this 而不是musl-dev,但错误仍然相同。
然后按照建议,我在我的 Alpine Linux 上安装了 glibc 来使用它而不是 musl。按照步骤here。现在我收到这样的错误:
在 /dpdk-stable-16.11.8/lib/librte_eal/linuxapp/eal/eal.c:48:0: 中包含的文件中:
/usr/include/limits.h:124:26: 致命错误:limits.h: 没有这样的文件或目录
#include_next
【问题讨论】: