utsaslab / crashmonkey

CrashMonkey: tools for testing file-system reliability (OSDI 18)
Apache License 2.0
193 stars 31 forks source link

Build error "No such file or directory" on CentOS7 #140

Closed samuelsh closed 4 years ago

samuelsh commented 4 years ago

System:

$ uname -a
Linux v23lg1 3.10.0-1062.9.1.el7.x86_64 #1 SMP Fri Dec 6 15:49:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)
$ pwd
/qa/crashmonkey

]$ make -j4
make -C code all
make[1]: Entering directory `/qa/crashmonkey/code'
make -C /lib/modules/3.10.0-1062.9.1.el7.x86_64/build M=/qa/crashmonkey/code/../build src=/qa/crashmonkey/code modules
make: Entering an unknown directory
make: *** /lib/modules/3.10.0-1062.9.1.el7.x86_64/build: No such file or directory.  Stop.
make: Leaving an unknown directory
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/qa/crashmonkey/code'
make: *** [code] Error 2
ashmrtn commented 4 years ago

Short Answer Changing this line defining the kernel header path in code/Makefile to point to the kernel headers for the running kernel should solve the issue.

Long Answer Make is unable to locate the header files for the current kernel. CrashMonkey compiles a kernel module using an out of tree build strategy so that developers don't have to clone the entire Linux kernel source. However, header files for the current kernel are still required for compilations.

For Ubuntu systems, one of the places these header files can be found is at /lib/modules/<kernel version>/build. I am not familiar with where CentOS keeps these header files, so I can't tell you the exact path that is required in your case.