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

ERROR: libflite not found #157

Closed
4 tasks done
iiiyu opened this issue Mar 16, 2024 · 32 comments
Closed
4 tasks done

ERROR: libflite not found #157

iiiyu opened this issue Mar 16, 2024 · 32 comments

Comments

@iiiyu
Copy link

iiiyu commented Mar 16, 2024

Bug Reports

⚠️ This is for bug reports with the homebrew-ffmpeg tap only. Please do not file a bug report if your issue relates to any of the following:

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information.

  • I ran brew update and can still reproduce the problem
  • I ran brew doctor, fixed all issues and can still reproduce the problem
  • I ran brew config and brew doctor and included their output with my issue
  • I verified that this is an issue with this tap and not any other ffmpeg version

Expected behavior

Installed ffmpeg

Actual behavior

ERROR: libflite not found

Command

The exact command you were trying to run:

brew install homebrew-ffmpeg/ffmpeg/ffmpeg  --with-chromaprint --with-decklink --with-fdk-aac --with-libflite --with-game-music-emu --with-harfbuzz --with-jack --with-jpeg-xl --with-libaribb24 --with-libaribcaption --with-libmodplug --with-libopenmpt --with-librist --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rav1e --with-svt-av1 --with-rtmpdump --with-rubberband --with-two-lame --with-webp --with-xvid --with-zeromq --with-zimg --with-srt --with-libvmaf --with-libxml2 --with-libzvbi --with-aribb24 --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-openssl@1.1 --with-speex

The output that you got:

==> Fetching homebrew-ffmpeg/ffmpeg/ffmpeg
==> Downloading https://gitlab.archlinux.org/archlinux/packaging/packages/ffmpeg/-/raw/5670ccd86d3b816f49ebc18cab878125eca2f81f/add-av_stream_get_first_dts-for-chromium.patch
Already downloaded: /Users/ewan/Library/Caches/Homebrew/downloads/89c5a789bbb2e059f601e58af1ca10f4db2a1939f591f896a0240cb1cfb2b8bb--add-av_stream_get_first_dts-for-chromium.patch
==> Downloading https://ffmpeg.org/releases/ffmpeg-6.1.tar.xz
Already downloaded: /Users/ewan/Library/Caches/Homebrew/downloads/72000fb45f0a4770cb6969e20a1cddf8308fd2b264f46ac3e05fe493f9b79da6--ffmpeg-6.1.tar.xz
==> Reinstalling homebrew-ffmpeg/ffmpeg/ffmpeg --with-chromaprint --with-decklink --with-fdk-aac --with-libflite --with-game-music-emu --with-harfbuzz --with-jack --with-jpeg-xl --with-libaribb24 --with
==> Patching
==> Applying add-av_stream_get_first_dts-for-chromium.patch
patching file 'libavformat/avformat.h'
patching file 'libavformat/mux_utils.c'
==> ./configure --enable-shared --cc=clang --host-cflags= --host-ldflags=-Wl,-ld_classic --enable-gpl --enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora -
Last 15 lines from /Users/ewan/Library/Logs/Homebrew/ffmpeg/01.configure:
--extra-ldflags=-L/opt/homebrew/include
--enable-libjack
--enable-indev=jack
--enable-libzvbi
--enable-version3
--enable-libopencore-amrnb
--enable-libopencore-amrwb

ERROR: libflite not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues

Output of brew config and brew doctor commands

brew config:

HOMEBREW_VERSION: 4.2.12
ORIGIN: https://github.com/Homebrew/brew
HEAD: 780fbbc65e90fbe09629aba180a1839e9e7dbaf2
Last commit: 5 days ago
Core tap JSON: 16 Mar 12:15 UTC
Core cask tap JSON: 16 Mar 12:15 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.44.0 => /opt/homebrew/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.4-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.3
Rosetta 2: false

brew doctor:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  cloudflared
  openssl@1.1

Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
  brew install ffmpeg

Run `brew missing` for more details.
@retokromer
Copy link
Contributor

The exact command you were trying to run:

brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-chromaprint --with-decklink --with-fdk-aac --with-libflite --with-game-music-emu --with-harfbuzz --with-jack --with-jpeg-xl --with-libaribb24 --with-libaribcaption --with-libmodplug --with-libopenmpt --with-librist --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rav1e --with-svt-av1 --with-rtmpdump --with-rubberband --with-two-lame --with-webp --with-xvid --with-zeromq --with-zimg --with-srt --with-libvmaf --with-libxml2 --with-libzvbi --with-aribb24 --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-openssl@1.1 --with-speex

Why did you set --with-openssl@1.1?

@iiiyu
Copy link
Author

iiiyu commented Mar 17, 2024

The exact command you were trying to run:
brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-chromaprint --with-decklink --with-fdk-aac --with-libflite --with-game-music-emu --with-harfbuzz --with-jack --with-jpeg-xl --with-libaribb24 --with-libaribcaption --with-libmodplug --with-libopenmpt --with-librist --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rav1e --with-svt-av1 --with-rtmpdump --with-rubberband --with-two-lame --with-webp --with-xvid --with-zeromq --with-zimg --with-srt --with-libvmaf --with-libxml2 --with-libzvbi --with-aribb24 --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-openssl@1.1 --with-speex

Why did you set --with-openssl@1.1?

Hey @retokromer , thanks for your reply. Actually, I successfully installed it by deleting --with-libflite after I posted this issue. And why did I set --with-openssl@1.1? I'm not sure. I used brew options homebrew-ffmpeg/ffmpeg/ffmpeg --compact to get it. I believe I might have installed another tool that depends on openssl@1.1, so I have multiple versions of OpenSSL in my system.

Thanks again.

@iiiyu iiiyu closed this as completed Mar 17, 2024
@retokromer
Copy link
Contributor

Hello @iiiyu : you need to install Flite before running the FFmpeg formula, as indicated in the ReadMe, then it should work fine.

@iiiyu
Copy link
Author

iiiyu commented Mar 17, 2024

Hello @iiiyu : you need to install Flite before running the FFmpeg formula, as indicated in the ReadMe, then it should work fine.

I've been researching for three hours and I can't find a way to install it.

@iiiyu iiiyu reopened this Mar 17, 2024
@retokromer
Copy link
Contributor

If I remember carefully, it’s MacPorts.

@slhck
Copy link
Contributor

slhck commented Mar 18, 2024

I've found a guide here: https://stackoverflow.com/a/61189269/435093 — maybe this works?

@iiiyu
Copy link
Author

iiiyu commented Mar 18, 2024

I've found a guide here: https://stackoverflow.com/a/61189269/435093 — maybe this works?

Hey @slhck In fact, I have already compiled and installed it. But it doesn't seem to be working.
CleanShot 2024-03-18 at 22 47 11

If I remember carefully, it’s MacPorts.

So, it looks like I have to install MacPorts. To be honest, I don't want to install both Homebrew and MacPorts on my computer at the same time.

@slhck
Copy link
Contributor

slhck commented Mar 18, 2024

I have already compiled and installed it

It would be good if you could already provide more background on what you've tried and where you got stuck, to avoid us having to research things that you already know.

Regarding the specific problem, it looks like you already have the library compiled and installed but ffmpeg is not finding it. Per the error message, can you access ffbuild/config.log and show its contents?

So, it looks like I have to install MacPorts. To be honest, I don't want to install both Homebrew and MacPorts on my computer at the same time.

That makes sense. (I mean, not installing both.)

@retokromer
Copy link
Contributor

So, it looks like I have to install MacPorts. To be honest, I don't want to install both Homebrew and MacPorts on my computer at the same time.

As long as I know, there is no Homebrew formula for Flite.

@iiiyu
Copy link
Author

iiiyu commented Mar 18, 2024

I have already compiled and installed it

It would be good if you could already provide more background on what you've tried and where you got stuck, to avoid us having to research things that you already know.

Regarding the specific problem, it looks like you already have the library compiled and installed but ffmpeg is not finding it. Per the error message, can you access ffbuild/config.log and show its contents?

So, it looks like I have to install MacPorts. To be honest, I don't want to install both Homebrew and MacPorts on my computer at the same time.

That makes sense. (I mean, not installing both.)

Sure, I am glad to provide this log. Where can I find it? ffbuild/config.log

@retokromer
Copy link
Contributor

I am travelling at the moment. Next weekend I can check what I did, when I added the option. I used it last year with the students (more for fun rather than seriously).

@iiiyu
Copy link
Author

iiiyu commented Mar 18, 2024

I am travelling at the moment. Next weekend I can check what I did, when I added the option. I used it last year with the students (more for fun rather than seriously).

Please enjoy your travelling, I am really thankful for your reply. Actually, I just need fdk-aac at the moment. So, even if my ffmpeg is without libflite, I am good now.

@slhck
Copy link
Contributor

slhck commented Mar 18, 2024

I am afraid I don't know where it is stored exactly; I would expect it to be in the same directory as the last lines from the log: /Users/ewan/Library/Logs/Homebrew/ffmpeg

@iiiyu
Copy link
Author

iiiyu commented Mar 18, 2024

I am afraid I don't know where it is stored exactly; I would expect it to be in the same directory as the last lines from the log: /Users/ewan/Library/Logs/Homebrew/ffmpeg

config.log

I am not good with Clang. Could it be because /usr/local/lib isn’t included in the Clang path when ffmpeg is compiled?

@slhck
Copy link
Contributor

slhck commented Mar 19, 2024

So your Homebrew installation lives in /opt/homebrew (which is where it would typically be under Apple Silicon), and your flite installation is in /usr/local/lib which would be Homebrew's previous location (under x64). Indeed clang can't find the libraries and therefore fails.

Assuming the headers are in /usr/local/include, you should add -I/usr/local/include explicitly to the clang command. Homebrew does not do that on its own, see: https://github.com/orgs/Homebrew/discussions/868

Can you try with:

export CPPFLAGS=-I/usr/local/include"
brew install homebrew-ffmpeg/ffmpeg/ffmpeg  --with-chromaprint --with-decklink --with-fdk-aac --with-libflite --with-game-music-emu --with-harfbuzz --with-jack --with-jpeg-xl --with-libaribb24 --with-libaribcaption --with-libmodplug --with-libopenmpt --with-librist --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rav1e --with-svt-av1 --with-rtmpdump --with-rubberband --with-two-lame --with-webp --with-xvid --with-zeromq --with-zimg --with-srt --with-libvmaf --with-libxml2 --with-libzvbi --with-aribb24 --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-openssl@1.1 --with-speex

@iiiyu
Copy link
Author

iiiyu commented Mar 19, 2024

So your Homebrew installation lives in /opt/homebrew (which is where it would typically be under Apple Silicon), and your flite installation is in /usr/local/lib which would be Homebrew's previous location (under x64). Indeed clang can't find the libraries and therefore fails.

Assuming the headers are in /usr/local/include, you should add -I/usr/local/include explicitly to the clang command. Homebrew does not do that on its own, see: https://github.com/orgs/Homebrew/discussions/868

Can you try with:

export CPPFLAGS=-I/usr/local/include"
brew install homebrew-ffmpeg/ffmpeg/ffmpeg  --with-chromaprint --with-decklink --with-fdk-aac --with-libflite --with-game-music-emu --with-harfbuzz --with-jack --with-jpeg-xl --with-libaribb24 --with-libaribcaption --with-libmodplug --with-libopenmpt --with-librist --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rav1e --with-svt-av1 --with-rtmpdump --with-rubberband --with-two-lame --with-webp --with-xvid --with-zeromq --with-zimg --with-srt --with-libvmaf --with-libxml2 --with-libzvbi --with-aribb24 --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-openssl@1.1 --with-speex

I try

export CPPFLAGS=-I/usr/local/include"

It doesn’t work. but you inspired me.

Then I tried this

ln -s /usr/local/lib/libflite* /opt/homebrew/lib/
ln -s /usr/local/include/flite /opt/homebrew/include/flite
brew reinstall homebrew-ffmpeg/ffmpeg/ffmpeg --with-chromaprint --with-decklink --with-fdk-aac --with-libflite --with-game-music-emu --with-harfbuzz --with-jack --with-jpeg-xl --with-libaribb24 --with-libaribcaption --with-libmodplug --with-libopenmpt --with-librist --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rav1e --with-svt-av1 --with-rtmpdump --with-rubberband --with-two-lame --with-webp --with-xvid --with-zeromq --with-zimg --with-srt --with-libvmaf --with-libxml2 --with-libzvbi --with-aribb24 --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-openssl@1.1 --with-speex

and I reinstalled it successfully.

So, I am summarizing how to install FFmpeg on Apple Silicon.

  1. Install Flite
git clone https://github.com/festvox/flite.git
cd flite/
./configure
make
sudo make install
  1. Make there are links.
ln -s /usr/local/lib/libflite* /opt/homebrew/lib/
ln -s /usr/local/include/flite /opt/homebrew/include/flite
  1. Follow Readme
brew install homebrew-ffmpeg/ffmpeg/ffmpeg $(brew options homebrew-ffmpeg/ffmpeg/ffmpeg --compact)

It works for me.

@slhck
Copy link
Contributor

slhck commented Mar 19, 2024

Glad you got it solved. It's certainly not the cleanest solution, and I thought passing the CPPFLAGS would work, but having a symlink in place is surely also works. It's just that if you ever decide to update flite you would need to modify/update the symlinks.

@iiiyu
Copy link
Author

iiiyu commented Mar 19, 2024

Is it possible to update here

args << "--extra-cflags=-I#{HOMEBREW_PREFIX}/include"
args << "--extra-ldflags=-L#{HOMEBREW_PREFIX}/include"

like

--extra-ldflags=-L/first/path -L/second/path -L/opt/homebrew/include

maybe. I am not sure.

@slhck
Copy link
Contributor

slhck commented Mar 19, 2024

No, because we would not want to hardcode other paths into a Formula. What if you wanted to install flite somewhere else? That's where the environment variables would come into play, by passing in the extra include paths to the compiler. I am not sure why they are not working though.

@iiiyu
Copy link
Author

iiiyu commented Mar 19, 2024

No, because we would not want to hardcode other paths into a Formula. What if you wanted to install flite somewhere else? That's where the environment variables would come into play, by passing in the extra include paths to the compiler. I am not sure why they are not working though.

You are right, forget about my dirty solution.

@exekutive
Copy link

exekutive commented Mar 27, 2024

If I remember carefully, it’s MacPorts.

You have tested this? If so I'd love to know how you run both package managers concurrently on a system without conflict, and how you pursuaded HB to use MP packages (or any non-HB packages) as dependencies because HB is definitely not designed to work that way out of the box.

@retokromer
Copy link
Contributor

You have tested this?

Indeed, my students did it last year. The path issue has already been discussed earlier in this thread. This was just meant as a quick and dirty solution. Yet if this year they are still interested in experimenting text to speech synthesis, then they should compile Flite manually. Note that writing the corresponding Homebrew formula would non be difficult.

@exekutive
Copy link

I don't think so. Maybe when your students tried, there was a hombrew core formula for flite.
As things are now, the option cannot work as advertised, and certainly not without modification.

the --with-libflite option should be removed from the formula

@retokromer
Copy link
Contributor

Maybe when your students tried, there was a hombrew core formula for flite.

No, there wasn’t.

the --with-libflite option should be removed from the formula

Why? It was included as option to FFmpeg twelve years ago. I added it here after my last year’s course and I am not going to remove it. You are completely free not to use it.

@exekutive
Copy link

Because HB does not support non-HB dependencies, thus this is a broken formula.
And because issues like this one exist, and you will get more, since this repository is being suggested all over the internet as solution to the complaints about HB removing options. ffmpeg is a very popular tool. The issue was discussed but not really resolved.
Removing it is simply the right thing to do.

@slhck
Copy link
Contributor

slhck commented Mar 28, 2024

There is a solution that involves creating a symlink.

I will check if it's possible to link against non-Homebrew libraries that are installed locally. The flag I suggested does not seem to be the right one.

So the option works, but requires some manual changes. In any case the user has to compile the dependency manually. I am against removing the option.

@retokromer
Copy link
Contributor

Removing it is simply the right thing to do.

No, not at all: it’s part of the official FFmpeg, and we wish to include the option in our Homebrew formula as well. As said, our formula works in different ways, one of them was described in detail above.

Why do you not write a Homebrew formula for Flite? Here in this repository that is out of scope.

@exekutive
Copy link

exekutive commented Mar 28, 2024

I will check if it's possible to link against non-Homebrew libraries

It's not supported, but sure, check. The rest of us understand that you cannot maintain a functioning, up-to-date, dependency hierarchy when you start mixing in unmanaged packages.

There is a solution that involves creating a symlink.

monkeying with homebrew and breaking the mechanics is a hack. Not a solution

@exekutive
Copy link

Why do you not write a Homebrew formula for Flite?

I am not a maintainer for flite or homebrew core

@slhck
Copy link
Contributor

slhck commented Mar 29, 2024

Why do you not write a Homebrew formula for Flite?

I am not a maintainer for flite or homebrew core

You have to be neither to do that. Anyone can provide a formula.

@slhck
Copy link
Contributor

slhck commented Mar 29, 2024

I will check if it's possible to link against non-Homebrew libraries

It's not supported, but sure, check. The rest of us understand that you cannot maintain a functioning, up-to-date, dependency hierarchy when you start mixing in unmanaged packages.

There is a solution that involves creating a symlink.

monkeying with homebrew and breaking the mechanics is a hack. Not a solution

As said, there is a solution that I'm well aware of is not a reliable one. Please take this kind of demeaning and snarky attitude somewhere else. You're free to not use this option if it doesn't work for you.

@retokromer
Copy link
Contributor

You're free to not use this option if it doesn't work for you.

Indeed, I already said it above.

@homebrew-ffmpeg homebrew-ffmpeg locked as too heated and limited conversation to collaborators Mar 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants