From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: [PATCH] Attempt to fix OpenBLAS on MIPS. Date: Tue, 21 Jul 2015 12:48:30 -0400 Message-ID: <87vbdd1mox.fsf@netris.org> References: <87zj2p1r0h.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHail-00062p-9q for guix-devel@gnu.org; Tue, 21 Jul 2015 12:48:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHaig-0004rO-RP for guix-devel@gnu.org; Tue, 21 Jul 2015 12:48:47 -0400 Received: from world.peace.net ([50.252.239.5]:36103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHaig-0004qu-NI for guix-devel@gnu.org; Tue, 21 Jul 2015 12:48:42 -0400 In-Reply-To: <87zj2p1r0h.fsf@netris.org> (Mark H. Weaver's message of "Tue, 21 Jul 2015 11:15:10 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ricardo Wurmus Cc: guix-devel Mark H Weaver writes: > Ricardo Wurmus writes: > >> Attached is a patch that *might* fix the build of OpenBLAS on MIPS. >> >> The LOONGSON3A and LOONGSON3B targets both enable the use of special >> extended instructions which may not be available on other MIPS CPUs. >> This patch forces the SICORTEX target to be used, which should limit the >> code to only standard MIPS instructions. >> >> I don=E2=80=99t know if this would actually work and I note that SICORTE= X is >> listed as a =E2=80=9Cmips=E2=80=9D target, rather than =E2=80=9Cmips64= =E2=80=9D, so maybe this is doomed >> to fail. I would appreciate it if someone with a MIPS machine could >> test this patch. > > With this patch, openblas builds successfully on mips64el, although I > cannot say whether it works, since there are no tests. I've since learned that normally tests are run during the 'build' phase, but that doesn't seem to be happening anymore on MIPS with this new patch applied. Here's the transcript of the end of the build phase: --8<---------------cut here---------------start------------->8--- ar -ru ../libopenblas_mipsp-r0.2.14.a samax_k.o samin_k.o smax_k.o smin_k.= o isamax_k.o isamin_k.o ismax_k.o ismin_k.o sasum_k.o saxpy_k.o scopy_k.o s= dot_k.o sdsdot_k.o dsdot_k.o snrm2_k.o srot_k.o sscal_k.o sswap_k.o saxpby_= k.o sgemv_n.o sgemv_t.o ssymv_U.o ssymv_L.o sger_k.o sgemm_kernel.o sgemm_i= ncopy.o sgemm_itcopy.o sgemm_oncopy.o sgemm_otcopy.o sgemm_beta.o strmm_ker= nel_LN.o strmm_kernel_LT.o strmm_kernel_RN.o strmm_kernel_RT.o strsm_kernel= _LN.o strsm_kernel_LT.o strsm_kernel_RN.o strsm_kernel_RT.o strmm_iunucopy.= o strmm_iunncopy.o strmm_ilnucopy.o strmm_ilnncopy.o strmm_iutucopy.o strmm= _iutncopy.o strmm_iltucopy.o strmm_iltncopy.o strmm_ounucopy.o strmm_ounnco= py.o strmm_olnucopy.o strmm_olnncopy.o strmm_outucopy.o strmm_outncopy.o st= rmm_oltucopy.o strmm_oltncopy.o strsm_iunucopy.o strsm_iunncopy.o strsm_iln= ucopy.o strsm_ilnncopy.o strsm_iutucopy.o strsm_iutncopy.o strsm_iltucopy.o= strsm_iltncopy.o strsm_ounucopy.o strsm_ounncopy.o strsm_olnucopy.o strsm_= olnncopy.o strsm_outucopy.o strsm_outncopy.o strsm_oltucopy.o strsm_oltncop= y.o ssymm_iutcopy.o ssymm_iltcopy.o ssymm_outcopy.o ssymm_oltcopy.o somatco= py_k_cn.o somatcopy_k_rn.o somatcopy_k_ct.o somatcopy_k_rt.o sgeadd_k.o dam= ax_k.o damin_k.o dmax_k.o dmin_k.o idamax_k.o idamin_k.o idmax_k.o idmin_k.= o dasum_k.o daxpy_k.o dcopy_k.o ddot_k.o dnrm2_k.o drot_k.o dscal_k.o dswap= _k.o daxpby_k.o dgemv_n.o dgemv_t.o dsymv_U.o dsymv_L.o dger_k.o dgemm_kern= el.o dgemm_incopy.o dgemm_itcopy.o dgemm_oncopy.o dgemm_otcopy.o dgemm_beta= .o dtrmm_kernel_LN.o dtrmm_kernel_LT.o dtrmm_kernel_RN.o dtrmm_kernel_RT.o = dtrsm_kernel_LN.o dtrsm_kernel_LT.o dtrsm_kernel_RN.o dtrsm_kernel_RT.o dtr= mm_iunucopy.o dtrmm_iunncopy.o dtrmm_ilnucopy.o dtrmm_ilnncopy.o dtrmm_iutu= copy.o dtrmm_iutncopy.o dtrmm_iltucopy.o dtrmm_iltncopy.o dtrmm_ounucopy.o = dtrmm_ounncopy.o dtrmm_olnucopy.o dtrmm_olnncopy.o dtrmm_outucopy.o dtrmm_o= utncopy.o dtrmm_oltucopy.o dtrmm_oltncopy.o dtrsm_iunucopy.o dtrsm_iunncopy= .o dtrsm_ilnucopy.o dtrsm_ilnncopy.o dtrsm_iutucopy.o dtrsm_iutncopy.o dtrs= m_iltucopy.o dtrsm_iltncopy.o dtrsm_ounucopy.o dtrsm_ounncopy.o dtrsm_olnuc= opy.o dtrsm_olnncopy.o dtrsm_outucopy.o dtrsm_outncopy.o dtrsm_oltucopy.o d= trsm_oltncopy.o dsymm_iutcopy.o dsymm_iltcopy.o dsymm_outcopy.o dsymm_oltco= py.o domatcopy_k_cn.o domatcopy_k_rn.o domatcopy_k_ct.o domatcopy_k_rt.o dg= eadd_k.o camax_k.o camin_k.o icamax_k.o icamin_k.o casum_k.o caxpy_k.o caxp= yc_k.o ccopy_k.o cdotc_k.o cdotu_k.o cnrm2_k.o csrot_k.o cscal_k.o cswap_k.= o caxpby_k.o cgemv_n.o cgemv_t.o cgemv_r.o cgemv_c.o cgemv_o.o cgemv_u.o cg= emv_s.o cgemv_d.o csymv_U.o csymv_L.o chemv_U.o chemv_L.o chemv_V.o chemv_M= .o cgeru_k.o cgerc_k.o cgerv_k.o cgerd_k.o cgemm_kernel_n.o cgemm_kernel_r.= o cgemm_kernel_l.o cgemm_kernel_b.o cgemm_incopy.o cgemm_itcopy.o cgemm_onc= opy.o cgemm_otcopy.o cgemm_beta.o ctrmm_kernel_LN.o ctrmm_kernel_LT.o ctrmm= _kernel_LR.o ctrmm_kernel_LC.o ctrmm_kernel_RN.o ctrmm_kernel_RT.o ctrmm_ke= rnel_RR.o ctrmm_kernel_RC.o ctrsm_kernel_LN.o ctrsm_kernel_LT.o ctrsm_kerne= l_LR.o ctrsm_kernel_LC.o ctrsm_kernel_RN.o ctrsm_kernel_RT.o ctrsm_kernel_R= R.o ctrsm_kernel_RC.o ctrmm_iunucopy.o ctrmm_iunncopy.o ctrmm_ilnucopy.o ct= rmm_ilnncopy.o ctrmm_iutucopy.o ctrmm_iutncopy.o ctrmm_iltucopy.o ctrmm_ilt= ncopy.o ctrmm_ounucopy.o ctrmm_ounncopy.o ctrmm_olnucopy.o ctrmm_olnncopy.o= ctrmm_outucopy.o ctrmm_outncopy.o ctrmm_oltucopy.o ctrmm_oltncopy.o ctrsm_= iunucopy.o ctrsm_iunncopy.o ctrsm_ilnucopy.o ctrsm_ilnncopy.o ctrsm_iutucop= y.o ctrsm_iutncopy.o ctrsm_iltucopy.o ctrsm_iltncopy.o ctrsm_ounucopy.o ctr= sm_ounncopy.o ctrsm_olnucopy.o ctrsm_olnncopy.o ctrsm_outucopy.o ctrsm_outn= copy.o ctrsm_oltucopy.o ctrsm_oltncopy.o csymm_iutcopy.o csymm_iltcopy.o cs= ymm_outcopy.o csymm_oltcopy.o chemm_iutcopy.o chemm_iltcopy.o chemm_outcopy= .o chemm_oltcopy.o comatcopy_k_cn.o comatcopy_k_rn.o comatcopy_k_ct.o comat= copy_k_rt.o comatcopy_k_cnc.o comatcopy_k_rnc.o comatcopy_k_ctc.o comatcopy= _k_rtc.o cgeadd_k.o zamax_k.o zamin_k.o izamax_k.o izamin_k.o zasum_k.o zax= py_k.o zaxpyc_k.o zcopy_k.o zdotc_k.o zdotu_k.o znrm2_k.o zdrot_k.o zscal_k= .o zswap_k.o zaxpby_k.o zgemv_n.o zgemv_t.o zgemv_r.o zgemv_c.o zgemv_o.o z= gemv_u.o zgemv_s.o zgemv_d.o zsymv_U.o zsymv_L.o zhemv_U.o zhemv_L.o zhemv_= V.o zhemv_M.o zgeru_k.o zgerc_k.o zgerv_k.o zgerd_k.o zgemm_kernel_n.o zgem= m_kernel_r.o zgemm_kernel_l.o zgemm_kernel_b.o zgemm_incopy.o zgemm_itcopy.= o zgemm_oncopy.o zgemm_otcopy.o zgemm_beta.o ztrmm_kernel_LN.o ztrmm_kernel= _LT.o ztrmm_kernel_LR.o ztrmm_kernel_LC.o ztrmm_kernel_RN.o ztrmm_kernel_RT= .o ztrmm_kernel_RR.o ztrmm_kernel_RC.o ztrsm_kernel_LN.o ztrsm_kernel_LT.o = ztrsm_kernel_LR.o ztrsm_kernel_LC.o ztrsm_kernel_RN.o ztrsm_kernel_RT.o ztr= sm_kernel_RR.o ztrsm_kernel_RC.o ztrmm_iunucopy.o ztrmm_iunncopy.o ztrmm_il= nucopy.o ztrmm_ilnncopy.o ztrmm_iutucopy.o ztrmm_iutncopy.o ztrmm_iltucopy.= o ztrmm_iltncopy.o ztrmm_ounucopy.o ztrmm_ounncopy.o ztrmm_olnucopy.o ztrmm= _olnncopy.o ztrmm_outucopy.o ztrmm_outncopy.o ztrmm_oltucopy.o ztrmm_oltnco= py.o ztrsm_iunucopy.o ztrsm_iunncopy.o ztrsm_ilnucopy.o ztrsm_ilnncopy.o zt= rsm_iutucopy.o ztrsm_iutncopy.o ztrsm_iltucopy.o ztrsm_iltncopy.o ztrsm_oun= ucopy.o ztrsm_ounncopy.o ztrsm_olnucopy.o ztrsm_olnncopy.o ztrsm_outucopy.o= ztrsm_outncopy.o ztrsm_oltucopy.o ztrsm_oltncopy.o zsymm_iutcopy.o zsymm_i= ltcopy.o zsymm_outcopy.o zsymm_oltcopy.o zhemm_iutcopy.o zhemm_iltcopy.o zh= emm_outcopy.o zhemm_oltcopy.o zomatcopy_k_cn.o zomatcopy_k_rn.o zomatcopy_k= _ct.o zomatcopy_k_rt.o zomatcopy_k_cnc.o zomatcopy_k_rnc.o zomatcopy_k_ctc.= o zomatcopy_k_rtc.o zgeadd_k.o lsame.o scabs1.o dcabs1.o ar: `u' modifier ignored since `D' is the default (see `U') make[1]: Leaving directory '/tmp/nix-build-openblas-0.2.14.drv-0/xianyi-Ope= nBLAS-2b0d8a8/kernel' make[1]: warning: -jN forced in submake: disabling jobserver mode. make[1]: Entering directory '/tmp/nix-build-openblas-0.2.14.drv-0/xianyi-Op= enBLAS-2b0d8a8/exports' perl ./gensymbol linktest mips64 _ 0 0 1 1 0 0 "" "" > linktest.c gcc -O2 -Wall -mabi=3Dn32 -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACK= E -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=3D4 -DUSE_SIMPLE_THREADED_LEVEL= 3 -DASMNAME=3D -DASMFNAME=3D_ -DNAME=3D_ -DCNAME=3D -DCHAR_NAME=3D\"_\" -DC= HAR_CNAME=3D\"\" -DNO_AFFINITY -I.. -shared -o ../libopenblas_mipsp-r0.2.1= 4.so \ -Wl,--whole-archive ../libopenblas_mipsp-r0.2.14.a -Wl,--no-whole-archive \ -Wl,-soname,libopenblas.so.0 -lm -lpthread -lm -lpthread gcc -O2 -Wall -mabi=3Dn32 -DF_INTERFACE_GFORT -fPIC -DNO_LAPACK -DNO_LAPACK= E -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=3D4 -DUSE_SIMPLE_THREADED_LEVEL= 3 -DASMNAME=3D -DASMFNAME=3D_ -DNAME=3D_ -DCNAME=3D -DCHAR_NAME=3D\"_\" -DC= HAR_CNAME=3D\"\" -DNO_AFFINITY -I.. -w -o linktest linktest.c ../libopenbl= as_mipsp-r0.2.14.so && echo OK. OK. rm -f linktest make[1]: Leaving directory '/tmp/nix-build-openblas-0.2.14.drv-0/xianyi-Ope= nBLAS-2b0d8a8/exports' OpenBLAS build complete. (BLAS CBLAS) OS ... Linux=20=20=20=20=20=20=20=20=20=20=20=20=20 Architecture ... mips64=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 BINARY ... 32bit=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 C compiler ... GCC (command line : gcc) Fortran compiler ... GFORTRAN (command line : gfortran) Library Name ... libopenblas_mipsp-r0.2.14.a (Multi threaded; Max num= -threads is 4) To install the library, you can run "make PREFIX=3D/path/to/your/installati= on install". phase `build' succeeded after 1098 seconds --8<---------------cut here---------------end--------------->8--- Mark