Why does this VLC Media Player Build Fail? - makefile

When building VLC on Ubuntu 18 using the following configure invocation:
First I obtain the source like so:
% git clone git://git.videolan.org/vlc.git
% cd vlc
% ./bootstrap
Then I build like so:
make clean
./configure --disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig
The build fails like so:
codec/jpeg.c: In function ‘DecodeBlock’:
codec/jpeg.c:501:16: warning: variable ‘p_row_pointers’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
JSAMPARRAY p_row_pointers = NULL;
^~~~~~~~~~~~~~
CCLD libjpeg_plugin.la
CC codec/libsdl_image_plugin_la-sdl_image.lo
CCLD libsdl_image_plugin.la
CC codec/libxwd_plugin_la-xwd.lo
CCLD libxwd_plugin.la
CC codec/liblibass_plugin_la-libass.lo
CCLD liblibass_plugin.la
/usr/bin/ld: /root/vlc-3.0.4/contrib/x86_64-linux-gnu/lib/libfontconfig.a(fcxml.o): in function `FcConfigMessage':
/root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:573: undefined reference to `xmlSAX2GetLineNumber'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:576: undefined reference to `xmlSAX2GetLineNumber'
/usr/bin/ld: /root/vlc-3.0.4/contrib/x86_64-linux-gnu/lib/libfontconfig.a(fcxml.o): in function `IA__FcConfigParseAndLoad':
/root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3309: undefined reference to `xmlCreatePushParserCtxt'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3348: undefined reference to `xmlParseChunk'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3362: undefined reference to `xmlFreeParserCtxt'
/usr/bin/ld: /root/vlc-3.0.4/contrib/native/fontconfig/src/fcxml.c:3354: undefined reference to `xmlCtxtGetLastError'
Any ideas what I did wrong here? It seems like the module in question should fail to build in this case as I disabled fontconfig.
Libfontconfig is in fact installed:
root#fuzzbot:~/vlc-3.0.4# apt-get install libfontconfig
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libfontconfig1' instead of 'libfontconfig'
libfontconfig1 is already the newest version (2.13.0-5ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root#fuzzbot:~/vlc-3.0.4#
Additional ideas:
I tried in vain to find VLC's official bug tracker for this kind of thing. I found bug trackers for literally every subproject of VLC but the main project that I am trying to build. If anyone knows the proper channels to ask the VLC people about this, let me know.
Additionally if the admins feel that this question better fits on serverfault, or AskUbuntu, feel free to move it. As far as I can tell this is a little too automake specific to be serverfault's bag, and I don't think the issue is unique to Ubuntu, as the official VLC wiki specifies no specific instructions for Ubuntu.
I don't really need all the plugins for my use case. If doing any further --disables in my configure invocation will help, I'm willing to try it.

The errors indicates a problem with linking against "some" xml-library.
most likely libxml2, which you probably have not installed.
./configure is supposed to detect any missing library and prevent your build from failing, but there might be a bug in the configure script itself.
Anyhow, since you are on a Debian-based distribution, you could simply install all the packages that are required to build the official Debian (or Ubuntu) package. (Your personal build might have additional dependencies or lack some of the dependencies of the official package, but it is usually a good starting point).
apt-get build-dep vlc
If you are getting an error like E: You must put some 'source' URIs in your sources.list then you should add deb-src entries to your apt sources-list, e.g. using
find /etc/apt/sources.list /etc/apt/sources.list.d/ \
-type f -name "*.list" -not -name debsrc.list \
-exec echo sed -e 's|^deb |deb-src |' {} + > /etc/apt/sources.list.d/debsrc.list

I followed your post on vlc forum to this SO post.
As people there suggested the libass is the problem, thus I added the option to disable it. Now the configuration command looks like:
./configure --disable-libass \
--disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig
The compilation proceeded without the previous fontconfig error. However it hits a different error:
....upnp....: undefined reference to `pthread_rwlock_wrlock'
A google search turned up another vlc forum thread. People suggesting turning off upnp. Configured it again by adding:
--disable-upnp
Then hit another error:
/libavcodec.a(fft.o): relocation R_X86_64_PC32 against symbol `ff_cos_32' can not be used when making a shared object; recompile with -fPIC
Another google search suggests to turn off chromaprint, adding yet another option:
--disable-chromaprint
Eventually it finishes with a success!
Before running the long configure command at the beginning of this post, I also tried building 3.0.7.1 but hit a problem with missing a liveMedia.hh file. In case anybody else is doing the same, here is the list of packages installed though not all of them are required since disabled a few features on the configure command line:
apt-get install git build-essential pkg-config libtool automake autopoint gettext
apt-get install subversion yasm cvs cmake ragel
apt-get install gperf
apt-get install openjdk-8-jre-headless openjdk-8-jdk-headless
apt-get install ant
apt-get install python3-pip
pip3 install meson
apt-get install nasm
apt-get install protobuf-c-compiler
apt-get install protobuf-compiler
apt-get install libpthread-stubs0-dev
apt-get install libasound2-dev liblivemedia-dev livemedia-utils
Summary
Use the videolan unix compile wiki page as a guide for steps below.
Install supporting packages as the list above shows.
Run cd contrib && mkdir native && cd native && ../bootstrap && make to build libraries.
Run the very long configure command:
./configure --disable-libass \
--disable-lua --disable-swscale --disable-alsa --disable-chromecast --disable-fontconfig \
--disable-upnp --disable-chromaprint
Run make.

Related

Error while upgrading Asterisk to 14 - PJSIP undeclared

I am trying to upgrade asterisk 11 to 14 on Debian (8.7) and I got the following error when I do make install.
The error is as below
res_pjsip_transport_management.c: In function ‘monitored_transport_state_callback’:
res_pjsip_transport_management.c:190:8: error: ‘PJSIP_TP_STATE_SHUTDOWN’ undeclared (first use in this function)
case PJSIP_TP_STATE_SHUTDOWN:
^
res_pjsip_transport_management.c:190:8: note: each undeclared identifier is reported only once for each function it appears in
/root/asterisk-14.3.0/Makefile.rules:149: recipe for target 'res_pjsip_transport_management.o' failed
make[1]: *** [res_pjsip_transport_management.o] Error 1
Makefile:401: recipe for target 'res' failed
make: *** [res] Error 2
The commands I used are as follow
tar -zxvf asterisk-14-current.tar.gz
/etc/init.d/asterisk stop
cd asterisk-14.3.0/
./configure
rm -f /usr/lib/asterisk/modules/*
make install
I tried some solutions from the internet and it didn't fix....
It seems like the pjsip versions do not match (could be that there is more then one version installed) so you want to remove all previous/existing versions of PJSip. If you do not know what packages belong to pjsip you can search them via:
apt-cache search pjsip
or
dpkg -l | grep pj
And once you know which package to remove do
apt-get --purge remove <package name>
You then want to download the latest version of pjsip (current 2.6 according to Asterisk website)
wget wget http://www.pjsip.org/release/2.6/pjproject-2.6.tar.bz2
tar -xjvf pjproject-2.6.tar.bz2
You want to place the pjproject in /usr/local.
cp -R pjproject-2.6 /usr/local/
Once this is done you have to build/compile/install the pjproject and
./configure --prefix=/usr --enable-shared CFLAGS='-O2 -DNDEBUG' //Various options (enable/disable) can be put in here. Please refer to manual
make dep
make
make install
ldconfig
Verify that pjproject has been installed in the target location
ldconfig -p | grep pj
Once this has been done you can now go to you Asterisk folder and issue
./configure
and proceed with installation further :)
pjsip version not match.
Never tried 14*(it is not LTS), for 13.* such error mean you have more then one pjsip or pjsip is not 2.4.
Before rebuilding pjsip do check
yum remove -y pjsip
rm -f `find / -name *pjsip*`
If I'm not mistaken, Asterisk 13 source code came with a built-in pjproject, but 14 will look for an installed pjproject on the system.
Make sure you have it installed (including the -dev or -devel packages, which contains the headers), than try to reconfigure asterisk source.
./bootstrap.sh
./configure
make menuconfig

unable to build magick for golang

I am following this document for building the Go Imagick library.
When i ran the following command
go build -tags no_pkgconfig imagick
It throws the following exception :
# imagick
src/imagick/affine_matrix.go:8:29: fatal error: wand/MagickWand.h: No such file or directory
compilation terminated
Now to resolve that i have also installed the following packages as many people suggested to resolve the error. But it didn't work either.
sudo apt-get install libmagickwand-dev libmagickcore-dev imagemagick
Moreover, when i run go build imagick
It throws the following error :
# imagick
could not determine kind of name for C.FlattenAlphaChannel
could not determine kind of name for C.RemoveAlphaChannel
Output of pkg-config --cflags --libs MagickWand gives the correct output
-fopenmp -I/usr/include/ImageMagick -lMagickWand -lMagickCore
ImageMagick is installed to this path(/usr/include/ImageMagick) only.
Their docs mention that no_pkgconfig must be used with manually set GCO_CFLAGS and CGO_LDFLAGS. So something like this should work:
export CGO_CFLAGS="$(pkg-config --cflags MagickWand)"
export CGO_LDFLAGS="$(pkg-config --libs MagickWand)"
go build -tags no_pkgconfig
As mentioned on #68 of the issue tracker, you are using way too old of a version of ImageMagick, which predates the versions that were tested for the master branch. Your Linux distro is older than the current available stable release.
You should manually install a newer ImageMagick, and remove the, one from apt. Or use some solution that allows you to manage multiple versions.

libTogl undefined references

I am trying to install netgen (build from source).
Therefore Togl is needed and I installed it via
sudo apt-get install libtogl1 libtogl-dev
When typing 'make' I receive the following error messages:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `Tk_InitStubs'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `tkStubsPtr'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `Tcl_InitStubs'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libTogl.so: undefined reference to `tclStubsPtr'
Maybe Togl was not installed right. Is this an 32bit 64bit issu?
What should I do to fix this?
This is an issue with linking to the correct versions of Tcl and Tk, as #keltar mentioned. If your goal is to build Netgen from source, your best bet is to stick with netgen-5.3.1, which works with tcl8.5 and tk8.5.
I ran into this issue because when I ran sudo apt-get install tcl-dev tk-dev, apt-get fetched tcl8.6 and tk8.6 for me. (If you search online for these issues you can see that these linking issues can sometimes be resolved by updating your Tcl/Tk version.) I uninstalled the default tcl-dev and tk-dev packages and installed tcl8.5-dev and tk8.5-dev instead.
Once you have the best fit version of Tcl/Tk, you can install Netgen from source. For example,
./configure --with-tclconfig=/usr/lib/tcl8.5/ --with-tkconfig=/usr/lib/tk8.5/
make
make install

dpkg error: contains ununderstood data member

I'm trying to install a jailbreak tweak using make package install but I'm receiving this error from dpkg:
dpkg-deb: file `/tmp/_theos_install.deb' contains ununderstood data member data.tar.xz , giving up
dpkg: error processing /tmp/_theos_install.deb (--install):
subprocess dpkg-deb --fsys-tarfile returned error exit status 2
Errors were encountered while processing:
/tmp/_theos_install.deb
make: *** [internal-install] Error 1
So as far as I can tell it isn't able to understand the .xz extension, but I'm not sure why that file is being created. Thanks for the help.
I found out how to fix it. In $THEOS/makefiles/package/deb.mk replace this line:
$(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r dpkg-deb -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)" $(STDERR_NULL_REDIRECT)$(ECHO_END)
with this line:
$(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r dpkg-deb -Zgzip -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)" $(STDERR_NULL_REDIRECT)$(ECHO_END)
The .deb file is created because you told Theos build system to do that. The package install rule of the Makefile is creating the Debian package using xz compression. Now, this kind of compression is supported by versions of dpkg equal or higher than 1.15.6.
So, in order to solve your problem, you should update dpkg to a newer version or install Theos without packaging support. Probably a simple make install will do it.
In case that updating dpkg isn't possible and you don't want to install the program without package management support, the other (more painful) method is to change the algorithm in which the package is compressed. Here you have good information about how to do this.
In my case I was building a package on Ubuntu 18.04 and trying to install that package on Debian 7 (airgapped). I had to change the line in the Makefile that read:
dpkg --build $(DESTDIR)
..to:
dpkg-deb --build -Zgzip $(DESTDIR)
Thanks Connor!
Other option that you can try is to unpack the .deb that you where triying to install and repack with no XZ compression.
Unpack:
mkdir package/ && dpkg -x package.deb package/
Pack:
dpkg-deb --build -Zgzip package/
You can rename the resulting package with:
dpkg-name -o package.deb
Or simply name the package dir with the name of your package.
Important: In orther to perform this, you need to install dpkg-dev package:
sudo apt update
sudo apt install dpkg-dev

Can not configure Mapnik due to icuuc

Trying to compile Mapnik on OSX 10.8
So after I clone the Github repo, I go to run the configure command like so:
./configure and then get the error:
Checking for C++ library icuuc... no
Could not find required header or shared library for icuuc
and later:
Exiting... the following required dependencies were not found:
- icuuc (ICU C++ library | configure with ICU_LIBS & ICU_INCLUDES or use ICU_LIB_NAME to specify custom lib name | more info: http://site.icu-project.org/)
Looking at the Mapnik troubleshooting area for a solution: https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting
Says: Solution: If g++ is available then ICU must be in a custom location so set the paths to the libs and includes - ie. ICU_LIBS=/usr/local/lib and ICU_INCLUDES=/usr/local/include.
By running g++ from command line I get: i686-apple-darwin11-llvm-g++-4.2: no input files
So this means that g++ is available, but I have no idea how to go about setting the paths so that configure can find them.
ICU Libraries were installed by default or with homebrew, not sure which.
terminal: brew install icu4c
Warning: icu4c-51.1 already installed
Finding the icu4c install directory:
terminal: mdfind icu4c
/usr/local/Cellar/icu4c
You can add the path of your ICU_LIB/INCLUDE to your configure command:
./configure ICU_INCLUDES=/usr/local/Cellar/icu4c/include ICU_LIBS=/usr/local/Cellar/icu4c/lib
And for more help about configure on what options are accepted do:
./configure --help
For the installation reference, you can check this:
https://github.com/mapnik/mapnik/blob/v2.2.0/INSTALL.md
As per our discussion and my last comment something like the following might work.
export ICU_LIBS=/usr/local/Cellar/icu4c/lib
export ICU_INCLUDES=/usr/local/Cellar/icu4c/include
./configure
If you find same errors:
Checking for C++ library XXX... no
Follow the command
sudo apt-get install g++ libXXX-dev
Using tips (TAB button), you can see what XXX libraries you have available
sudo apt-get install libXXX(press double TAB)

Resources