perl-cross: bump to version 1.1.4
[buildroot-gz.git] / package / openblas / openblas.mk
bloba26e10a43ce601da56dde7bf584b20aa6c9518c8
1 ################################################################################
3 # openblas
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
19 # Set OpenBLAS target
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
25 endif
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
30 else
31 OPENBLAS_MAKE_OPTS += USE_THREAD=0
32 endif
34 # We don't know if OpenMP is available or not, so disable
35 OPENBLAS_MAKE_OPTS += USE_OPENMP=0
37 # Static-only/Shared-only toggle
38 ifeq ($(BR2_STATIC_LIBS),y)
39 OPENBLAS_MAKE_OPTS += NO_SHARED=1
40 else ifeq ($(BR2_SHARED_LIBS),y)
41 OPENBLAS_MAKE_OPTS += NO_STATIC=1
42 endif
44 # binutils version <= 2.23.2 has a bug
45 # (https://sourceware.org/bugzilla/show_bug.cgi?id=14887) where
46 # whitespaces in ARM register specifications such as [ r1, #12 ] or [
47 # r2 ] cause the assembler to reject the code. Since there are
48 # numerous instances of such cases in the code, we use sed rather than
49 # a patch. We simply replace [ foobar ] by [foobar] to work around the
50 # problem.
51 define OPENBLAS_FIXUP_ARM_ASSEMBLY
52 $(SED) 's%\[\s*%\[%;s%\s*\]%\]%' $(@D)/kernel/arm/*.S
53 endef
55 OPENBLAS_POST_PATCH_HOOKS += OPENBLAS_FIXUP_ARM_ASSEMBLY
57 define OPENBLAS_BUILD_CMDS
58 $(TARGET_MAKE_ENV) $(MAKE) $(OPENBLAS_MAKE_OPTS) \
59 -C $(@D)
60 endef
62 define OPENBLAS_INSTALL_STAGING_CMDS
63 $(TARGET_MAKE_ENV) $(MAKE) $(OPENBLAS_MAKE_OPTS) \
64 -C $(@D) install PREFIX=$(STAGING_DIR)/usr
65 endef
67 define OPENBLAS_INSTALL_TARGET_CMDS
68 $(TARGET_MAKE_ENV) $(MAKE) $(OPENBLAS_MAKE_OPTS) \
69 -C $(@D) install PREFIX=$(TARGET_DIR)/usr
70 endef
72 $(eval $(generic-package))