lfreist / hwinfo

cross platform C++ library for hardware information (CPU, RAM, GPU, ...)
MIT License
438 stars 76 forks source link

arm linux __get_cpuid_count function undefine #19

Closed xinsuinizhuan closed 1 year ago

xinsuinizhuan commented 1 year ago

__get_cpuid_count(func_id, sub_func_id, &regs[0], &regs[1], &regs[2], &regs[3]); __get_cpuid_count function undefine

jetson arm unbuntu linux

lfreist commented 1 year ago

ARM does not support the cpuid instructions (x86 specific).

However, I have just looked into the code and fixed an import. Can you try if it is working now? Thank you!

xinsuinizhuan commented 1 year ago

it do not work

lfreist commented 1 year ago

I assume the error occurs in cpuid.h. This file is only used if the compiler recognizes your machine as x86. In your case, the file should not be included.

Could you please check what macro makes HWINFO_X86 defined in the following file/line: https://github.com/lfreist/hwinfo/blob/main/include/hwinfo/platform.h#L19

Sadly, I do not have an ARM machine to check it out myself...

xinsuinizhuan commented 1 year ago

how about arm linux,now?

lfreist commented 1 year ago

Hi, Could you please provide more information about the issue? Hardware, Compiler, ...

facug91 commented 1 year ago

With this recently accepted PR #28, and this new PR #29 I just did, I've been able to compile and run Example in a Jetson Xavier.

facug91 commented 1 year ago

The problem was that Jetsons have Ubuntu 18.04, which has GCC 8.4 by default, which doesn't support C++20, and even with C++17, you need to link to "stdc++fs" to use std::filesystem.

lfreist commented 1 year ago

Thank you Facundo!

PR #29 is merged!

facug91 commented 1 year ago

Just to fix the wrong comment I made, Ubuntu 18.04 comes with gcc 7 installed by default, which doesn't even have C++17 support. In Jetsons you can install gcc 8, which allows you to use CUDA 10.2, and compile with C++17.