kaldi-asr / kaldi

kaldi-asr/kaldi is the official location of the Kaldi project.
http://kaldi-asr.org
Other
14.11k stars 5.31k forks source link

openfst fails to compile on i686 #4808

Closed johngebbie closed 1 year ago

johngebbie commented 1 year ago

Hello, I'm trying to package my program which uses Vosk which is built upon Kaldi. I also need to package openfst which is what is giving me trouble.

Openfst compiles just fine on my x86_64 machine, and even cross compiling to i686, but a test fails in the continuous integration when compiling i686 natively.

It is the float equality from the ./configure file which runs during the install phase (it's run again during the check phase).

This is the output of the build system:

configure: error: Test float equality failed! Compile with -msse -mfpmath=sse if using g++.
See `config.log' for more details
=> ERROR: vosk-api-0.3.43_1: pre_build: './configure --host="${XBPS_TRIPLET}" ${CROSS_BUILD:+--host="${XBPS_CROSS_TRIPLET}"} --build="${XBPS_TRIPLET}" --prefix="${wrksrc}/kaldi-${_kaldi_commit}/tools/openfst" --enable-static --enable-shared --enable-far --enable-ngram-fsts --enable-lookahead-fsts --with-pic --disable-bin' exited with 1
=> ERROR:   in pre_build() at srcpkgs/vosk-api/template:57

I have tried adding the options it suggests and some, but I get the same error.

I think it passes when cross compiling because it's actually testing my x86_64. That said, I'm concerned about the underlying float equality issue on i686, even if I skip the test when cross compiling.

I asked the Vosk developer here but didn't get anywhere: https://github.com/alphacep/vosk-api/issues/1161

This is my build template for Void Linux: https://github.com/void-linux/void-packages/pull/39015

This is someone elses build template for Alpine Linux: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/41097 I see they have had the same issue and limited the architectures to 64 bit.

I will only target 64 bit architectures if necessary, but I'd be shame, my program seems to work well on my old i686 laptop when cross compiled.

Any thoughts? Is this a build issue or are 32 bit architectures not supported?

Thank you. Sorry this is more an openfst issue than a kaldi one but I saw you had accepted similar issues, and openfst doesn't seem to have a good place for issues.

nshmyrev commented 1 year ago

As we discussed in the issue you linked, you can build for 32-bit but you need to cross-compile. And you need to disable runtime checks.

johngebbie commented 1 year ago

Sorry @nshmyrev, I was unsure because you said it was a technical limitation of memory space, but it does compile natively on i686 as long as I remove the float equality tests. Do you think it's safe to patch out the float equality tests so it compiles natively?

Only cross-compiling does not seem to be a template option in the xbps-src build system, and precompiled binaries are not accepted.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale by a bot solely because it has not had recent activity. Please add any comment (simply 'ping' is enough) to prevent the issue from being closed for 60 more days if you believe it should be kept open.

johngebbie commented 1 year ago

ping. Because of this the void linux and the upcoming alipine packages of vosk and numen are limited to x86_64 and aarch64.

jtrmal commented 1 year ago

yes, i think the float equality test can be removed y.

On Wed, Jan 25, 2023 at 10:37 AM JohnGebbie @.***> wrote:

ping. Because of this the void linux and the upcoming alipine packages of vosk and numen https://numenvoice.com are limited to x86_64 and aarch64.

— Reply to this email directly, view it on GitHub https://github.com/kaldi-asr/kaldi/issues/4808#issuecomment-1403331021, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUKYX4YC2AEXQYWNBNATHLWUDX47ANCNFSM6AAAAAASAZY46M . You are receiving this because you are subscribed to this thread.Message ID: @.***>