1 ################################################################################
5 ################################################################################
7 OPENBLAS_VERSION
= f04af36ad0e85b64f12a7c38095383192cc52345
8 OPENBLAS_SITE
= $(call github
,xianyi
,OpenBLAS
,$(OPENBLAS_VERSION
))
9 OPENBLAS_LICENSE
= BSD-3c
10 OPENBLAS_LICENSE_FILES
= LICENSE
11 OPENBLAS_INSTALL_STAGING
= YES
13 # Initialise OpenBLAS make options to $(TARGET_CONFIGURE_OPTS)
14 OPENBLAS_MAKE_OPTS
= $(TARGET_CONFIGURE_OPTS
)
16 # Enable cross-compiling
17 OPENBLAS_MAKE_OPTS
+= CROSS
=1
20 OPENBLAS_MAKE_OPTS
+= TARGET
=$(BR2_PACKAGE_OPENBLAS_TARGET
)
22 # When Fortran is not available, only build the C version of BLAS
23 ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN
),)
24 OPENBLAS_MAKE_OPTS
+= ONLY_CBLAS
=1
27 # Enable/Disable multi-threading (not for static-only since it uses dlfcn.h)
28 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS
):$(BR2_STATIC_LIBS
),y
:)
29 OPENBLAS_MAKE_OPTS
+= USE_THREAD
=1
31 OPENBLAS_MAKE_OPTS
+= USE_THREAD
=0
34 # Static-only/Shared-only toggle
35 ifeq ($(BR2_STATIC_LIBS
),y
)
36 OPENBLAS_MAKE_OPTS
+= NO_SHARED
=1
37 else ifeq ($(BR2_SHARED_LIBS
),y
)
38 OPENBLAS_MAKE_OPTS
+= NO_STATIC
=1
41 # binutils version <= 2.23.2 has a bug
42 # (https://sourceware.org/bugzilla/show_bug.cgi?id=14887) where
43 # whitespaces in ARM register specifications such as [ r1, #12 ] or [
44 # r2 ] cause the assembler to reject the code. Since there are
45 # numerous instances of such cases in the code, we use sed rather than
46 # a patch. We simply replace [ foobar ] by [foobar] to work around the
48 define OPENBLAS_FIXUP_ARM_ASSEMBLY
49 $(SED
) 's%\[\s*%\[%;s%\s*\]%\]%' $(@D
)/kernel
/arm
/*.S
52 OPENBLAS_POST_PATCH_HOOKS
+= OPENBLAS_FIXUP_ARM_ASSEMBLY
54 define OPENBLAS_BUILD_CMDS
55 $(TARGET_MAKE_ENV
) $(MAKE
) $(OPENBLAS_MAKE_OPTS
) \
59 define OPENBLAS_INSTALL_STAGING_CMDS
60 $(TARGET_MAKE_ENV
) $(MAKE
) $(OPENBLAS_MAKE_OPTS
) \
61 -C
$(@D
) install PREFIX
=$(STAGING_DIR
)/usr
64 define OPENBLAS_INSTALL_TARGET_CMDS
65 $(TARGET_MAKE_ENV
) $(MAKE
) $(OPENBLAS_MAKE_OPTS
) \
66 -C
$(@D
) install PREFIX
=$(TARGET_DIR
)/usr
69 $(eval
$(generic-package
))