Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 837806 - sci-libs/openblas-0.3.19: fails to recognize RISC-V architecture, error: ‘-march=loongson3a’
Summary: sci-libs/openblas-0.3.19: fails to recognize RISC-V architecture, error: ‘-ma...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 837797
  Show dependency tree
 
Reported: 2022-04-11 08:33 UTC by Atharva
Modified: 2022-04-27 21:19 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,12.50 KB, text/x-log)
2022-04-11 08:33 UTC, Atharva
Details
output of emerge --info (emerge_info.txt.xz,2.55 KB, application/x-xz)
2022-04-12 03:19 UTC, Atharva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Atharva 2022-04-11 08:33:29 UTC
Created attachment 770066 [details]
build log

openblas failed to compile on riscv architecture.
Comment 1 Yixun Lan archtester gentoo-dev 2022-04-11 08:47:40 UTC
the most obvious error is as following:

===============
getarch_2nd.c: In function ‘main’:
getarch_2nd.c:22:35: error: ‘SGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_UNROLL_M’?
   22 |     printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~
      |                                   SBGEMM_DEFAULT_UNROLL_M

...

riscv64-unknown-linux-gnu-gcc: error: ‘-march=loongson3a’: ISA string must begin with rv32 or rv64

===============
it fail to recognize riscv64 architecture, and thus use wrong loongson compiling flags here
Comment 2 Alex Fan archtester 2022-04-11 10:01:29 UTC
I am able to get around this issue by setting OPENBLAS_TARGET=RISCV64_GENERIC in make.conf as noted in pkg_pretend() of this package's ebuild. Probably the auto detection for cpu arch was not successful.
Comment 3 Jakov Smolić archtester gentoo-dev 2022-04-11 21:19:54 UTC
(In reply to Atharva from comment #0)
> Created attachment 770066 [details]
> build log
> 
> openblas failed to compile on riscv architecture.

Can you also post your `emerge --info` output? (it's also a good idea to do so when reporting any bug since build log + emerge --info is can give more accurate picture of the environment package was tested in as mentioned in https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket)
Comment 4 Atharva 2022-04-12 03:19:59 UTC
Created attachment 770195 [details]
output of emerge --info
Comment 5 Han Gao 2022-04-27 11:13:51 UTC
gentoo-r720 ~/dev/openblas # cat openblas.report
USE tests started on Tue Apr 26 19:28:17 -00 2022

FEATURES=' test' USE='' succeeded for =sci-libs/openblas-0.3.20
USE='-dynamic -eselect-ldso index-64bit -openmp -pthread -relapack' succeeded for =sci-libs/openblas-0.3.20
USE='dynamic -eselect-ldso index-64bit -openmp -pthread -relapack' failed for =sci-libs/openblas-0.3.20
    log has been saved as ./tatt/logs/sci-libs_openblas-0.3.20_use_BCigv
USE='dynamic -eselect-ldso -index-64bit openmp -pthread -relapack' failed for =sci-libs/openblas-0.3.20
    log has been saved as ./tatt/logs/sci-libs_openblas-0.3.20_use_pmzD4
USE='dynamic eselect-ldso -index-64bit openmp -pthread -relapack' failed for =sci-libs/openblas-0.3.20
    log has been saved as ./tatt/logs/sci-libs_openblas-0.3.20_use_d7H0X
USE='dynamic eselect-ldso index-64bit -openmp pthread -relapack' failed for =sci-libs/openblas-0.3.20
    log has been saved as ./tatt/logs/sci-libs_openblas-0.3.20_use_JB6GI
USE='-dynamic -eselect-ldso index-64bit -openmp -pthread relapack' succeeded for =sci-libs/openblas-0.3.20
USE='-dynamic eselect-ldso -index-64bit openmp -pthread relapack' succeeded for =sci-libs/openblas-0.3.20
USE='dynamic -eselect-ldso index-64bit openmp -pthread relapack' failed for =sci-libs/openblas-0.3.20
    log has been saved as ./tatt/logs/sci-libs_openblas-0.3.20_use_64bv3
USE='-dynamic -eselect-ldso -index-64bit -openmp pthread relapack' succeeded for =sci-libs/openblas-0.3.20
USE='dynamic eselect-ldso -index-64bit -openmp pthread relapack' failed for =sci-libs/openblas-0.3.20
    log has been saved as ./tatt/logs/sci-libs_openblas-0.3.20_use_hQWq9
USE='dynamic -eselect-ldso index-64bit -openmp pthread relapack' failed for =sci-libs/openblas-0.3.20
    log has been saved as ./tatt/logs/sci-libs_openblas-0.3.20_use_nJh6D
USE='-dynamic eselect-ldso index-64bit -openmp pthread relapack' succeeded for =sci-libs/openblas-0.3.20
Comment 6 Larry the Git Cow gentoo-dev 2022-04-27 21:18:37 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47b90dedf06234195ea5eb701633396e0acb2687

commit 47b90dedf06234195ea5eb701633396e0acb2687
Author:     Han Gao <rabenda.cn@gmail.com>
AuthorDate: 2022-04-27 16:15:35 +0000
Commit:     Jakov Smolić <jsmolic@gentoo.org>
CommitDate: 2022-04-27 21:18:24 +0000

    sci-libs/openblas: fix riscv detect
    
    Bug: https://bugs.gentoo.org/837806
    Signed-off-by: Han Gao <rabenda.cn@gmail.com>
    Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>

 .../openblas/files/openblas-0.3.20-fix-riscv.patch | 116 +++++++++++++++++++++
 sci-libs/openblas/openblas-0.3.20.ebuild           |   1 +
 2 files changed, 117 insertions(+)