Build error: `cpu_khz` undeclared
HarshKapadia2 opened this issue · comments
I am trying to build the Homa module on an Ubuntu machine on CloudLab, but am facing an error ('cpu_khz
undeclared') as shown in the image below. Does anyone know how I can resolve this? Thank you!
Machine specs:
- OS: Ubuntu 22.04.1 LTS
- Codename: jammy
- Kernel:
Linux 5.15.0-69-generic aarch64
- This is the output of the command
uname -srm
- This is the output of the command
Cc: @KartikSoneji
The symbol cpu_khz is defined in some Linux header file (I haven't had time to figure out which one). Apparently, in the version of Linux you're using, the chain of header files #included by homa_incoming.o doesn't include the one containing that declaration. A quick and dirty fix would be to add an "unsigned int cpu_khz" declaration to homa_incoming.c. A better approach, if you have time, would be to figure (a) what header file cpu_khz is declared in and (b) add an #include to homa_incoming.c that will incorporate it (the right header file to #include isn't necessarily the one containing the declaration, e.g., if the declaration is in an arch-specific file). If you do this, let me know and I'll fix the code to include it.
I found that cpu_khz
is defined in tsc.h
.
I tried using Ubuntu 22.04.2 LTS (jammy) with Linux 5.15.0-69-generic x86_64
and Linux 5.15.0-70-generic x86_64
and this issue disappeared. (Essentially, I switched to CloudLab's xl170
machines from the m400
machines.)
I found that
cpu_khz
is defined intsc.h
.I tried using Ubuntu 22.04.2 LTS (jammy) with
Linux 5.15.0-69-generic x86_64
andLinux 5.15.0-70-generic x86_64
and this issue disappeared. (Essentially, I switched to CloudLab'sxl170
machines from them400
machines.)
Hi, I think 5.15 kernel is not been officially tested after all. Maybe it is better to use 5.17 or 5.18 for now.
From Readme:
The head is known to work under Linux 5.17.5 and 5.18. In the past it has run under 5.4.3 and 4.15.18; you can access these versions with branches named linux_5.4.3 and linux_4.15.18. These older branches are out of date feature-wise: recent commits have not been back-ported to them. Other versions of Linux have not been tested and may require code changes (the upgrade from 4.15.18 to 5.4.3 took only about a day). If you get Homa working on some other version, please submit a pull request for the required code changes.
I saw that note in the README file, but I am using CloudLab and I don't know how to specify a Linux kernel version there. All I could do was to specify a Linux distro.
Do you have any idea how I can upgrade to newer Kernel versions? I ran sudo apt-get dist-upgrade
, but that just took me from Linux 5.15.0-69-generic x86_64
to Linux 5.15.0-70-generic x86_64
.
I was able to resolve this on CloudLab's xl170 machines (Ubuntu 22.04.2 LTS) by updating my Kernel version to 5.18.0.
Steps I followed to upgrade the Kernel:
-
Follow this: How To Install a Mainline Linux Kernel in Ubuntu
-
Update all the package lists
sudo apt-get update