Linking VLC build to ffmpeg build libraries - c++

I'm receiving the following error message when attempting to build VLC:
checking for mad_bit_init in -lmad... yes
checking for MPG123... yes
checking for libavutil variant... libav
checking for GST_APP... yes
checking for GST_VIDEO... yes
checking for AVCODEC... no
configure: error: Requested 'libavcodec >= 57.16.0' but version of libavcodec is 56.1.0. Pass --disable-avcodec to ignore this error.
I am running the command (first step of Configuration from link below, I did the contrib method and built everything else as well):
./configure
So let's get the obvious out of the way: I'm missing the most recent version of libavcodec (v57). Using --disable-avcodec is not a viable solution. Doing a quick apt-file search libavcodec I'm seeing that for debian/jessie the latest version published is libavcodec56, not 57. I did also notice that libavcodec57 was available for installation with ffmpeg here https://ffmpeg.org/download.html
I actually needed to also build ffmpeg from source. So I did that, worked my way through the dependencies without too much trouble using the guide linked to below.
So here is my issue: After building and doing a make install of ffmpeg, I still get that error above, despite having the latest libavcodec freshly compiled.
So my question is: since I used that guide, I am still getting the error when building vlc. I see that the lib exists her: /root/ffmpeg_build/lib/libavcodec.a, and I figured make install would put it where it needs to be. Is there some other compile flag I can set while compiling vlc to point it to that lib directory to look for libavcodec?
ffmpeg build: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
vlc build: https://wiki.videolan.org/UnixCompile/
UPDATE: tried this, still getting the error message: PKG_CONFIG_PATH="/root/ffmpeg_build/lib:$PKG_CONFIG_PATH" LD_LIBRARY_PATH="/root/ffmpeg_build/lib:$LD_LIBRARY_PATH" ./configure
UPDATE2: tried this, still getting the error message: ./configure --libdir="/root/ffmpeg_build/lib:$LIBDIR"
UPDATE3: I tried merging my ffmpeg libs into my vlc libs and may have made things worse. My ffmpeg libs lived here: /root/ffmpeg_build/lib
My vlc build (contrib builds as well) lived here: /opt/vlc/
So I merged them with my existing vlc contrib lib:
cp /root/ffmpeg_build/lib/* /opt/vlc/contrib/x86_64-linux-gnu/lib/
cp /root/ffmpeg_build/lib/pkgconfig/* /opt/vlc/contrib/x86_64-linux-gnu/lib/pkgconfig/
Then ran configure:
./configure --with-contrib=contrib/x86_64-linux-gnu
Which finally worked, but now I get this error when I try to make:
Now I get the error:
/usr/bin/ld: /opt/vlc/contrib/x86_64-linux-gnu/lib/libavformat.a(allformats.o): relocation R_X86_64_32 against `ff_a64_muxer' can not be used when making a shared object; recompile with -fPIC

Related

Compilation of OpenCV / Eigen3 fail

I want to use OpenCV but I cannot compile it and I think It's because of Eigen.
when I use Cmake command, Eigen is found:
> -- Use Eigen: YES (ver 3.2.2)
Whereas I have only Eigen2 on my computer. (Maybe It's an obsolete file but I don't know where it comes from).
Then, once Cmake is done I do
make -j4
At 64% I have this following error:
/home/sl001093/opencv-2.4.10/modules/contrib/src/rgbdodometry.cpp:65:47: fatal error: unsupported/Eigen/MatrixFunctions : no file like that
compilation aborted.
make[2]: * [modules/contrib/CMakeFiles/opencv_contrib.dir/src/rgbdodometry.cpp.o] Error 1
make1: * [modules/contrib/CMakeFiles/opencv_contrib.dir/all] Error 2
make: *** [all] Erreur 2
Thank you very much in advance !
EDIT: here the output of the command line ccmake
Use cmake-gui
Set OpenCV source and build directory
Configure
In the Search box, type "eigen"
Activate "WITH_EIGEN" flag
Configure again
A variable "EIGEN_INCLUDE_PATH" should appear: click there and browse to the "include" subdirectory of your Eigen library.
Eigen is a header only library, so you don't need to install/build it: just download a package (see "Get it" section on the right side of the page) and unzip it for the purpose of building OpenCV.
BTW, why are you using OpenCV 2.4 when there is already OpenCV 3 available? It might be that OpenCV 2.4 is not compatible with recent versions of Eigen, but I know as a fact that it is compatible with version 3.2.2.

ocaml-glpk (glpk bindings) and OASIS

Preface: I am new to OCaml, OPAM, and OASIS.
tldr question: How do I properly set up a package with opam that is not already available in the repository (I can't just do opam install X)? More details follow:
I am trying to include ocaml-glpk in an OCaml project. I installed ocaml-glpk just by running make and make install as stated in the README, and the given example compiles and runs correctly. However, I am using OASIS to generate the build system of my project, and I am not sure how to set it up. I have the same example (renamed to glpkExample.ml in a src folder) and the following in my _oasis file:
Executable "glpkExample"
Path: src
MainIs: glpkExample.ml
CompiledObject: best
BuildDepends:
glpk
After running oasis setup -setup-update dynamic, I run make and get the following error:
ocaml setup.ml -build
Finished, 0 targets (0 cached) in 00:00:00.
+ /home/dimitrios/.opam/system/bin/ocamlfind ocamlopt -g -linkpkg -package glpk src/glpkExample.cmx -o src/glpkExample.native
File "_none_", line 1:
Error: Cannot find file /home/dimitrios/.opam/system/lib/glpk/glpk.cmxa
Command exited with code 2.
Compilation unsuccessful after building 4 targets (3 cached) in 00:00:00.
E: Failure("Command ''/usr/bin/ocamlbuild' src/glpkExample.native -tag debug' terminated with error code 10")
make: *** [build] Error 1
It seems the glpk library is missing a cmxa file needed to compile a native executable. I am not sure how to fix this. To compile glpkExample.ml correctly, my Makefile includes /home/dimitrios/.opam/system/lib/glpk and also uses the OCamlMakefile, which is extremely long and convoluted. Any help on setting this up with OASIS or how to get ocaml-glpk to work nicely with OASIS would be greatly appreciated.
Thanks!
This website is not appropriate for bug reports. You should really report it here.
The temporary solution is to use CompiledObject: byte to compile in bytecode.
If you're using opam then it is best to install application with it, not manually. Try to clean up your system and remove whatever you installed, and then do:
$ eval `opam config env`
$ opam install ocaml-glpk
Afterwards, if glpk is packaged in opam correctly, it should work with your setup, i.e., just with oasis's BuildDepends field and nothing more.

I'm trying to send the program on launchpad and get an error

On my computer package is working OK.
I'm trying to send the program to launchpad
It posted normally, but does not compile, I get an error on mail:
* Source: not available
In the Build Log which shows there is an error:
...
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for qwe_indicator... no
configure: error: Package requirements (gtk+-3.0 glib-2.0 libcurl appindicator3-0.1) were not met:
No package 'gtk+-3.0' found
No package 'libcurl' found
No package 'appindicator3-0.1' found
...
I understand that there are missing packages. How can I fix it?

How do I specify LDFLAGS and CPPFLAGS for ./configure?

I am using a Mac running OS X 10.8.3. I am trying to compile cgminer 3.0.0. On my first run of ./configure I got the message:
checking for LIBCURL... no
checking for LIBCURL... no
configure: error: Missing required libcurl dev >= 7.18.2
So I installed the latest version of libcurl using homebrew:
brew install curl
That seemed to do the trick. I got this message:
downloaded: /Library/Caches/Homebrew/curl-7.30.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/curl/7.30.0
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
The libcurl provided by Leopard is too old for CouchDB to use.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/curl/lib
CPPFLAGS: -I/usr/local/opt/curl/include
==> Summary
/usr/local/Cellar/curl/7.30.0: 75 files, 2.0M, built in 61 seconds
Okay, so it's installed but not symlinked into /usr/local, that's fine with me. I tried this:
export LDFLAGS=-L/usr/local/opt/curl/lib
export CPPFLAGS=-I/usr/local/opt/curl/include
./configure
But I got the same message: configure: error: Missing required libcurl dev >= 7.18.2
So I tried this:
env LDFLAGS=-L/usr/local/opt/curl/lib CPPFLAGS=-I/usr/local/opt/curl/include ./configure
I'm still getting the "missing required libcurl" message. Any ideas?
After some more thorough investigation, I determined that the configure file for cgminer does not pay attention to LDFLAGS or CPPFLAGS when testing for libcurl. Instead, it checks for LIBCURL_CFLAGS and LIBCURL_LIBS. So, I tried:
export LIBCURL_CFLAGS=-I/usr/local/opt/curl/include
export LIBCURL_LIBS=-L/usr/local/opt/curl/lib
./configure
and I got:
checking for LIBCURL... yes
And the rest of the configuration went off without a hitch. SUCCESS!

What is procedure for installing c++ libraries on OSX Mountain Lion required by NPM Module Canvas?

I am trying to install the canvas npm module, a known trouble maker! It requires three libraries: gif, jpeg, and cairo. This is basically a fresh machine. What is the best way to get these libraries available for use by npm?
$ npm install canvas
npm http GET https://registry.npmjs.org/canvas
npm http 304 https://registry.npmjs.org/canvas
> canvas#0.12.1 preinstall node_modules/canvas
> node-waf configure build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : ok /usr/local/lib/node
Checking for node prefix : ok /usr/local
Checking for library gif : not found
Checking for library jpeg : not found
Checking for cairo : not found
node_modules/canvas/wscript:30: error: the configuration failed (see 'node_modules/canvas/build/config.log')
Mac homebrew can get you at least part of the way towards installing those libraries. I know that it can install cairo for you. You might have to adjust some of your library flags when you try to compile canvas, but it might just work out of the box.
Macports did the trick fairly painlessly