Skip to content
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

Failed to install praat-parselmouth #508

Open
emmanuel3wa opened this issue Jun 21, 2021 · 16 comments · May be fixed by #961
Open

Failed to install praat-parselmouth #508

emmanuel3wa opened this issue Jun 21, 2021 · 16 comments · May be fixed by #961
Labels

Comments

@emmanuel3wa
Copy link

emmanuel3wa commented Jun 21, 2021

Hello everyone

I will need to use a python script using the imports below.

import parselmouth from parselmouth.praat import call

I first use the code :
python { pip { install "parselmouth" } }

Then i understand that parselmouth is not in the list of possible imports by chaquopy that I found at this address :

https://chaquo.com/pypi-7.0/

Do you have a solution to help me solve this problem?

Thank you in advance for the attention paid to my request.

@mhsmith
Copy link
Member

mhsmith commented Jun 21, 2021

Thanks for the report. I assume you mean praat-parselmouth the phonetics library, and not parselmouth the ad services library. This package isn't currently a priority, but I'll update this issue if we add it in the future. And if anyone else wants it too, please click the thumbs-up button above.

@mhsmith mhsmith changed the title Failed to install parselmouth Failed to install praat-parselmouth Jun 21, 2021
@mhsmith
Copy link
Member

mhsmith commented Feb 2, 2023

The package build tool is now open-source, so if you'd like to try building this package yourself, follow the instructions here. And if you're successful, please make a pull request so we can add the package to the public repository.

@moariyenkhuien
Copy link

hello, i really need use praat-parselmouth and i was unable to build this package with the build tool that you developed.
i will be so grateful if you build this package and add it to the public repo.

@mhsmith
Copy link
Member

mhsmith commented Sep 13, 2023

i was unable to build this package with the build tool that you developed.

Please post the error message.

@moariyenkhuien
Copy link

when package is building with cmake i get this error:

../../../praat/sys/sendpraat.c:49:11: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
^~~~~~~~~~~~
1 error generated.

@mhsmith
Copy link
Member

mhsmith commented Sep 13, 2023

OK, please create a fork of this repository and push your meta.yaml file along with any patches, then post the link here.

@moariyenkhuien
Copy link

moariyenkhuien commented Sep 13, 2023

i didnt make any patches just the meta.yaml file

link

@mhsmith
Copy link
Member

mhsmith commented Sep 13, 2023

There's no way that file could work, because there's no such thing as numpy 23.5. Please push the actual file that produced your problem.

And make sure you're using the current version of the build tool, because it's had some fixes in the last few days.

@mhsmith mhsmith linked a pull request Sep 13, 2023 that will close this issue
@mhsmith
Copy link
Member

mhsmith commented Sep 13, 2023

OK, I've reproduced your error with the recipe in #961:

[1020/1428] Building C object praat/CMakeFiles/praat.dir/sys/sendpraat.c.o
FAILED: praat/CMakeFiles/praat.dir/sys/sendpraat.c.o   
/home/smith/git/chaquo/chaquopy/server/pypi/packages/praat-parselmouth/build/0.4.2/cp38-cp38-android_21_arm64_v8a/wrappers/aarch64-linux-android21-clang -DFMT_LOCALE -DNO_AUDIO -DNO_GRAPHICS -DNO_GUI -DNO_NETWORK -DPLATFORM_POSIX
 -DUNIX -D_FILE_OFFSET_BITS=64 -Dlinux -I../../../praat/external/clapack -I../../../praat/external/gsl -I../../../praat/external/glpk -I../../../praat/external/mp3 -I../../../praat/external/flac -I../../../praat/external/portaudi
o -I../../../praat/external/espeak -I../../../praat/external/vorbis -I../../../praat/external/opusfile -I../../../praat/kar -I../../../praat/melder -I../../../praat/sys -I../../../praat/dwsys -I../../../praat/stat -I../../../praa
t/fon -I../../../praat/dwtools -I../../../praat/LPC -I../../../praat/EEG -I../../../praat/gram -I../../../praat/FFNet -I../../../praat/artsynth -I../../../praat/external/opusfile/opus -I../../../praat/external/opusfile/opus/celt 
-I../../../praat/external/opusfile/opus/silk -I../../../praat/external/opusfile/opus/silk/float -I../../../extern/fmt/include -I/home/smith/git/chaquo/chaquopy/server/pypi/packages/praat-parselmouth/build/0.4.2/cp38-cp38-android_
21_arm64_v8a/requirements/chaquopy/include -idirafter /home/smith/git/chaquo/chaquopy/server/pypi/packages/praat-parselmouth/build/0.4.2/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/include/python3.8 -O3 -DNDEBUG -fPIC -f
visibility=hidden -pthread -Wno-trigraphs -Wno-logical-op-parentheses -Wno-shift-op-parentheses -std=gnu99 -MD -MT praat/CMakeFiles/praat.dir/sys/sendpraat.c.o -MF praat/CMakeFiles/praat.dir/sys/sendpraat.c.o.d -o praat/CMakeFile
s/praat.dir/sys/sendpraat.c.o -c ../../../praat/sys/sendpraat.c
../../../praat/sys/sendpraat.c:49:11: fatal error: 'X11/Xlib.h' file not found
        #include <X11/Xlib.h>
                 ^~~~~~~~~~~~

I don't have time to look into this any further, but obviously there will be no X11 support on Android. So the first question to ask is whether X11 is a core part of this package's functionality, or if it's only included conditionally. If it is conditional, see if you can work out where that condition is being determined, and how it can be fixed to disable the X11 feature.

Separately, the build failed on armeabi-v7a because of a missing ftello symbol. This is probably caused by an incorrect definition of _FILE_OFFSET_BITS, which you can find examples of in the patches of other recipes. Although it may be possible to fix many of these packages at once by editing build-common.sh to add -D_FILE_OFFSET_BITS=32 to the CFLAGS on the 32-bit ABIs.

@moariyenkhuien
Copy link

is there any chance that you build this package in future?

@mhsmith
Copy link
Member

mhsmith commented Sep 17, 2023

Only if someone provides a working recipe in a PR, but I don't have time to create one myself. See #961 for a starting point.

@boomboompsh
Copy link

boomboompsh commented Aug 20, 2024

I will continue this thread with what I have managed to do. Turns out you can just comment out the line "#include <X11/Xlib.h>" the code doesn't actually use Xlib if it is compiled with the nogui oprion, which it is. Of course then I ran into an issue with linking, it wasn't linking the python library, so I changed this line in setup.py:
cmake_args=shlex.split(os.environ.get('PARSELMOUTH_EXTRA_CMAKE_ARGS', ' "')),
to:
cmake_args=shlex.split(os.environ.get('PARSELMOUTH_EXTRA_CMAKE_ARGS', '-DCMAKE_CXX_STANDARD_LIBRARIES="-L/home/boomboompsh/chaquopy/server/pypi/packages/praat-parselmouth/build/0.4.2/cp38-cp38-android_21_arm64_v8a/requirements/chaquopy/lib/ -lpython3.8"')),

After fixing that there was an error that I fixed by changing line 190 of praat-parselmouth/build/0.4.2/cp38-cp38-android_21_arm64_v8a/env/lib/python3.8/site-packages/skbuild/utils/init.py from
old_threshold = distutils_log._global_log.threshold
to
old_threshold = distutils_log._global_log.level

haven't actually tested to see if it works yet, but at least all the compile time errors are gone. I can't figure out how to turn this into a recipe, I've just been doing manual modifications to the files

@boomboompsh
Copy link

Can confirm the wheel does actually work. I 'll slowly work on figuring out how patches are supposed to be made and PR my horrible hacky solution

@mhsmith
Copy link
Member

mhsmith commented Aug 27, 2024

To make a patch, see "If any changes are needed to make the build work" in the README. Patch files can be created with the diff tool.

@kerberjg
Copy link

Can be also fixed by installing the libx11-dev package! (if you're running Debian/Ubuntu, will be called something else on other distros).

It doesn't have too many dependencies and it's a very painless solution

@mhsmith
Copy link
Member

mhsmith commented Sep 26, 2024

That's unlikely to help, because there is no X11 support on Android. Even if you could compile it, you wouldn't be able to link it, and even if you could link it, you wouldn't be able to run it.

To work on Android, packages which depend on X11 will have to be configured or modified to removed the dependency.

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

Successfully merging a pull request may close this issue.

5 participants