Building with FFMPEG - LIBSNDFILE not available
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.
Mac 0S X 10.3 and earlier are no longer supported but you can download legacy versions of Audacity for those systems HERE.
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.
Mac 0S X 10.3 and earlier are no longer supported but you can download legacy versions of Audacity for those systems HERE.
Building with FFMPEG - LIBSNDFILE not available
I'm trying to build audacity-src-1.3.6 on a PowerMac G4 OS X 10.4.11 with FFMPEG, following the instructions from Josh24 in the thread
http://forum.audacityteam.org/viewtopic ... 157#p29157
I first downloaded and built:
pkg-config-0.23
wxMac-2.8.9
faac
faad
ffmpeg-export-2008-12-11
gettext-0.17
libtool-2.2.6
libsndfile-1.0.17
All were installed using their default locations. The configure command I'm using is:
./configure --with-libsamplerate --with-libresample=no --without-soundtouch --with-libmad --without-libvamp --without-redland --without-slv2 --without-liblrdf --without-midi --without-libscorealign --disable-nyquist --with-ffmpeg=system --with-libsndfile=system --with-libflac=system --with-libid3tag=system --with-libtwolame=system --disable-unicode
This results in the following error:
configure: error: You requested using the system libraries for LIBSNDFILE but they are not available
Anyone have an idea of where I went wrong?
http://forum.audacityteam.org/viewtopic ... 157#p29157
I first downloaded and built:
pkg-config-0.23
wxMac-2.8.9
faac
faad
ffmpeg-export-2008-12-11
gettext-0.17
libtool-2.2.6
libsndfile-1.0.17
All were installed using their default locations. The configure command I'm using is:
./configure --with-libsamplerate --with-libresample=no --without-soundtouch --with-libmad --without-libvamp --without-redland --without-slv2 --without-liblrdf --without-midi --without-libscorealign --disable-nyquist --with-ffmpeg=system --with-libsndfile=system --with-libflac=system --with-libid3tag=system --with-libtwolame=system --disable-unicode
This results in the following error:
configure: error: You requested using the system libraries for LIBSNDFILE but they are not available
Anyone have an idea of where I went wrong?
Last edited by Gale Andrews on Thu Apr 28, 2016 3:50 pm, edited 1 time in total.
Reason: fixed internal URL
Reason: fixed internal URL
Re: Building with FFMPEG - LIBSNDFILE not available
I finally figured out what I needed to do to fix this. I created a PKG_CONFIG_PATH environment variable and set it to /usr/local/lib/pkgconfig
The configure got further, but then indicated that expat was required. I installed expat-2.0.1 along with libmad-0.15.1b and libid3tag-0.15.1b and it finally completed without error. However, libmad ends up being disabled as it cannot find it. Hmmm.
Is it not used if libid3tag is installed?
The configure got further, but then indicated that expat was required. I installed expat-2.0.1 along with libmad-0.15.1b and libid3tag-0.15.1b and it finally completed without error. However, libmad ends up being disabled as it cannot find it. Hmmm.
Is it not used if libid3tag is installed?
-
kozikowski
- Forum Staff
- Posts: 68902
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Building with FFMPEG - LIBSNDFILE not available
Even though you're doing all this in Mac-land and thus posting in the right place, you're so far above the abilities of the helpers and everybody else that you should probably post on one of our Linux forums. They will be far better to answer questions about cfg-path-lib-pkg files and compiling techniques.
Koz
Koz
Re: Building with FFMPEG - LIBSNDFILE not available
Unfortunately the Linux forums are generally a bit quiet - we could do with a Linux guru as a regular forum contributor, but we don't seem to have one at the moment.kozikowski wrote:you should probably post on one of our Linux forums. They will be far better to answer questions about cfg-path-lib-pkg files and compiling techniques.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Building with FFMPEG - LIBSNDFILE not available
Dr G-
Sounds like you almost got it down. I seem to recall libmad misbehaved also, as in building and installing it did not result in a corresponding .pc file in usr/local/lib/pkgconfig. So I made one. Duplicate an existing one, like ogg.pc or sndfile.pc, rename it mad.pc, and edit it to replace every instance of "ogg" with "mad".I left Requires and Conflicts blank, Description: mad is a library for decoding mp3 bitstreams. and Libs: -L${libdir} -lmad. No dependency between lib mad and libid3tag. Don't know why you needed expat, it is in lib-src from CVS,but I didn't declare it explicitly and it didn't get built so default OSX expat functions got used.
If you installed pgkconfig first and have /usr/local/bin in your $PATH, you shouldn't have needed to declare a env var for the path. Read your config.log -- configure:5134: checking for pkg-config etc.
I ended up with a 10.6 MB Audacity app after building all the optional libs in system, the cool thing is now, for instance, I went back and rebuilt ffmpeg and enabled faad,c, and amr , and didn't have to recompile Audacity to use the new functionality. That was my whole point in building this way, so now when say libvorbis releases it's new version, I update one library and inherit the latest in one quick build.
Keep us posted.
Josh
Sounds like you almost got it down. I seem to recall libmad misbehaved also, as in building and installing it did not result in a corresponding .pc file in usr/local/lib/pkgconfig. So I made one. Duplicate an existing one, like ogg.pc or sndfile.pc, rename it mad.pc, and edit it to replace every instance of "ogg" with "mad".I left Requires and Conflicts blank, Description: mad is a library for decoding mp3 bitstreams. and Libs: -L${libdir} -lmad. No dependency between lib mad and libid3tag. Don't know why you needed expat, it is in lib-src from CVS,but I didn't declare it explicitly and it didn't get built so default OSX expat functions got used.
If you installed pgkconfig first and have /usr/local/bin in your $PATH, you shouldn't have needed to declare a env var for the path. Read your config.log -- configure:5134: checking for pkg-config etc.
I ended up with a 10.6 MB Audacity app after building all the optional libs in system, the cool thing is now, for instance, I went back and rebuilt ffmpeg and enabled faad,c, and amr , and didn't have to recompile Audacity to use the new functionality. That was my whole point in building this way, so now when say libvorbis releases it's new version, I update one library and inherit the latest in one quick build.
Keep us posted.
Josh
Re: Building with FFMPEG - LIBSNDFILE not available
Thanks for the mad.pc tip Josh. That worked.
I did install pkg-config before everything else and I do have /usr/local/bin in my $PATH before any other system directories, but without the PKG_CONFIG_PATH environment var, configure doesn't see LIBSNDFILE. Not sure why. I did check the config.log. Thats where I saw the suggestion about PKG_CONFIG_PATH.
Now when I try to make audacity (Audacity 1.3.6 release (source tarball)), I get the following error compiling importFFmpeg:
g++ -c -I../lib-src/portmixer/include -I../lib-src/portaudio-v19/include -I../mac -Wall -I/usr/local/lib/wx/include/mac-ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXMAC__ -I../lib-src/FileDialog -Wall -I/Users/rich/Desktop/audacity-src-1.3.6/lib-src/lib-widget-extra -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -fno-strict-aliasing -I./include -I. -DLIBDIR="/usr/local//lib" -Wall -include AudacityHeaders.h import/ImportFFmpeg.cpp -o import/ImportFFmpeg.o
import/ImportFFmpeg.cpp:516: error: integer constant is too large for 'long' type
import/ImportFFmpeg.cpp: In member function 'virtual int FFmpegImportFileHandle::Import(TrackFactory*, Track***, int*, Tags*)':
import/ImportFFmpeg.cpp:516: error: 'INT64_C' was not declared in this scope
import/ImportFFmpeg.cpp:519: warning: format '%d' expects type 'int', but argument 3 has type 'int64_t'
make[1]: *** [import/ImportFFmpeg.o] Error 1
make[1]: Leaving directory `/Users/rich/Desktop/audacity-src-1.3.6/src'
make: *** [audacity] Error 2
I did install pkg-config before everything else and I do have /usr/local/bin in my $PATH before any other system directories, but without the PKG_CONFIG_PATH environment var, configure doesn't see LIBSNDFILE. Not sure why. I did check the config.log. Thats where I saw the suggestion about PKG_CONFIG_PATH.
Now when I try to make audacity (Audacity 1.3.6 release (source tarball)), I get the following error compiling importFFmpeg:
g++ -c -I../lib-src/portmixer/include -I../lib-src/portaudio-v19/include -I../mac -Wall -I/usr/local/lib/wx/include/mac-ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXMAC__ -I../lib-src/FileDialog -Wall -I/Users/rich/Desktop/audacity-src-1.3.6/lib-src/lib-widget-extra -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -fno-strict-aliasing -I./include -I. -DLIBDIR="/usr/local//lib" -Wall -include AudacityHeaders.h import/ImportFFmpeg.cpp -o import/ImportFFmpeg.o
import/ImportFFmpeg.cpp:516: error: integer constant is too large for 'long' type
import/ImportFFmpeg.cpp: In member function 'virtual int FFmpegImportFileHandle::Import(TrackFactory*, Track***, int*, Tags*)':
import/ImportFFmpeg.cpp:516: error: 'INT64_C' was not declared in this scope
import/ImportFFmpeg.cpp:519: warning: format '%d' expects type 'int', but argument 3 has type 'int64_t'
make[1]: *** [import/ImportFFmpeg.o] Error 1
make[1]: Leaving directory `/Users/rich/Desktop/audacity-src-1.3.6/src'
make: *** [audacity] Error 2
Re: Building with FFMPEG - LIBSNDFILE not available
Well that's not very exciting, I know that error more than I care to remember. Read the thread in Aud-dev on Nabble that I had with Richard. http://n2.nabble.com/FFMpeg-in-1.3.6-Ma ... 19110.html
BTW, you were right about libsndfile, I had forgotten that I ended up doing that too, just like it said at the end of the make. I guess some libraries don't implement pkg-config right. Go figure, for that matter, look at Audacity configure output, it says
"checking pkg-config is at least version 0.9.0... yes" We both used Ver 0.23 ? Oh well. Anyway...
Here's what I think you should try. If you have the 3 ffmpeg libs installed in local/lib and their respective include folders in local/include, Audacity will build --with-ffmpeg=system if you: Add 'CXXFLAGS=-Wall -Wextra' (w/o quotes) to ./configure. My log says :
(Note, the --prefix, --cache, and --srcdir were added by the script.)
Then, run 'make dep'
Next, run 'make' . And that worked. Except I did one other thing,(the "void FFmpegStartup();" in audacityApp.cpp). Richard had committed a change to CVS of ffmpeg.h after we messed around trying to get rid of the int_64 error, ( the warning that gets echoed about may not compile) and I think that was to trap whether my change to audacityapp.cpp redirected the order that certain headers got handled. I don't know if that change was later replaced with a fix in something else or it broke later for other reasons.
Maybe I'll try again myself to see what's going on with the current CVS. You did start with a fresh CVS source I presume?
Josh
BTW, you were right about libsndfile, I had forgotten that I ended up doing that too, just like it said at the end of the make. I guess some libraries don't implement pkg-config right. Go figure, for that matter, look at Audacity configure output, it says
"checking pkg-config is at least version 0.9.0... yes" We both used Ver 0.23 ? Oh well. Anyway...
Here's what I think you should try. If you have the 3 ffmpeg libs installed in local/lib and their respective include folders in local/include, Audacity will build --with-ffmpeg=system if you: Add 'CXXFLAGS=-Wall -Wextra' (w/o quotes) to ./configure. My log says :
Code: Select all
configure: running /bin/sh ./configure '--prefix=/usr/local/' 'CXXFLAGS=-Wall -Wextra' '--enable-unicode' '--with-libsndfile=system' '--with-libsamplerate' '--with-libresample=no' '--with-libvorbis=system' '--with-libflac=system' '--with-libid3tag=system' '--with-libtwolame=system' '--with-ffmpeg=system' '--without-soundtouch' '--with-libmad' '--without-libvamp' '--without-redland' '--without-slv2' '--without-liblrdf' '--without-midi' '--without-libscorealign' '--disable-nyquist' '--with-wx-config=/usr/local/bin/wx-config' --cache-file=/dev/null --srcdir=.Then, run 'make dep'
Next, run 'make' . And that worked. Except I did one other thing,(the "void FFmpegStartup();" in audacityApp.cpp). Richard had committed a change to CVS of ffmpeg.h after we messed around trying to get rid of the int_64 error, ( the warning that gets echoed about may not compile) and I think that was to trap whether my change to audacityapp.cpp redirected the order that certain headers got handled. I don't know if that change was later replaced with a fix in something else or it broke later for other reasons.
Maybe I'll try again myself to see what's going on with the current CVS. You did start with a fresh CVS source I presume?
Josh
Re: Building with FFMPEG - LIBSNDFILE not available
Actually I didn't use the latest CVS source. I just downloaded the "Recommended download" version 1.3.6 tarball from http://audacityteam.org/download/beta_source
Running 'make dep' and then make after configuring with the CXXFLAGS options made no difference. I still get the INT64_C error compiling ImportFFmpeg.cpp. The "void FFmpegStartup();" change fixed a problem you were having building AudacityApp.cpp, which I don't have.
I see in the Nabble thread that Richard's last post (Nov 18, 2008; 04:44pm) before you got it to build said he changed something in the source, and:
Some more stuff in CVS to try:
1) Added a pre-processor define on the compiler command line which should make the include order less critical
2) added another custom warning to detect if the order is still wrong (the one I had in for Linux doesn't work on OS X).
Did you just use the latest source code? I'm not sure what 1) and 2) were about. Maybe I need to grab the latest ImportFFmpeg.cpp code.
Running 'make dep' and then make after configuring with the CXXFLAGS options made no difference. I still get the INT64_C error compiling ImportFFmpeg.cpp. The "void FFmpegStartup();" change fixed a problem you were having building AudacityApp.cpp, which I don't have.
I see in the Nabble thread that Richard's last post (Nov 18, 2008; 04:44pm) before you got it to build said he changed something in the source, and:
Some more stuff in CVS to try:
1) Added a pre-processor define on the compiler command line which should make the include order less critical
2) added another custom warning to detect if the order is still wrong (the one I had in for Linux doesn't work on OS X).
Did you just use the latest source code? I'm not sure what 1) and 2) were about. Maybe I need to grab the latest ImportFFmpeg.cpp code.
Re: Building with FFMPEG - LIBSNDFILE not available
Did a little more digging. I found the C99/C++ comment with the following defines in ffmpeg.h (line 32):
This would work, except that the #ifdef _STDINT_H should instead be #ifdef _STDINT_H_ for the Mac darwin version of stdint.h. I see this has been fixed on the latest code in CVS as there is a check for both now. Maybe this is what Richard was eluding to in his 2) comment.
I corrected it in my copy, and now I get the "stdint.h has already been included..." warning when compiling. So I went looking for where <stdint.h> was included. It turns out it is not included in ImportFFmpeg.cpp or by any of the other included files. To verify this I put a #ifdef _STDINT_H_ check in the first line of ImportFFmpeg.cpp with a warning message, and it it indicates that stdint.h is already included!
I'm baffled at how/why this is the case. So rather than spend the time trying to figure that out, as a workaround, I just added the definition it needed: right after the "stdint.h included before..." #warning in FFmpeg.h. This fixed the problem compiling.
Now make gets a whole bunch of Undefined symbols and errors out when binding, all referencing wchar_t. For example:
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
wxStringBase::ConcatSelf(unsigned long, wchar_t const*, unsigned long)
wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)
wxStringBase::operator=(wchar_t const*)
wxString::Format(wchar_t const*, ...)
wxString::Cmp(wchar_t const*) const
operator+(wchar_t const*, wxString const&)
...
wxLogSysError(wchar_t const*, ...)
wxStricmp(wchar_t const*, wchar_t const*)
collect2: ld returned 1 exit status
make: *** [../audacity] Error 1
Ugh... will this ever end?
Code: Select all
#if defined(USE_FFMPEG)
extern "C" {
#ifdef _STDINT_H
/* stdint.h has already been included. That's likely to break ffmpeg headers
* as described above so we issue a warning */
#warning "stdint.h included before ffmpeg headers, this may well not compile"
#endif
#if !defined(__STDC_CONSTANT_MACROS)
#define __STDC_CONSTANT_MACROS
#endif
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/fifo.h>
}
#endifI corrected it in my copy, and now I get the "stdint.h has already been included..." warning when compiling. So I went looking for where <stdint.h> was included. It turns out it is not included in ImportFFmpeg.cpp or by any of the other included files. To verify this I put a #ifdef _STDINT_H_ check in the first line of ImportFFmpeg.cpp with a warning message, and it it indicates that stdint.h is already included!
I'm baffled at how/why this is the case. So rather than spend the time trying to figure that out, as a workaround, I just added the definition it needed:
Code: Select all
#define INT64_C(v) (v ## LL)Now make gets a whole bunch of Undefined symbols and errors out when binding, all referencing wchar_t. For example:
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
wxStringBase::ConcatSelf(unsigned long, wchar_t const*, unsigned long)
wxStringBase::InitWith(wchar_t const*, unsigned long, unsigned long)
wxStringBase::operator=(wchar_t const*)
wxString::Format(wchar_t const*, ...)
wxString::Cmp(wchar_t const*) const
operator+(wchar_t const*, wxString const&)
...
wxLogSysError(wchar_t const*, ...)
wxStricmp(wchar_t const*, wchar_t const*)
collect2: ld returned 1 exit status
make: *** [../audacity] Error 1
Ugh... will this ever end?
Re: Building with FFMPEG - LIBSNDFILE not available
Figured I'd download the latest version of audacity from CVS and try that. After doing so, and fixing the broken libsamplerate included in lib-src (replaced it with download from http://www.mega-nerd.com/SRC/libsamplerate-0.1.4.tar.gz). I then ran into a problem building sbms:
make[2]: Entering directory `/Users/rich/Desktop/Try/audacity/lib-src/sbsms'
cd . && /bin/sh /Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing --run aclocal-1.10
/Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing: line 52: aclocal-1.10: command not found
WARNING: `aclocal-1.10' is missing on your system. You should only need it if
you modified `acinclude.m4' or `configure.in'. You might want
to install the `Automake' and `Perl' packages. Grab them from
any GNU archive site.
cd . && /bin/sh /Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing --run automake-1.10 --gnu
/Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing: line 52: automake-1.10: command not found
WARNING: `automake-1.10' is missing on your system. You should only need it if
you modified `Makefile.am', `acinclude.m4' or `configure.in'.
You might want to install the `Automake' and `Perl' packages.
Grab them from any GNU archive site.
cd . && /bin/sh /Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing --run autoconf
configure.in:11: error: possibly undefined macro: AM_CONFIG_HEADER
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.in:15: error: possibly undefined macro: AC_DISABLE_SHARED
configure.in:36: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.in:37: error: possibly undefined macro: AM_PROG_LIBTOOL
configure.in:87: error: possibly undefined macro: AM_CONDITIONAL
configure.in:231: error: possibly undefined macro: AM_INIT_AUTOMAKE
make[2]: *** [configure] Error 1
After searching and seeing someone with a similar problem building on ubuntu (http://n2.nabble.com/Problems-compiling ... 82479.html), I tried what someone recommended, manually running:
cd lib-src/sbsms/
aclocal
automake
autoconf
./configure
make
This seemed to work, so I went back up to audacity and tried make again. It got further and then encountered this error:
make[1]: *** No rule to make target `../lib-src/libtwolame.a', needed by `../audacity'. Stop.
Even though the file existed. Manually I did the following:
cd lib-src/twolame/
./configure
Went back up to audacity again and tried make yet again. Make then proceeded to get to binding audacity, and ends up at the same error I encountered in my previous post. Apparently I'm missing something.
make[2]: Entering directory `/Users/rich/Desktop/Try/audacity/lib-src/sbsms'
cd . && /bin/sh /Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing --run aclocal-1.10
/Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing: line 52: aclocal-1.10: command not found
WARNING: `aclocal-1.10' is missing on your system. You should only need it if
you modified `acinclude.m4' or `configure.in'. You might want
to install the `Automake' and `Perl' packages. Grab them from
any GNU archive site.
cd . && /bin/sh /Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing --run automake-1.10 --gnu
/Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing: line 52: automake-1.10: command not found
WARNING: `automake-1.10' is missing on your system. You should only need it if
you modified `Makefile.am', `acinclude.m4' or `configure.in'.
You might want to install the `Automake' and `Perl' packages.
Grab them from any GNU archive site.
cd . && /bin/sh /Users/rich/Desktop/Try/audacity/lib-src/sbsms/missing --run autoconf
configure.in:11: error: possibly undefined macro: AM_CONFIG_HEADER
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.in:15: error: possibly undefined macro: AC_DISABLE_SHARED
configure.in:36: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.in:37: error: possibly undefined macro: AM_PROG_LIBTOOL
configure.in:87: error: possibly undefined macro: AM_CONDITIONAL
configure.in:231: error: possibly undefined macro: AM_INIT_AUTOMAKE
make[2]: *** [configure] Error 1
After searching and seeing someone with a similar problem building on ubuntu (http://n2.nabble.com/Problems-compiling ... 82479.html), I tried what someone recommended, manually running:
cd lib-src/sbsms/
aclocal
automake
autoconf
./configure
make
This seemed to work, so I went back up to audacity and tried make again. It got further and then encountered this error:
make[1]: *** No rule to make target `../lib-src/libtwolame.a', needed by `../audacity'. Stop.
Even though the file existed. Manually I did the following:
cd lib-src/twolame/
./configure
Went back up to audacity again and tried make yet again. Make then proceeded to get to binding audacity, and ends up at the same error I encountered in my previous post. Apparently I'm missing something.