intel / DTO

A user level library for applications to transparently use Intel DSA.
MIT License
22 stars 9 forks source link

Build failure with not finding linux/idxd.h in container #2

Closed pingzhaozz closed 1 year ago

pingzhaozz commented 1 year ago

When I tried to use DTO in container(Ubuntu 20.04) and it will build failure with:

gcc -shared -fPIC -Wl,-soname,libdto.so dto.c -D_GNU_SOURCE -DDTO_STATS_SUPPORT -o libdto.so.1.0 -laccel-config -ldl
dto.c:15:10: fatal error: linux/idxd.h: No such file or directory
   15 | #include <linux/idxd.h>
      |          ^~~~~~~~~~~~~~

Dockerfile such as:

# base-OS-image for build
ARG OS_VER=20.04
ARG OS_IMAGE=ubuntu
FROM ${OS_IMAGE}:${OS_VER} AS baseimage
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles" apt-get install -y build-essential git cmake autoconf libtool pkg-config uuid-dev numactl libevent-dev asciidoc libjson-c-dev gdb

ARG DTO_VERSION="1.0"
ARG DTO_URL="https://github.com/intel/DTO/archive/refs/tags/v$DTO_VERSION.tar.gz"

RUN curl -fsSL "$DTO_URL" -o dto.tar.gz && tar -xzf dto.tar.gz
RUN cd DTO-$DTO_VERSION && \
    make libdto && make install
pingzhaozz commented 1 year ago

A workaround is copy the idxd.h from accel to /usr/local/include. But not a proper way.

skuma24 commented 1 year ago

I think the proper way is to install kernel-headers package. Have you tried that?

pingzhaozz commented 1 year ago

Which kernel header for Ubuntu 20.04? I don't find it in Ubuntu web.

skuma24 commented 1 year ago

It seems on Ubuntu kernel-headers package is called linux-libc-dev.

pingzhaozz commented 1 year ago

Ubuntu 20.04 install linux-libc-dev_5.4.0-159.176_amd64.deb by default which doesn't work. which version should I use?

skuma24 commented 1 year ago

Ubuntu 20.04 doesn't have idxd.h in the linux-libc-dev package. I installed linux-libc-dev on Ubuntu 23.04 and I got the /usr/include/linux/idxd.h file.