@@ -33,7 +33,7 @@ function get_plat_tag {
3333 local mb_ml_ver=${MB_ML_VER:- 1}
3434 local mb_ml_libc=${MB_ML_LIBC:- manylinux}
3535 case $plat in
36- i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le) ;;
36+ i686|x86_64|arm64|universal2|intel|aarch64|s390x|ppc64le|loongarch64 ) ;;
3737 * ) echo Did not recognize plat $plat ; return 1 ;;
3838 esac
3939 local uname=${2:- $(uname)}
@@ -77,6 +77,9 @@ function build_lib {
7777 # Manylinux wrapper
7878 local libc=${MB_ML_LIBC:- manylinux}
7979 local docker_image=quay.io/pypa/${libc}${manylinux} _${plat}
80+ if [ " $plat " == " loongarch64" ]; then
81+ local docker_image=ghcr.io/loong64/${libc}${manylinux} _${plat}
82+ fi
8083 docker pull $docker_image
8184 # Docker sources this script, and runs `do_build_lib`
8285 docker run --rm \
@@ -148,6 +151,9 @@ function do_build_lib {
148151 local bitness=64
149152 local target=" POWER8"
150153 ;;
154+ Linux-loongarch64)
155+ local target=" GENERIC"
156+ ;;
151157 * ) echo " Strange plat value $plat " ; exit 1 ;;
152158 esac
153159 case $interface64 in
@@ -170,6 +176,12 @@ function do_build_lib {
170176 pushd OpenBLAS
171177 patch_source
172178 echo start building
179+ if [ " $plat " == " loongarch64" ]; then
180+ # https://github.com/OpenMathLib/OpenBLAS/blob/develop/.github/workflows/loongarch64.yml#L65
181+ echo -n > utest/test_dsdot.c
182+ echo " Due to the qemu versions 7.2 causing utest cases to fail,"
183+ echo " the utest dsdot:dsdot_n_1 have been temporarily disabled."
184+ fi
173185 if [ -v dynamic_list ]; then
174186 CFLAGS=" $CFLAGS -fvisibility=protected -Wno-uninitialized" \
175187 make BUFFERSIZE=20 DYNAMIC_ARCH=1 QUIET_MAKE=1 \
0 commit comments