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: add v0.3.28, fix a GCC 14 error #25658

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions recipes/openblas/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.3.28":
url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.28.tar.gz"
sha256: "f1003466ad074e9b0c8d421a204121100b0751c96fc6fcf3d1456bd12f8a00a1"
"0.3.27":
url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.27.tar.gz"
sha256: "aa2d68b1564fe2b13bc292672608e9cdeeeb6dc34995512e65c3b10f4599e897"
Expand All @@ -14,18 +17,3 @@ sources:
"0.3.20":
url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.20.tar.gz"
sha256: "8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c"
"0.3.17":
url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.17.tar.gz"
sha256: "df2934fa33d04fd84d839ca698280df55c690c86a5a1133b3f7266fce1de279f"
"0.3.15":
url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.15.tar.gz"
sha256: "30a99dec977594b387a17f49904523e6bc8dd88bd247266e83485803759e4bbe"
"0.3.13":
url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.13.tar.gz"
sha256: "79197543b17cc314b7e43f7a33148c308b0807cd6381ee77f77e15acf3e6459e"
"0.3.12":
url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.12.tar.gz"
sha256: "65a7d3a4010a4e3bd5c0baa41a234797cd3a1735449a4a5902129152601dc57b"
"0.3.10":
url: "https://github.com/xianyi/OpenBLAS/archive/v0.3.10.tar.gz"
sha256: "0484d275f87e9b8641ff2eecaa9df2830cbe276ac79ad80494822721de6e1693"
58 changes: 8 additions & 50 deletions recipes/openblas/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
from conan.tools.apple import fix_apple_shared_install_name
from conan.tools.build import cross_building
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import copy, get, replace_in_file, rmdir
from conan.tools.files import copy, get, rmdir
from conan.tools.microsoft import is_msvc_static_runtime, is_msvc
from conan.tools.scm import Version
import os
import textwrap

required_conan_version = ">=1.53.0"

Expand Down Expand Up @@ -108,11 +107,6 @@ def _fortran_compiler(self):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
# When no Fortran compiler is available, OpenBLAS builds LAPACK from an f2c-converted copy of LAPACK unless the NO_LAPACK option is specified.
# This is not available before v0.3.21.
if Version(self.version) < "0.3.21":
self.options.build_lapack = False
self.options.build_relapack = False

def configure(self):
if self.options.shared:
Expand Down Expand Up @@ -164,14 +158,10 @@ def generate(self):
tc.variables["BUILD_TESTING"] = False

tc.variables["NOFORTRAN"] = not self.options.build_lapack
# This checks explicit user-specified fortran compiler
if self.options.build_lapack and not self._fortran_compiler:
if Version(self.version) < "0.3.21":
self.output.warning("Building with LAPACK support requires a Fortran compiler.")
else:
tc.variables["C_LAPACK"] = True
tc.variables["NOFORTRAN"] = True
self.output.info("Building LAPACK without a Fortran compiler")
tc.variables["C_LAPACK"] = True
tc.variables["NOFORTRAN"] = True
self.output.info("Building LAPACK without a Fortran compiler")

tc.variables["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack
tc.variables["BUILD_RELAPACK"] = self.options.build_relapack
Expand All @@ -190,46 +180,14 @@ def generate(self):
tc.cache_variables["TARGET"] = self.options.target

tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
tc.generate()

def _patch_sources(self):
if Version(self.version) <= "0.3.15":
replace_in_file(self, os.path.join(self.source_folder, "cmake", "utils.cmake"),
"set(obj_defines ${defines_in})", textwrap.dedent("""\
set(obj_defines ${defines_in})
# Fix a fatal compiler warning on GCC 14
# https://github.com/OpenMathLib/OpenBLAS/pull/4894
tc.extra_cflags.append("-Wno-error=incompatible-pointer-types")

list(FIND obj_defines "RC" def_idx)
if (${def_idx} GREATER -1)
list(REMOVE_ITEM obj_defines "RC")
list(APPEND obj_defines "RC=RC")
endif ()
list(FIND obj_defines "CR" def_idx)
if (${def_idx} GREATER -1)
list(REMOVE_ITEM obj_defines "CR")
list(APPEND obj_defines "CR=CR")
endif ()"""))
if Version(self.version) < "0.3.21":
f_check_cmake = os.path.join(self.source_folder, "cmake", "f_check.cmake")
if Version(self.version) >= "0.3.12":
replace_in_file(self, f_check_cmake,
'message(STATUS "No Fortran compiler found, can build only BLAS but not LAPACK")',
'message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.")')
else:
replace_in_file(self, f_check_cmake,
"enable_language(Fortran)",
textwrap.dedent("""\
include(CheckLanguage)
check_language(Fortran)
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
else()
message(FATAL_ERROR "No Fortran compiler found. Cannot build with LAPACK.")
set (NOFORTRAN 1)
set (NO_LAPACK 1)
endif()"""))
tc.generate()

def build(self):
self._patch_sources()
cmake = CMake(self)
cmake.configure()
cmake.build()
Expand Down
12 changes: 2 additions & 10 deletions recipes/openblas/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.3.28":
folder: all
"0.3.27":
folder: all
"0.3.26":
Expand All @@ -9,13 +11,3 @@ versions:
folder: all
"0.3.20":
folder: all
"0.3.17":
folder: all
"0.3.15":
folder: all
"0.3.13":
folder: all
"0.3.12":
folder: all
"0.3.10":
folder: all