openblas: New version 0.3.23 (#36986)

Silence make

Set a fixed and large NUM_THREADS by default, to avoid that it gets initialized with the host # CPUs.

Set OMP_NUM_THREADS/OPENBLAS_NUM_THREADS in terms of make_jobs so that tests don't need excessive CPU.

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
This commit is contained in:
Erik Schnetter 2023-04-22 03:02:28 -04:00 committed by GitHub
parent 6808df5729
commit d443a44854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,8 @@ class Openblas(MakefilePackage):
libraries = ["libopenblas"] libraries = ["libopenblas"]
version("develop", branch="develop") version("develop", branch="develop")
version("0.3.23", sha256="5d9491d07168a5d00116cdc068a40022c3455bf9293c7cb86a65b1054d7e5114")
version("0.3.22", sha256="7fa9685926ba4f27cfe513adbf9af64d6b6b63f9dcabb37baefad6a65ff347a7")
version("0.3.21", sha256="f36ba3d7a60e7c8bcc54cd9aaa9b1223dd42eaf02c811791c37e8ca707c241ca") version("0.3.21", sha256="f36ba3d7a60e7c8bcc54cd9aaa9b1223dd42eaf02c811791c37e8ca707c241ca")
version("0.3.20", sha256="8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c") version("0.3.20", sha256="8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c")
version("0.3.19", sha256="947f51bfe50c2a0749304fbe373e00e7637600b0a47b78a51382aeb30ca08562") version("0.3.19", sha256="947f51bfe50c2a0749304fbe373e00e7637600b0a47b78a51382aeb30ca08562")
@ -339,6 +341,15 @@ def _microarch_target_args(self):
return args return args
def setup_build_environment(self, env):
# When building OpenBLAS with threads=openmp, `make all`
# runs tests, so we set the max number of threads at runtime
# accordingly
if self.spec.satisfies("threads=openmp"):
env.set("OMP_NUM_THREADS", str(make_jobs))
elif self.spec.satisfies("threads=pthreads"):
env.set("OPENBLAS_NUM_THREADS", str(make_jobs))
@property @property
def make_defs(self): def make_defs(self):
# Configure fails to pick up fortran from FC=/abs/path/to/fc, but # Configure fails to pick up fortran from FC=/abs/path/to/fc, but
@ -422,6 +433,10 @@ def make_defs(self):
if self.spec.satisfies("+bignuma"): if self.spec.satisfies("+bignuma"):
make_defs.append("BIGNUMA=1") make_defs.append("BIGNUMA=1")
# Avoid that NUM_THREADS gets initialized with the host's number of CPUs.
if self.spec.satisfies("threads=openmp") or self.spec.satisfies("threads=pthreads"):
make_defs.append("NUM_THREADS=512")
return make_defs return make_defs
@property @property
@ -448,7 +463,7 @@ def libs(self):
@property @property
def build_targets(self): def build_targets(self):
return self.make_defs + ["all"] return ["-s"] + self.make_defs + ["all"]
@run_after("build") @run_after("build")
@on_package_attributes(run_tests=True) @on_package_attributes(run_tests=True)