From: Maxime Devos <maximedevos@telenet.be>
To: Nicolas Graves <ngraves@ngraves.fr>, 57954@debbugs.gnu.org
Subject: [bug#57954] Some details about why and see if there is no other solution.
Date: Thu, 22 Sep 2022 17:48:32 +0200 [thread overview]
Message-ID: <a3646d18-71ee-28e9-8f44-2dea104c558b@telenet.be> (raw)
In-Reply-To: <87wn9ykxrn.fsf@ngraves.fr>
[-- Attachment #1.1.1: Type: text/plain, Size: 2298 bytes --]
On 20-09-2022 14:58, Nicolas Graves via Guix-patches via wrote:
>
> I am trying to get a vosk package to work for guix.
> The build process is a bit tricky with replaced dependencies etc.
>
> The team from vosk uses a version where they replace fortran by having
> both openblas and clapack in libraries (which is incompatible in the
> base kaldi configuration, so they have their own fork).
>
> I don't know why exactly the library should be called from another
> place, but when compiling kaldi with clapack, I get the following
> message (and siblings):
>
> ld: /gnu/store/yvc2w9mg554y6i4frvahjhacj0np9c7s-clapack-3.2.1/lib/liblapack.a(ssptrf.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
>
> I actually does work when recompiling with this flag, but I've also read
> that it might make the package a bit slower.
>
> In case it might help to answer, here's where I am for this package,
> although not done yet (I still do have to untangle some ffi segmentation
> fault issue) :
> https://git.sr.ht/~ngraves/dotfiles/tree/main/item/packages/vosk.scm
>
> What is the best option / course of action ?
'kaldi' is compiled as a shared library. However, going by the error
message, it is linked to the (static!) clapack. IIUC, this is not a
problem per se (the static library would be embedded into the shared
library IIUC) -- however, shared libraries must be position-independent,
whereas static libraries aren't by default.
As such, there appear to be three potential solutions:
* compile the static library as -fPIC (your patch)
* let kaldi link to a shared clapack (which is -fPIC by default)
* let 'kaldi' (and its dependent, vosk) be a static library instead
of a shared library. Is likely problematic due to 'python-vosk'
though.
Both 'real' solutions have -fPIC (explicit or implied), so I don't think
we have to worry about performance. My default option for deciding
between static and shared is 'shared' (makes 'clapack' graftable, and
better interaction with "guix build --repair" and "guix gc --references").
Hence, my proposed (and untested) solution is to make 'kaldi' link to a
shared clapack.
Greetings,
Maxime.
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
next prev parent reply other threads:[~2022-09-22 16:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 12:40 [bug#57954] [PATCH] gnu: clapack: Use position-independent code for use as a library Nicolas Graves via Guix-patches via
2022-09-20 12:58 ` [bug#57954] Some details about why and see if there is no other solution Nicolas Graves via Guix-patches via
2022-09-22 15:48 ` Maxime Devos [this message]
2022-09-24 8:37 ` Nicolas Graves via Guix-patches via
2022-09-24 9:46 ` Maxime Devos
2022-09-28 12:19 ` bug#57954: " Nicolas Graves via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a3646d18-71ee-28e9-8f44-2dea104c558b@telenet.be \
--to=maximedevos@telenet.be \
--cc=57954@debbugs.gnu.org \
--cc=ngraves@ngraves.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).