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

[openblas] Make build_lapack=True default for >= 0.3.21 #20894

13 changes: 11 additions & 2 deletions recipes/openblas/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,21 @@ def _fortran_compiler(self):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
if Version(self.version) >= "0.3.21":
samuel-emrys marked this conversation as resolved.
Show resolved Hide resolved
# INFO: When no Fortran compiler is available, OpenBLAS builds LAPACK from an f2c-converted copy of LAPACK unless the NO_LAPACK option is specified
self.options.build_lapack = True

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def validate(self):
if Version(self.version) < "0.3.24" and self.settings.arch == "armv8":
# OpenBLAS fails to detect the appropriate target architecture for armv8 for versions < 0.3.24, as it matches the 32 bit variant instead of 64.
# This was fixed in https://github.com/OpenMathLib/OpenBLAS/pull/4142, which was introduced in 0.3.24.
# This would be a reasonably trivial hotfix to backport.
raise ConanInvalidConfiguration("armv8 builds are not currently supported for versions lower than 0.3.24. Contributions to support this are welcome.")

if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True):
raise ConanInvalidConfiguration("Cross-building not implemented")

Expand Down Expand Up @@ -87,7 +96,7 @@ def generate(self):
# This checks explicit user-specified fortran compiler
if self.options.build_lapack:
if not self._fortran_compiler:
if Version(self.version) < "0.3.24":
if Version(self.version) < "0.3.21":
self.output.warning(
"Building with LAPACK support requires a Fortran compiler.")
else:
Expand Down Expand Up @@ -169,7 +178,7 @@ def package_info(self):
self.cpp_info.components["openblas_component"].system_libs.append("m")
if self.options.use_thread:
self.cpp_info.components["openblas_component"].system_libs.append("pthread")
if self.options.build_lapack:
if self.options.build_lapack and self._fortran_compiler:
self.cpp_info.components["openblas_component"].system_libs.append("gfortran")

self.output.info(
Expand Down