Skip to content

Unable to build for MIPS #902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bubiche opened this issue Jun 1, 2016 · 10 comments
Closed

Unable to build for MIPS #902

bubiche opened this issue Jun 1, 2016 · 10 comments

Comments

@bubiche
Copy link

bubiche commented Jun 1, 2016

Hi,

Hi, I have followed the instructions to build OpenBLAS for Android and made a GNU toolchain for Android with Fortran support following the guide here: https://github.com/buffer51/android-gfortran

When I use make TARGET=P5600 HOSTCC=gcc CC=mipsel-linux-android-gcc FC=mipsel-linux-android-gfortran, I get the error: http://paste.ubuntu.com/16884117/

Can you help me please. Thank you very much!

@brada4
Copy link
Contributor

brada4 commented Jun 1, 2016

You need to add -march=mips32r5 to permit assembly instructions that your cpu has

@bubiche
Copy link
Author

bubiche commented Jun 1, 2016

Thanks a lot! It works perfectly now

@brada4
Copy link
Contributor

brada4 commented Jun 1, 2016

Let @xianyi close just in case this can/should be integrated in build system

@martin-frbg
Copy link
Collaborator

Build instructions for P5600 (and other MIPS targets) as provided by ksraste in #949 have been included in the faq since then, so closing now

@James6xie
Copy link

James6xie commented Oct 24, 2019

I build 0.3.3 on mips64el there had something wrong:

1.msaflags unrecognized:
rpmbuild/BUILD/openblas-0.3.3/Rblas'
gcc: error: unrecognized command line option '-msched-weight
2. test failed
gcc -O3 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -Wa,-mno-fix-loongson3-loads -fPIC -DUTEST_CHECK -DSANITY_CHECK -DREFNAME=test_potrsf_ -DMAX_STACK_ALLOC=2048 -Wall -mabi=64 -march=loongson3a -DF_INTERFACE_GFORT -fPIC -DNO_WARMUP -DMAX_CPU_NUMBER=128 -DMAX_PARALLEL_NUMBER=1 -DUSE_SIMPLE_THREADED_LEVEL3 -DUSE_TLS -DASMNAME=test_potrs -DASMFNAME=test_potrs_ -DNAME=test_potrs_ -DCNAME=test_potrs -DCHAR_NAME="test_potrs_" -DCHAR_CNAME="test_potrs" -DNO_AFFINITY -I.. -c -o test_potrs.o test_potrs.c
gcc -O3 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -Wa,-mno-fix-loongson3-loads -fPIC -DUTEST_CHECK -DSANITY_CHECK -DREFNAME=test_forkf_ -DMAX_STACK_ALLOC=2048 -Wall -mabi=64 -march=loongson3a -DF_INTERFACE_GFORT -fPIC -DNO_WARMUP -DMAX_CPU_NUMBER=128 -DMAX_PARALLEL_NUMBER=1 -DUSE_SIMPLE_THREADED_LEVEL3 -DUSE_TLS -DASMNAME=test_fork -DASMFNAME=test_fork_ -DNAME=test_fork_ -DCNAME=test_fork -DCHAR_NAME="test_fork_" -DCHAR_CNAME="test_fork" -DNO_AFFINITY -I.. -c -o test_fork.o test_fork.c
gcc -O3 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -mabi=64 -march=loongson3a -fno-delete-null-pointer-checks -Wa,-mno-fix-loongson3-loads -fPIC -DUTEST_CHECK -DSANITY_CHECK -DREFNAME=f_ -DMAX_STACK_ALLOC=2048 -Wall -mabi=64 -march=loongson3a -DF_INTERFACE_GFORT -fPIC -DNO_WARMUP -DMAX_CPU_NUMBER=128 -DMAX_PARALLEL_NUMBER=1 -DUSE_SIMPLE_THREADED_LEVEL3 -DUSE_TLS -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME="_" -DCHAR_CNAME="" -DNO_AFFINITY -I.. -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o openblas_utest utest_main.o test_amax.o test_rotmg.o test_axpy.o test_dotu.o test_dsdot.o test_swap.o test_rot.o test_potrs.o test_fork.o ../libRblas_loongson3a-r0.3.3.a -lm -lgfortran -lm -lgfortran -L/usr/lib/gcc/mips64el-redhat-linux/8 -L/usr/lib/gcc/mips64el-redhat-linux/8/../../../../lib64 -L/lib64/../lib64 -L/usr/lib64/../lib64 -L/usr/lib/gcc/mips64el-redhat-linux/8/../../.. -L/lib64 -L/usr/lib64 -lgfortran -lm -lm -lc
./openblas_utest
TEST 1/23 amax:samax [OK]
TEST 2/23 drotmg:drotmg_D1_big_D2_big_flag_zero [OK]
TEST 3/23 drotmg:rotmg_D1eqD2_X1eqX2 [OK]
TEST 4/23 drotmg:rotmg_issue1452 [OK]
TEST 5/23 drotmg:rotmg [OK]
TEST 6/23 axpy:caxpy_inc_0 [OK]
TEST 7/23 axpy:saxpy_inc_0 [FAIL]
ERR: test_axpy.c:90 expected 4.000e+00, got 2.250e+00 (diff 1.750e+00, tol 1.000e-13)
TEST 8/23 axpy:zaxpy_inc_0 [OK]
TEST 9/23 axpy:daxpy_inc_0 [FAIL]
ERR: test_axpy.c:52 expected 4.000e+00, got 2.250e+00 (diff 1.750e+00, tol 1.000e-13)
TEST 10/23 zdotu:zdotu_offset_1 [OK]
TEST 11/23 zdotu:zdotu_n_1 [OK]
TEST 12/23 dsdot:dsdot_n_1 [OK]
TEST 13/23 swap:cswap_inc_0 [OK]
TEST 14/23 swap:sswap_inc_0 [OK]
TEST 15/23 swap:zswap_inc_0 [OK]
TEST 16/23 swap:dswap_inc_0 [OK]
TEST 17/23 rot:csrot_inc_0 [OK]
TEST 18/23 rot:srot_inc_0 [OK]
TEST 19/23 rot:zdrot_inc_0 [OK]
TEST 20/23 rot:drot_inc_0 [OK]
TEST 21/23 potrf:smoketest_trivial [OK]
TEST 22/23 potrf:bug_695 [OK]
TEST 23/23 fork:safety [OK]
RESULTS: 23 tests (21 ok, 2 failed, 0 skipped) ran in 1660 ms
make[1]: *** [Makefile:33: run_test] Error 2

@martin-frbg
Copy link
Collaborator

Can you try with current 0.3.7 please ? I believe I fixed the axpy failure some time ago. (And I think you need a toolchain with gcc 4.9 or newer for the -msched-weight option to be recognized ).
Is that a Loongson3A cpu ?

@James6xie
Copy link

Can you try with current 0.3.7 please ? I believe I fixed the axpy failure some time ago. (And I think you need a toolchain with gcc 4.9 or newer for the -msched-weight option to be recognized ).
Is that a Loongson3A cpu ?

thanks a lot..
yes 0.3.7 can PASS AXPY TEST;
yes I build on Loongson3A cpu;

there is failed test on cblas_cherk :
cblas_cherk PASSED THE TESTS OF ERROR-EXITS

******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HALF ACCURATE *******
EXPECTED RESULT COMPUTED RESULT
1 ( 0.456543 , 0.00000 ) ( 0.456543 , -0.100000E+11)
2 ( 0.186813 , -0.929071E-01) ( 0.186813 , -0.929071E-01)
3 ( -0.382617 , 0.498502 ) ( -0.382617 , 0.498502 )
4 ( -0.252747 , 0.429570E-01) ( -0.252747 , 0.429570E-01)
5 ( 0.106893 , -0.492507 ) ( 0.106893 , -0.492507 )
THESE ARE THE RESULTS FOR COLUMN 1
******* cblas_cherk FAILED ON CALL NUMBER:
911: cblas_cherk ( CblasColMajor, CblasLower, CblasNoTrans,
5, 1, 0.0, A, 6, 1.0, C, 6).
******* cblas_cherk FAILED ON CALL NUMBER:
217: cblas_cherk ( CblasRowMajor, CblasUpper, CblasNoTrans,
1, 0, 0.0, A, 2, 0.0, C, 2).

******* FATAL ERROR - TESTS ABANDONED *******

@brada4
Copy link
Contributor

brada4 commented Oct 25, 2019

I think test is faulty, it is just one bit change in first i

@martin-frbg
Copy link
Collaborator

@brada4 test is the same on all platforms, and every bit counts (could be an overflow or register overwrite)
@zhongtianxie I expect you see a corresponding failure in CHERK as well ? Any other "LESS THAN HALF ACCURATE" errors ?

@martin-frbg
Copy link
Collaborator

martin-frbg commented Oct 25, 2019

Hmmm. I have to admit now that the error does look suspiciously similar to #46 - @zhongtianxie could you please check if adding

RALS=RONE
RBETS=RONE

after line 1505 in ctest/c_cblat3.f (as was done in test/cblat3.f years ago) makes the error go away ? (This would probably be needed in the same location in c_zblat3.f as well to avoid false errors for cblas_zherk)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants