Building on Ubuntu 14.04

Archive of historical development discussions
Discussions / Development has moved to GitHub
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Building on Ubuntu 14.04

Post by ramitbhalla »

Have anyone tried building handbrake on Ubuntu 14.04? I'm facing a lot of unresolved issues. This one has me foxed completely

Code: Select all

  : In file included from libbluray/decoders/textst_render.c:31:0:
  : /Software/handbrake/sandbox/x86_64/build/contrib/include/ft2build.h:56:38: fatal error: freetype/config/ftheader.h: No such file or directory
  :  #include <freetype/config/ftheader.h>
I've installed libfreetype6-dev but I'm still getting the error (without the lib I get an error that FT2 not found, which goes away on installing but this pops up). Anyone have any idea on how to build on 14.04?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Building on Ubuntu 14.04

Post by JohnAStebbins »

Have you read the documentation (doc/BUILD-Linux) and installed *all* the dependencies? There is a nightly build for ubunty on my PPA
https://edge.launchpad.net/~stebbins/+a ... -snapshots
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

First thanks this was a solid lead, wish this was there on the official compile page (like ffmpeg does for zeranoe builds).
Second, looks like your build for for linux, I'm looking at windows builds (32 and 64bit) using mingw. Do you have builds for windows?

I checked out doc/builds for from https://trac.handbrake.fr/browser/trunk/doc/BUILD-MinGW it I got this:

Code: Select all

sudo apt-get install a52dec bzip2 faac faad2 ffmpeg fontconfig freetype fribidi lame libass libbluray libdca libdvdnav libdvdread libiconv libmkv libogg libsamplerate libtheora libvorbis libxml2 mp4v2 mpeg2dec x264 yasm zlib
This didn't work.

Then I checked this page:
https://trac.handbrake.fr/wiki/CompileOnLinux

But this is for linux and only stable builds. Should I be looking at this?

I've followed the instruction on this page:
https://trac.handbrake.fr/wiki/CompileOnWindows

and installed these:

Code: Select all

sudo apt-get install subversion yasm apt-file autoconf \
libtool zlib1g-dev libbz2-dev libfribidi-dev intltool libglib2.0-dev
but this where I'm stuck since those instruction for 12.04 and not 14.04

Any suggestions on where I can find the dependencies for 14.04 for building using mingw for windows?

thanks,
Deleted User 11865

Re: Building on Ubuntu 14.04

Post by Deleted User 11865 »

Last time I checked, 14.04 builds didn't work at runtime. I still use 13.10 for my Windows builds.
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

@Rodeo, so no chance for 14.04 or is there some workaround for this freetype issue?
Deleted User 11865

Re: Building on Ubuntu 14.04

Post by Deleted User 11865 »

I mean that even if you get it to build, chances are the builds won't run properly under Windows.
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

If you don't mind me asking - why is that?
Deleted User 11865

Re: Building on Ubuntu 14.04

Post by Deleted User 11865 »

No clue, t just didn't work. Maybe it's been fixed since, I don't know.
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

@rodeo can you tell me how you got it to work or any clue how I can fix this freetype issue? Be happy to post my results back here after a successful build.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Building on Ubuntu 14.04

Post by JohnAStebbins »

I didn't realize you were building for windows. You didn't say this.

When building for windows, we must build freetype (and many other packages). The missing file *should* have been "installed" in HandBrake/build/contrib/include/freetype2/freetype/config/ftheader.h after building freetype. If it is not there, than there was some earlier failure while building freetype. Perhaps posting the entire build log would help.

But there are nightly builds for windows as well viewtopic.php?f=6&t=15901
Deleted User 11865

Re: Building on Ubuntu 14.04

Post by Deleted User 11865 »

ramitbhalla wrote:@rodeo can you tell me how you got it to work
I already did. I still build using Ubuntu 13.10…
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

@JohnAStebbins, I used to use that link until they stopped providing 32bit builds. If they can get those back up there I'd be SUPER happy not having to break head on getting this work on 14.04. I'll check on the logs again

@Rodeo - I checked the thead again and I don't see where you explained how you do it to work on 14.04. Did I miss something here?
Deleted User 11865

Re: Building on Ubuntu 14.04

Post by Deleted User 11865 »

Rodeo wrote:
ramitbhalla wrote:@rodeo can you tell me how you got it to work
I already did. I still build using Ubuntu 13.10…
For the last time, building on 14.04 did not work when I tried it. I build on 13.10!
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

So I'm not sure who's maintaining the website, but here's some feedback. On the page for building Handbrake CLI for Windows using Ubuntu 12.04 (https://trac.handbrake.fr/wiki/CompileOnWindows) it need to be updated to mention that the YASM installed via the apt-get is not correct. Instead the user needs to download YASM 1.3.0 (or 1.2.0 or greater), build it and install it for handbrake build to work otherwise it'll crib that YASM 1.2.0 is not installed.

So infact instead of

Code: Select all

sudo apt-get install subversion yasm apt-file autoconf \
libtool zlib1g-dev libbz2-dev libfribidi-dev intltool libglib2.0-dev
It should be:

Code: Select all

sudo apt-get install subversion apt-file autoconf \
libtool zlib1g-dev libbz2-dev libfribidi-dev intltool libglib2.0-dev
The instructions downloading, building and installing YASM can be found here: http://www.linuxfromscratch.org/blfs/vi ... /yasm.html

In short to build YASM 1.3.0 and install it:

Code: Select all

mkdir yasm
cd yasm
curl -o yasm-1.3.0.tar.gz http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xvzf yasm-1.3.0.tar.gz -C .
cd yasm-1.3.0
sed -i 's#) ytasm.*#)#' Makefile.in &&
./configure --prefix=/usr &&
make
sudo make install
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

Infact the latest code won't even build on 12.04. I get the following error while trying to build x264. Anyone have any idea what the issue is?
checking whether i686-w64-mingw32-windres works... yes
x264 configure script
Command line options: "--host=i686-w64-mingw32" "--build=x86_64-unknown-linux-gnu" "--prefix=/home/mcebuddy/Software/handbrake/sandbox/win32/build/contrib/" "--enable-static" "--bit-depth=8" "--chroma-format=420" "--disable-lavf" "--disable-ffms" "--disable-avs" "--disable-swscale" "--disable-gpac" "--disable-lsmash" "--disable-cli" "--cross-prefix=i686-w64-mingw32-"

checking whether /usr/bin/i686-w64-mingw32-gcc works... yes
checking whether /usr/bin/i686-w64-mingw32-gcc supports for( int i = 0; i < 9; i++ ); with -std=gnu99... yes
checking whether yasm supports vpmovzxwd ymm0, xmm0... yes
checking whether /usr/bin/i686-w64-mingw32-gcc supports __asm__("pabsw %xmm0, %xmm0");... yes
checking for -mpreferred-stack-boundary=5... yes
checking for pthread_create(0,0,0,0); in pthread.h... yes
checking for return log2f(2); in math.h... yes
checking for uint32_t test_vec __attribute__ ((vector_size (16))) = {0,1,2,3}; in stdint.h... yes
checking for -fno-tree-vectorize... yes
checking for -fno-zero-initialized-in-bss... yes
checking for fseeko(stdin,0,0); in stdio.h... yes
checking for -Wshadow... yes
checking for -Wmaybe-uninitialized... no
Failed commandline was:
--------------------------------------------------
/usr/bin/i686-w64-mingw32-gcc conftest.c -Wshadow -O3 -ffast-math -m32 -I/home/mcebuddy/Software/handbrake/sandbox/win32/build/contrib/include -mno-ms-bitfields -Wall -I. -I$(SRCPATH) -march=i686 -mfpmath=sse -msse -std=gnu99 -mpreferred-stack-boundary=5 -fomit-frame-pointer -fno-tree-vectorize -fno-zero-initialized-in-bss -Wmaybe-uninitialized -lshell32 -m32 -L/home/mcebuddy/Software/handbrake/sandbox/win32/build/contrib/lib -Wl,--large-address-aware -Wl,--nxcompat -Wl,--dynamicbase -lpthread -o conftest
cc1: error: unrecognized command line option ‘-Wmaybe-uninitialized’
--------------------------------------------------
Failed program was:
--------------------------------------------------
int main (void) { return 0; }
--------------------------------------------------
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Building on Ubuntu 14.04

Post by s55 »

The instructions on the wiki, as per the rest of the wiki currently, is for 0.9.9. Not trunk.

You won't be able to build trunk on 12.05 with their own version of MingW. The toolchain there is now too old. If I remember correctly, -Wmaybe-uninitialized was introduced in 4.7.

Personally, I just use the Mingw-W64 tarballs from the mingw-w64 site and stick them on the path. I'm currently using a far more recent toolchain based around gcc 4.9.0

Which reminds me, I probably going to have to upgrade the /doc/ notes for mingw building again.
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

Can you also please put up the instruction for building the latest trunks. Can you tell me where you got the mingw and how you've configured to use it to build handbrake?
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

I"m getting seriously lost here trying to figure out what toolchains and the different builds. I'm looking at http://sourceforge.net/projects/mingw-w64/files/

Can anyone advise which one I need to install to get the latest trunk to build in BOTH 32bit and 64bit Windows CLI of handbrake. thanks. (and any tips on installation / configuration would be VERY much appreciated).
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Building on Ubuntu 14.04

Post by s55 »

You need separate tool-chains for both

Note, the nightly build page gives you 64bit builds, so there isn't an awful lot of need to build yourself unless your trying to add patches.
0.10 Final (hopefully out soon) will be the last available 32bit build from us, and after that there is no guarantees that 32bit will work, or even build. (Note, the beta page still has 32bit builds)

http://sourceforge.net/projects/mingw-w ... %20Builds/ mingw-w64-bin_x86_64-linux_*
http://sourceforge.net/projects/mingw-w ... %20Builds/ mingw-w32-bin_x86_64-linux_*

This assumes your linux VM is 64bit. If it's not, you need the i686 equivalents of those packages.

I haven't tested, nor have time to, the latest releases of MinGW, and they don't provide the exact toolchain version I use any more. Anyway, you can give this a shot and let us know either way. It really is as simple as extracting these tar files, and adding the "bin" folder to your PATH.
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

Great thanks I'll post back what it takes for me to build it for your reference also. BTW, what do you mean the 32bit builds are still available in the BETA page? What page is this? On the nightly builds page I only see 64bit builds.

Although I would suggest that 32bit build continue to be published on the nightly builds page. You can document any potential issues (pretty sure it'll work fine for 99% of the users) and let them make a choice thereafter.
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

Okay I've made some progress, downloaded the latest toolchains from the suggested links and added the bin folder to the PATH. I get the following error, this is related to mingw and if so any suggestions? (am I using the wrong version?)
: /bin/bash ../libtool --tag=CC --mode=link /home/mcb/Software/handbrake/sandbox/../mingw-w32/bin/i686-w64-mingw32-gcc -Wall -pipe -I/home/mcb/Software/handbrake/sandbox/win32/build/contrib/include -std=gnu99 -mno-ms-bitfields -L/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lib -o libmpgdecoder.la common.lo dct64_i386.lo decode_i386.lo interface.lo layer1.lo layer2.lo layer3.lo tabinit.lo
: mkdir .libs
: i686-w64-mingw32-ar cru .libs/libmpgdecoder.a common.o dct64_i386.o decode_i386.o interface.o layer1.o layer2.o layer3.o tabinit.o
: i686-w64-mingw32-ranlib .libs/libmpgdecoder.a
: creating libmpgdecoder.la
: (cd .libs && rm -f libmpgdecoder.la && ln -s ../libmpgdecoder.la libmpgdecoder.la)
: make[3]: Leaving directory `/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lame/lame/mpglib'
: Making all in libmp3lame
: make[3]: Entering directory `/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lame/lame/libmp3lame'
: Making all in i386
: make[4]: Entering directory `/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lame/lame/libmp3lame/i386'
: make[4]: Nothing to be done for `all'.
: make[4]: Leaving directory `/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lame/lame/libmp3lame/i386'
: Making all in vector
: make[4]: Entering directory `/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lame/lame/libmp3lame/vector'
: /bin/bash ../../libtool --tag=CC --mode=compile /home/mcb/Software/handbrake/sandbox/../mingw-w32/bin/i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I. -I../../libmp3lame -I../../mpglib -I../.. -I/home/mcb/Software/handbrake/sandbox/win32/build/contrib/include -mno-ms-bitfields -Wall -pipe -I/home/mcb/Software/handbrake/sandbox/win32/build/contrib/include -std=gnu99 -mno-ms-bitfields -c -o xmm_quantize_sub.lo xmm_quantize_sub.c
: /home/mcb/Software/handbrake/sandbox/../mingw-w32/bin/i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I. -I../../libmp3lame -I../../mpglib -I../.. -I/home/mcb/Software/handbrake/sandbox/win32/build/contrib/include -mno-ms-bitfields -Wall -pipe -I/home/mcb/Software/handbrake/sandbox/win32/build/contrib/include -std=gnu99 -mno-ms-bitfields -c xmm_quantize_sub.c -o xmm_quantize_sub.o
: In file included from xmm_quantize_sub.c:37:0:
: xmm_quantize_sub.c: In function 'init_xrpow_core_sse':
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:905:1: error: inlining failed in call to always_inline '_mm_loadu_ps': target specific option mismatch
: _mm_loadu_ps (float const *__P)
: ^
: xmm_quantize_sub.c:55:18: error: called from here
: const __m128 vec_fabs_mask = _mm_loadu_ps((float const*) &fabs_mask[0]);
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:871:1: error: inlining failed in call to always_inline '_mm_set_ps1': target specific option mismatch
: _mm_set_ps1 (float __F)
: ^
: xmm_quantize_sub.c:62:38: error: called from here
: vec_xrpow_max._m128 = _mm_set_ps1(0);
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:871:1: error: inlining failed in call to always_inline '_mm_set_ps1': target specific option mismatch
: _mm_set_ps1 (float __F)
: ^
: xmm_quantize_sub.c:63:32: error: called from here
: vec_sum._m128 = _mm_set_ps1(0);
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:905:1: error: inlining failed in call to always_inline '_mm_loadu_ps': target specific option mismatch
: _mm_loadu_ps (float const *__P)
: ^
: xmm_quantize_sub.c:68:17: error: called from here
: vec_tmp = _mm_loadu_ps(&(cod_info->xr)); //load
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:213:1: error: inlining failed in call to always_inline '_mm_and_ps': target specific option mismatch
: _mm_and_ps (__m128 __A, __m128 __B)
: ^
: xmm_quantize_sub.c:69:17: error: called from here
: vec_tmp = _mm_and_ps(vec_tmp, vec_fabs_mask); //fabs
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:157:1: error: inlining failed in call to always_inline '_mm_add_ps': target specific option mismatch
: _mm_add_ps (__m128 __A, __m128 __B)
: ^
: xmm_quantize_sub.c:71:35: error: called from here
: vec_sum._m128 = _mm_add_ps(vec_sum._m128, vec_tmp);
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:181:1: error: inlining failed in call to always_inline '_mm_sqrt_ps': target specific option mismatch
: _mm_sqrt_ps (__m128 __A)
: ^
: xmm_quantize_sub.c:73:30: error: called from here
: vec_tmp = _mm_sqrt_ps(_mm_mul_ps(vec_tmp, _mm_sqrt_ps(vec_tmp)));
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:169:1: error: inlining failed in call to always_inline '_mm_mul_ps': target specific option mismatch
: _mm_mul_ps (__m128 __A, __m128 __B)
: ^
: xmm_quantize_sub.c:73:30: error: called from here
: vec_tmp = _mm_sqrt_ps(_mm_mul_ps(vec_tmp, _mm_sqrt_ps(vec_tmp)));
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:181:1: error: inlining failed in call to always_inline '_mm_sqrt_ps': target specific option mismatch
: _mm_sqrt_ps (__m128 __A)
: ^
: xmm_quantize_sub.c:73:17: error: called from here
: vec_tmp = _mm_sqrt_ps(_mm_mul_ps(vec_tmp, _mm_sqrt_ps(vec_tmp)));
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:954:1: error: inlining failed in call to always_inline '_mm_storeu_ps': target specific option mismatch
: _mm_storeu_ps (float *__P, __m128 __A)
: ^
: xmm_quantize_sub.c:75:22: error: called from here
: _mm_storeu_ps(&(xrpow), vec_tmp); //store into xrpow[]
: ^
: In file included from xmm_quantize_sub.c:37:0:
: /home/mcb/Software/handbrake/mingw-w32/lib/gcc/i686-w64-mingw32/4.9.0/include/xmmintrin.h:205:1: error: inlining failed in call to always_inline '_mm_max_ps': target specific option mismatch
: _mm_max_ps (__m128 __A, __m128 __B)
: ^
: xmm_quantize_sub.c:77:41: error: called from here
: vec_xrpow_max._m128 = _mm_max_ps(vec_xrpow_max._m128, vec_tmp); //retrieve max
: ^
: make[4]: *** [xmm_quantize_sub.lo] Error 1
: make[4]: Leaving directory `/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lame/lame/libmp3lame/vector'
: make[3]: *** [all-recursive] Error 1
: make[3]: Leaving directory `/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lame/lame/libmp3lame'
: make[2]: *** [all-recursive] Error 1
: make[2]: Leaving directory `/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lame/lame'
: make[1]: *** [all] Error 2
: make[1]: Leaving directory `/home/mcb/Software/handbrake/sandbox/win32/build/contrib/lame/lame'
: make: *** [contrib/lame/.stamp.build] Error 2
-------------------------------------------------------------------------------
time end: Sun Oct 12 06:17:15 2014
duration: 10 minutes, 48 seconds (648.77s)
result: FAILURE (code 2)
-------------------------------------------------------------------------------
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Building on Ubuntu 14.04

Post by s55 »

Created a new VM to test.

Looks like the version of liblame can't be compiled to 32bit anymore with the current versions of MinGW-w64. (Seems to be OK for 64bit though). Looks like it may need an upgrade or patched to make it work again.

64bit builds get further, but unfortunately have other problems needing fix.


Short of it is, your not going to be able to compile this easily until we get fixes for the problems that have cropped up with the newer toolchain.
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Building on Ubuntu 14.04

Post by s55 »

Update: 64bit builds as long as you have cmake installed rather than letting the HB build system try build it's own copy.

sudo apt-get install cmake does the trick
Deleted User 11865

Re: Building on Ubuntu 14.04

Post by Deleted User 11865 »

s55 wrote:Update: 64bit builds as long as you have cmake installed rather than letting the HB build system try build it's own copy.

sudo apt-get install cmake does the trick
Same issue as yasm, MinGW builds it for Windows where we need a native version since it's a build requirement.
ramitbhalla
Enlightened
Posts: 103
Joined: Sat Jan 18, 2014 12:12 am

Re: Building on Ubuntu 14.04

Post by ramitbhalla »

Can I put in a request please, looks like it's impossible to build 32bit handbrake when one is starting from scratch. Since you have a setup that used to build 32bit versions till a few weeks ago I would request you to PLEASE continue bulding 32bit builds for now for the nightly builds section. Once 0.1 is released you can stop but it will give us time to find alternative or fix the build environment.

Thanks
Post Reply