I need to include <asm/barrier.h>
and <asm/msr.h>
. I see them (in /usr/src/linux-headers-6.5.0-27/arch/x86/include/asm
but cmake
doesn’t. I tried:
find_path(KERNELHEADERS_DIR
include/asm/barrier.h
)
…and:
execute_process(
COMMAND uname -r
OUTPUT_VARIABLE KERNEL_RELEASE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "-generic" "" KERNEL_RELEASE "${KERNEL_RELEASE}")
# Find the headers
find_path(KERNELHEADERS_DIR
include/asm/barrier.h
PATHS /usr/src/linux-headers-${KERNEL_RELEASE}
)
…and variations thereof, but it stubbornly returns /usr/src/linux-headers-6.5.0-28-generic
.
I don’t need a super complete solution, I just need it to work on Ubuntu (it’s for YOMM2’s benchmarks, not a public, documented thing).
Help?