Skip to content

Commit

Permalink
openblas: Address PR suggestions
Browse files Browse the repository at this point in the history
    - Disable AVX512 by default: builld servers usually have this, but most consumer PCs do not
    - Set build_lapack=True when it can be built without Fortran
  • Loading branch information
joakimono committed May 3, 2023
1 parent 5a75133 commit 3daa05b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions recipes/openblas/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ def _fortran_runtime(self, fortran_id):
if self.settings.os in ["Linux", "FreeBSD"]:
if fortran_id == "GNU":
if self.settings.compiler == "gcc":
if Version(self.settings.compiler.version).major in ["5", "6"]:
return "gfortran" # Runtime version gfortran3
if Version(self.settings.compiler.version).major == "7":
return "gfortran" # Runtime version gfortran4
if Version(self.settings.compiler.version).major > "7":
return "gfortran" # Runtime version gfortran5
# Compiler vs. gfortran runtime ver.: 5,6: 3, 7: 4, >=8: 5
if Version(self.settings.compiler.version).major > "5":
return "gfortran"
if self.settings.compiler == "clang":
if Version(self.settings.compiler.version).major > "8":
return "gfortran" # Runtime version gfortran5
Expand Down Expand Up @@ -81,6 +78,10 @@ def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

# Build LAPACK by default if possible w/o Fortran compiler
if Version(self.version) >= "0.3.21":
self.options.build_lapack = True

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
Expand Down Expand Up @@ -153,10 +154,10 @@ def generate(self):
# don't, may lie to consumer, /MD or /MT is managed by conan
tc.variables["MSVC_STATIC_CRT"] = False

# Env variable escape hatch for disabling AVX512
# Env variable escape hatch for enabling AVX512
no_avx512 = environ.get("NO_AVX512")
if no_avx512 is None:
no_avx512 = False
no_avx512 = True
tc.variables["NO_AVX512"] = no_avx512

tc.generate()
Expand Down

0 comments on commit 3daa05b

Please sign in to comment.