PerlAlien / Alien-Build

Build external dependencies for use in CPAN
16 stars 25 forks source link

Add CPU properties for count and architecture name #371

Closed zmughal closed 1 year ago

zmughal commented 1 year ago

CPU count

Adds a pure Perl implementation for checking the number of available CPUs.

I have not yet added support for this to ::Build::Make, but I can see adding the appropriate flag (e.g., -j) being enabled automatically (which will sometimes show upstream bugs if the upstream that is being built does not specify dependencies properly)

CPU arch name

Detects the most common architectures and maps them to common names (roughly the names of Debian ports). I'm leaving room for possible future extensions such as adding ARM versions as another property if needed.

Leaving out mips, mipsel, mips64el, ppc64el, s390x for now as I rarely see pre-compiled binaries for those distributed now.

I decided against adding GPU/integrated graphics hardware vendor/capabilities detection (e.g., Nvidia CUDA) as that is more involved and not every package needs that. I'll create a separate distribution for that.

plicease commented 1 year ago

(aside) I am 100% sure that the CI fail in 5.37 has nothing to do with this PR (and probably new ALIEN_DOWNLOAD_RULE setting that is in use in CI), and I will follow up on that.

plicease commented 1 year ago

Maybe also useful:

  1. word size, which I think we will know since the archnames chosen are for specific word sizes
  2. wordless arch name x86 for x86 and x86_64; arm for arm* and aarch64
  3. which endian the CPU is. Although in practice everything is little endian. I will at some point add support for my old PowerMac G5 which is big endian.

I'm happy for these to be a later PR.