2 # Copyright (C) 2021 Alexandru Ardelean <ardeleanalex@gmail.com>
5 include $(TOPDIR
)/rules.mk
11 PKG_SOURCE
:=OpenBLAS-
$(PKG_VERSION
).
tar.gz
12 PKG_SOURCE_URL
:=https
://github.com
/xianyi
/OpenBLAS
/releases
/download
/v
$(PKG_VERSION
)/
13 PKG_HASH
:=4e6e4f5cb14c209262e33e6816d70221a2fe49eb69eaf0a06f065598ac602c68
14 PKG_LICENSE
:=BSD-3-Clause
15 PKG_CPE_ID
:=cpe
:/a
:openblas_project
:openblas
16 PKG_MAINTAINER
:=Alexandru Ardelean
<ardeleanalex@gmail.com
>
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/openblas
26 TITLE
:=An optimized library for BLAS
(Basic Linear Algebra Subprograms
)
27 URL
:=https
://www.openblas.net
/
32 +INSTALL_GFORTRAN
:libgfortran
35 define Package
/openblas
/description
36 OpenBLAS is an optimized BLAS
(Basic Linear Algebra Subprograms
) library
37 based on GotoBLAS2
1.13 BSD version.
40 define Package
/openblas
/config
42 depends on PACKAGE_openblas
44 config OPENBLAS_TARGET_OVERRIDE
46 prompt
"Manual CPU target override (from the OpenBLAS TargetList.txt file)"
51 OPENBLAS_TARGET
=$(call qstrip
,$(CONFIG_OPENBLAS_TARGET_OVERRIDE
))
53 ifeq ($(OPENBLAS_TARGET
),)
54 # initialize to GENERIC as default
55 OPENBLAS_TARGET
:=GENERIC
57 ifneq ($(findstring cortex-a9
,$(CONFIG_CPU_TYPE
)),)
58 ifneq ($(findstring neon
,$(CONFIG_CPU_TYPE
)),)
59 # CORTEXA9 relies on NEON
60 OPENBLAS_TARGET
:=CORTEXA9
62 # Fallback for CPUs without NEON
63 OPENBLAS_TARGET
:=ARMV7
65 else ifneq ($(findstring cortex-a15
,$(CONFIG_CPU_TYPE
)),)
66 OPENBLAS_TARGET
:=CORTEXA15
67 else ifneq ($(findstring cortex-a53
,$(CONFIG_CPU_TYPE
)),)
68 OPENBLAS_TARGET
:=CORTEXA53
69 else ifneq ($(findstring cortex-a72
,$(CONFIG_CPU_TYPE
)),)
70 OPENBLAS_TARGET
:=CORTEXA72
71 else ifeq ($(ARCH
),aarch64
)
72 OPENBLAS_TARGET
:=ARMV8
73 else ifeq ($(ARCH
),arm
)
74 OPENBLAS_TARGET
:=ARMV5
75 else ifeq ($(ARCH
),mips
)
76 OPENBLAS_TARGET
:=MIPS24K
77 else ifeq ($(ARCH
),mipsel
)
78 OPENBLAS_TARGET
:=MIPS24K
79 else ifeq ($(ARCH
),powerpc
)
80 OPENBLAS_TARGET
:=PPC440
81 else ifeq ($(ARCH
),riscv64
)
82 OPENBLAS_TARGET
:=RISCV64_GENERIC
84 endif # ifeq ($(OPENBLAS_TARGET),)
86 ifeq ($(CONFIG_ARCH_64BIT
),y
)
94 CC
=$(TARGET_CC_NOCACHE
) \
95 CXX
=$(TARGET_CXX_NOCACHE
) \
96 HOSTCC
=$(HOSTCC_NOCACHE
) \
97 CROSS_SUFFIX
=$(TARGET_CROSS
) \
98 BINARY
=$(OPENBLAS_BINARY
) \
103 TARGET
=$(call qstrip
,$(OPENBLAS_TARGET
))
105 ifneq ($(CONFIG_INSTALL_GFORTRAN
),y
)
106 MAKE_FLAGS
+= NOFORTRAN
=1
109 define Build
/InstallDev
110 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
111 $(INSTALL_DIR
) $(1)/usr
/include
112 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/* $(1)/usr
/lib
/
113 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/* $(1)/usr
/include/
114 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/* $(1)/usr
/lib
/pkgconfig
/
117 define Package
/openblas
/install
118 $(INSTALL_DIR
) $(1)/usr
/lib
119 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libopenblas
*.so
* $(1)/usr
/lib
/
122 $(eval
$(call BuildPackage
,openblas
))