Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PowerPC support #26

Open
barracuda156 opened this issue Feb 17, 2023 · 10 comments
Open

Add PowerPC support #26

barracuda156 opened this issue Feb 17, 2023 · 10 comments

Comments

@barracuda156
Copy link

Apparently the code currently covers only Intel platforms. Possible to add support for POWER (for *BSD and AIX) and PowerPC (for Apple)?

@lfreist
Copy link
Owner

lfreist commented Feb 17, 2023

Hi,
hwinfo should work architecture independent on Linux, Windows and Mac (development for MacOS is not very far...).

The supported (and yet unsupported) features for each platform stated here should work on any architecture.

Have you already tried building and running hwinfo on a PowerPC?

If so, it would be nice, if you can provide further information on whats unexpected/not working.

@barracuda156
Copy link
Author

@lfreist I will try and update you.

@lfreist
Copy link
Owner

lfreist commented Apr 14, 2023

Closed due to inactivity

@lfreist lfreist closed this as completed Apr 14, 2023
@barracuda156
Copy link
Author

Closed due to inactivity

I apologize, this went forgotten. I will do this today.

@lfreist lfreist reopened this Apr 14, 2023
@barracuda156
Copy link
Author

@lfreist Build fails here for me:

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_hwinfo/hwinfo/work/hwinfo-ce1d868a7c451c27e98614dce74540aea914afd5/src/apple/cpu.cpp: In static member function 'static std::string hwinfo::CPU::getModelName()':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_hwinfo/hwinfo/work/hwinfo-ce1d868a7c451c27e98614dce74540aea914afd5/src/apple/cpu.cpp:81:22: error: 'model' was not declared in this scope; did you mean 'modfl'?
   81 |   return std::string(model);
      |                      ^~~~~
      |                      modfl

@barracuda156
Copy link
Author

Types of PPC cpus can be found in /usr/include/mach/machine.h.
This is how it can be determined: https://www.eidos.ic.i.u-tokyo.ac.jp/~tau/lecture/parallel_distributed/2016/examples/09mm/OpenBLAS/cpuid_power.c

@lfreist
Copy link
Owner

lfreist commented Apr 14, 2023

Thank you! It's a pure failure from my side. Didn't have a non x86 Mac for testing thins peace of code... However, I found the bug and will fix it later.

@barracuda156
Copy link
Author

@lfreist Great, thank you!

@lfreist
Copy link
Owner

lfreist commented Apr 14, 2023

commit ba3ba8b should fix the stated issue. Since I cannot test for non x86 MacOS, I cannot assure that there are no other issues... Would be grateful, if you can provide further information after testing the new commit!

@barracuda156
Copy link
Author

@lfreist Thank you. There is this error then:

/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_hwinfo/hwinfo/work/hwinfo-ba3ba8b165502f1ab979204c4adcf93bb339c5b1/src/apple/cpu.cpp: In static member function 'static std::string hwinfo::CPU::getModelName()':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_hwinfo/hwinfo/work/hwinfo-ba3ba8b165502f1ab979204c4adcf93bb339c5b1/src/apple/cpu.cpp:79:58: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
   79 |   if (sysctlbyname("machdep.cpu.brand_string", model.data(), &size, NULL, 0) < 0) {
      |                                                ~~~~~~~~~~^~
      |                                                          |
      |                                                          const void*
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_hwinfo/hwinfo/work/hwinfo-ba3ba8b165502f1ab979204c4adcf93bb339c5b1/src/apple/cpu.cpp:12:
/usr/include/sys/sysctl.h:752:36: note:   initializing argument 2 of 'int sysctlbyname(const char*, void*, size_t*, void*, size_t)'
  752 | int     sysctlbyname(const char *, void *, size_t *, void *, size_t);
      |                                    ^~~~~~

When passing -fpermissive, it builds through completion. Many objects have no symbols though:

/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(filesystem.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(battery.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(cpu.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(gpu.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(ram.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(os.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(mainboard.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(disk.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(filesystem.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(cpu.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(gpu.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(ram.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(os.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(mainboard.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(disk.cpp.o) has no symbols
/opt/local/bin/ranlib ../lib/libHWinfo.a
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(filesystem.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(battery.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(cpu.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(gpu.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(ram.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(os.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(mainboard.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(disk.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(filesystem.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(cpu.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(gpu.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(ram.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(os.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(mainboard.cpp.o) has no symbols
/opt/local/bin/ranlib: file: ../lib/libHWinfo.a(disk.cpp.o) has no symbols

Destroot does not work too, but that is trivial to fix on our end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants