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

macOS dependency install #305

Open
itsjamie opened this issue Sep 22, 2023 · 4 comments
Open

macOS dependency install #305

itsjamie opened this issue Sep 22, 2023 · 4 comments

Comments

@itsjamie
Copy link

OS/arch: macOS 13.5.2 / arm64

Install command: pip wheel --use-pep517 "aeneas (==1.7.3.0)"

I have a build where aeneas is used as a dependency for a project, and my system does have espeak installed via homebrew as recommended in the setup warning that is printed. It failed to install via the tooling in my project (Poetry) and gave the command above as a method of testing it outside of any of its own tooling as a method of testing.

Looking at the output log. The library is not found. I believe this is because the clang command does not contain the -L/opt/homebrew/lib, indicating that it should look in that path for libraries.

I'm going to attempt just modifying my ld path and try again, but given you advise users to install via homebrew, do you think adding it makes sense?

clang -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk build/temp.macosx-13-arm64-cpython-311/aeneas/cew/cew_func.o build/temp.macosx-13-arm64-cpython-311/aeneas/cew/cew_py.o -lespeak -o build/lib.macosx-13-arm64-cpython-311/aeneas/cew/cew.cpython-311-darwin.so
      ld: library not found for -lespeak
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      error: Command "clang -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk build/temp.macosx-13-arm64-cpython-311/aeneas/cew/cew_func.o build/temp.macosx-13-arm64-cpython-311/aeneas/cew/cew_py.o -lespeak -o build/lib.macosx-13-arm64-cpython-311/aeneas/cew/cew.cpython-311-darwin.so" failed with exit status 1
@itsjamie
Copy link
Author

Setting LIBRARY_PATH=/opt/homebrew/lib pip wheel --use-pep517 "aeneas (==1.7.3.0)" worked to compile in my scenario.

It looks like it would have worked on Intel Macs as the default install directory for Homebrew was /usr/local/lib which is in the default lookup path.

On the M1 mac, the default install directory is now /opt/homebrew/lib, which is notably, not in the default search path.

So, for the build to work automatically on the M1 variant, with the current instructions you would need to add -L/opt/homebrew/lib if the expectation is that espeak is installed via homebrew prior.

@ezekiel747
Copy link

So, for the build to work automatically on the M1 variant, with the current instructions you would need to add -L/opt/homebrew/lib if the expectation is that espeak is installed via homebrew prior.

Could you please be more specific: where exactly should this option be used: -L/opt/homebrew/lib ?

@pimgeek
Copy link

pimgeek commented May 22, 2024

After an hour's trial-and-error, I finally know how to tell pip how to find espeak library, using the following command:

AENEAS_WITH_CEW=True; LIBRARY_PATH=/opt/homebrew/lib pip install aeneas

and the diagnosis shows that cew is enabled

$ python -m aeneas.diagnostics

[INFO] ffprobe        OK
[INFO] ffmpeg         OK
[INFO] espeak         OK
[INFO] aeneas.tools   OK
[WARN] shell encoding WARNING
[WARN]   The default input encoding of your shell is not UTF-8
[WARN]   The default output encoding of your shell is not UTF-8
[INFO]   If you plan to use aeneas on the command line,
[INFO]   you might want to 'export PYTHONIOENCODING=UTF-8' in your shell
[INFO] aeneas.cdtw    AVAILABLE
[INFO] aeneas.cmfcc   AVAILABLE
[INFO] aeneas.cew     AVAILABLE
[INFO] All required dependencies are met and all available Python C extensions are working

Could you please be more specific: where exactly should this option be used: -L/opt/homebrew/lib ?

@TanishSurana
Copy link

After an hour's trial-and-error, I finally know how to tell pip how to find espeak library, using the following command:

AENEAS_WITH_CEW=True; LIBRARY_PATH=/opt/homebrew/lib pip install aeneas

and the diagnosis shows that cew is enabled

$ python -m aeneas.diagnostics

[INFO] ffprobe        OK
[INFO] ffmpeg         OK
[INFO] espeak         OK
[INFO] aeneas.tools   OK
[WARN] shell encoding WARNING
[WARN]   The default input encoding of your shell is not UTF-8
[WARN]   The default output encoding of your shell is not UTF-8
[INFO]   If you plan to use aeneas on the command line,
[INFO]   you might want to 'export PYTHONIOENCODING=UTF-8' in your shell
[INFO] aeneas.cdtw    AVAILABLE
[INFO] aeneas.cmfcc   AVAILABLE
[INFO] aeneas.cew     AVAILABLE
[INFO] All required dependencies are met and all available Python C extensions are working

Could you please be more specific: where exactly should this option be used: -L/opt/homebrew/lib ?

WORKED, thank you our lord and saviour.

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

No branches or pull requests

4 participants