You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.4 KiB

openblas: default to MIPS24K target for all mips32 targets Reported via: https://github.com/openwrt/packages/pull/16823#issuecomment-945312460 This fails in mips_mip32 targets with the output listed below. Using the MIPS24K target works fine. ``` mips-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32 -mtune=mips32 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-mips_mips32_musl/OpenBLAS-0.3.18=OpenBLAS-0.3.18 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mips_mips32_gcc-11.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mips_mips32_gcc-11.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mips_mips32_gcc-11.2.0_musl/include -DMAX_STACK_ALLOC=2048 -Wall -mabi=32 -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DNO_AVX512 -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=2 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.18\" -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I. -DMAX_STACK_ALLOC=2048 -Wall -mabi=32 -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DNO_AVX512 -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=2 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.18\" -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=sgemm -DASMFNAME=sgemm_ -DNAME=sgemm_ -DCNAME=sgemm -DCHAR_NAME=\"sgemm_\" -DCHAR_CNAME=\"sgemm\" -DNO_AFFINITY -I.. -I. -UDOUBLE -UCOMPLEX gemm.c -o sgemm.o In file included from ../common.h:581, from gemm.c:41: gemm.c: In function 'sgemm_': ../param.h:3477:25: error: 'sgemm_p' undeclared (first use in this function); did you mean 'sgemm_'? 3477 | #define SGEMM_DEFAULT_P sgemm_p | ^~~~~~~ ../common_param.h:1334:25: note: in expansion of macro 'SGEMM_DEFAULT_P' 1334 | #define SGEMM_P SGEMM_DEFAULT_P | ^~~~~~~~~~~~~~~ ../common_param.h:1482:33: note: in expansion of macro 'SGEMM_P' 1482 | #define GEMM_P SGEMM_P | ^~~~~~~ gemm.c:494:37: note: in expansion of macro 'GEMM_P' 494 | sb = (XFLOAT *)(((BLASLONG)sa + ((GEMM_P * GEMM_Q * COMPSIZE * SIZE + GEMM_ALIGN) & ~GEMM_ALIGN)) + GEMM_OFFSET_B); | ^~~~~~ ../param.h:3477:25: note: each undeclared identifier is reported only once for each function it appears in 3477 | #define SGEMM_DEFAULT_P sgemm_p | ^~~~~~~ ../common_param.h:1334:25: note: in expansion of macro 'SGEMM_DEFAULT_P' 1334 | #define SGEMM_P SGEMM_DEFAULT_P | ^~~~~~~~~~~~~~~ ../common_param.h:1482:33: note: in expansion of macro 'SGEMM_P' 1482 | #define GEMM_P SGEMM_P | ^~~~~~~ gemm.c:494:37: note: in expansion of macro 'GEMM_P' 494 | sb = (XFLOAT *)(((BLASLONG)sa + ((GEMM_P * GEMM_Q * COMPSIZE * SIZE + GEMM_ALIGN) & ~GEMM_ALIGN)) + GEMM_OFFSET_B); | ^~~~~~ make[5]: *** [Makefile:1295: sgemm.o] Error 1 make[5]: Leaving directory '/builder/shared-workdir/ ``` Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
3 years ago
openblas: default to MIPS24K target for all mips32 targets Reported via: https://github.com/openwrt/packages/pull/16823#issuecomment-945312460 This fails in mips_mip32 targets with the output listed below. Using the MIPS24K target works fine. ``` mips-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32 -mtune=mips32 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-mips_mips32_musl/OpenBLAS-0.3.18=OpenBLAS-0.3.18 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mips_mips32_gcc-11.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mips_mips32_gcc-11.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mips_mips32_gcc-11.2.0_musl/include -DMAX_STACK_ALLOC=2048 -Wall -mabi=32 -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DNO_AVX512 -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=2 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.18\" -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I. -DMAX_STACK_ALLOC=2048 -Wall -mabi=32 -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACKE -DNO_AVX512 -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=2 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.18\" -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=sgemm -DASMFNAME=sgemm_ -DNAME=sgemm_ -DCNAME=sgemm -DCHAR_NAME=\"sgemm_\" -DCHAR_CNAME=\"sgemm\" -DNO_AFFINITY -I.. -I. -UDOUBLE -UCOMPLEX gemm.c -o sgemm.o In file included from ../common.h:581, from gemm.c:41: gemm.c: In function 'sgemm_': ../param.h:3477:25: error: 'sgemm_p' undeclared (first use in this function); did you mean 'sgemm_'? 3477 | #define SGEMM_DEFAULT_P sgemm_p | ^~~~~~~ ../common_param.h:1334:25: note: in expansion of macro 'SGEMM_DEFAULT_P' 1334 | #define SGEMM_P SGEMM_DEFAULT_P | ^~~~~~~~~~~~~~~ ../common_param.h:1482:33: note: in expansion of macro 'SGEMM_P' 1482 | #define GEMM_P SGEMM_P | ^~~~~~~ gemm.c:494:37: note: in expansion of macro 'GEMM_P' 494 | sb = (XFLOAT *)(((BLASLONG)sa + ((GEMM_P * GEMM_Q * COMPSIZE * SIZE + GEMM_ALIGN) & ~GEMM_ALIGN)) + GEMM_OFFSET_B); | ^~~~~~ ../param.h:3477:25: note: each undeclared identifier is reported only once for each function it appears in 3477 | #define SGEMM_DEFAULT_P sgemm_p | ^~~~~~~ ../common_param.h:1334:25: note: in expansion of macro 'SGEMM_DEFAULT_P' 1334 | #define SGEMM_P SGEMM_DEFAULT_P | ^~~~~~~~~~~~~~~ ../common_param.h:1482:33: note: in expansion of macro 'SGEMM_P' 1482 | #define GEMM_P SGEMM_P | ^~~~~~~ gemm.c:494:37: note: in expansion of macro 'GEMM_P' 494 | sb = (XFLOAT *)(((BLASLONG)sa + ((GEMM_P * GEMM_Q * COMPSIZE * SIZE + GEMM_ALIGN) & ~GEMM_ALIGN)) + GEMM_OFFSET_B); | ^~~~~~ make[5]: *** [Makefile:1295: sgemm.o] Error 1 make[5]: Leaving directory '/builder/shared-workdir/ ``` Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
3 years ago
  1. #
  2. # Copyright (C) 2021 Alexandru Ardelean <ardeleanalex@gmail.com>
  3. #
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=OpenBLAS
  6. PKG_VERSION:=0.3.18
  7. PKG_RELEASE:=$(AUTORELEASE)
  8. PKG_SOURCE:=OpenBLAS-$(PKG_VERSION).tar.gz
  9. PKG_SOURCE_URL:=https://github.com/xianyi/OpenBLAS/releases/download/v$(PKG_VERSION)/
  10. PKG_HASH:=1632c1e8cca62d8bed064b37747e331a1796fc46f688626337362bf0d16aeadb
  11. PKG_LICENSE:=BSD 3-Clause
  12. PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  13. PKG_BUILD_PARALLEL:=1
  14. PKG_INSTALL:=1
  15. include $(INCLUDE_DIR)/package.mk
  16. define Package/openblas
  17. SECTION:=libs
  18. CATEGORY:=Libraries
  19. TITLE:=An optimized library for BLAS (Basic Linear Algebra Subprograms)
  20. URL:=https://www.openblas.net/
  21. DEPENDS:= \
  22. @!arc \
  23. @!powerpc \
  24. +INSTALL_GFORTRAN:libgfortran
  25. endef
  26. define Package/openblas/description
  27. OpenBLAS is an optimized BLAS (Basic Linear Algebra Subprograms) library
  28. based on GotoBLAS2 1.13 BSD version.
  29. endef
  30. define Package/openblas/config
  31. menu "Configuration"
  32. depends on PACKAGE_openblas
  33. config OPENBLAS_TARGET_OVERRIDE
  34. string
  35. prompt "Manual CPU target override (from the OpenBLAS TargetList.txt file)"
  36. endmenu
  37. endef
  38. OPENBLAS_TARGET=$(call qstrip,$(CONFIG_OPENBLAS_TARGET_OVERRIDE))
  39. CPU_TYPE=$(call qstrip,$(CONFIG_CPU_TYPE))
  40. ifeq ($(OPENBLAS_TARGET),)
  41. # initialize to GENERIC as default
  42. OPENBLAS_TARGET:=GENERIC
  43. ifeq ($(ARCH),aarch64)
  44. OPENBLAS_TARGET:=ARMV8
  45. else ifeq ($(ARCH),arm)
  46. OPENBLAS_TARGET:=ARMV5
  47. else ifeq ($(ARCH),mips)
  48. OPENBLAS_TARGET:=MIPS24K
  49. else ifeq ($(ARCH),mipsel)
  50. OPENBLAS_TARGET:=MIPS24K
  51. else ifeq ($(ARCH),powerpc)
  52. OPENBLAS_TARGET:=PPC440
  53. endif
  54. endif # ifeq ($(OPENBLAS_TARGET),)
  55. ifeq ($(CONFIG_ARCH_64BIT),y)
  56. OPENBLAS_BINARY:=64
  57. else
  58. OPENBLAS_BINARY:=32
  59. endif
  60. MAKE_FLAGS += \
  61. CROSS=1 \
  62. HOSTCC=$(HOSTCC_NOCACHE) \
  63. CROSS_SUFFIX=$(TARGET_CROSS) \
  64. BINARY=$(OPENBLAS_BINARY) \
  65. MAKE_NB_JOBS=-1 \
  66. NUM_THREADS=2 \
  67. PREFIX=/usr \
  68. COMMON_OPT="" \
  69. TARGET=$(call qstrip,$(OPENBLAS_TARGET))
  70. ifneq ($(CONFIG_INSTALL_GFORTRAN),y)
  71. MAKE_FLAGS += NOFORTRAN=1
  72. endif
  73. define Build/InstallDev
  74. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  75. $(INSTALL_DIR) $(1)/usr/include
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  77. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  78. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  79. endef
  80. define Package/openblas/install
  81. $(INSTALL_DIR) $(1)/usr/lib
  82. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenblas*.so* $(1)/usr/lib/
  83. endef
  84. $(eval $(call BuildPackage,openblas))