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

compiling from source #352

Open
kieranjol opened this issue Nov 8, 2018 · 16 comments
Open

compiling from source #352

kieranjol opened this issue Nov 8, 2018 · 16 comments

Comments

@kieranjol
Copy link
Collaborator

Ben mentioned this as a possibility in #351

I think that this could come in very handy for those of us who occasionally need to compile things like mediainfo/ffmpeg/rawcooked/dvdrip(!) when testing out a branch or something.

So I'm thinking of the simplest scenarios like:
'If a project has a configure file, you may just need to cd into the directory that contains the configure script, and run:

./configure && make

and if you wish to install the build so that it is accessible from all folders, you can run
make install

However you may need to have several dependencies installed, such as gcc, g++, make, autotools etc. You often just have to keep trying and keep fixing each error that pops up. For example you may get an error saying that libtoolize not found, so a quick google search should let you know how to install that dependency for your operating system. In the case of ubuntu, it is apt install libtool.

@privatezero
Copy link
Member

I think that is a great idea! Maybe a note for make clean could be helpful too for the times when things take a few tries to get built right.

@kieranjol
Copy link
Collaborator Author

YES, make clean has solved my issues a million times. I also notice that mediaarea use autogen a lot, but another tip is that you can often figure out how to build something just by looking at a travis file, for example here's how I build rawcooked: https://github.com/MediaArea/RAWcooked/blob/master/.travis.yml#L44

also here's my awful but effective ubuntu build script for ffmpeg a bunch of other things for when i reinstall ubuntu: https://gist.github.com/kieranjol/116bd33a75cae438cfe125693be50beb

@kfrn
Copy link
Member

kfrn commented Nov 8, 2018

Good idea! It's ages since I've compiled ffmpeg from source - I don't remember specifically, but I assume I just followed the wiki compilation guide. That guide is pretty exhaustive, so there's probably value in having more basic info on compiling from source, preferably something relatively generic that could be applied to other programs than ffmpeg too.

@kieranjol
Copy link
Collaborator Author

Yeah, maybe the key skill here is just not being deterred by the build failures due to a missing dependency. I think that linux and maybe OSX have it so much easier than Windows in this regard, as you can use package managers to install most if not all major dependencies. I don't think I've ever successfully built anything on windows :(

@kfrn
Copy link
Member

kfrn commented Nov 9, 2018

Ha, I don't think I've ever even attempted to build something from source on Windows. My advice to Windows users would probably be to use the Linux subsystem. 😆

@retokromer
Copy link
Member

Currently it can be done also under Windows 10 Pro and Home with the apps (Ubuntu and Debian tested here). There are a few additional installations to be done, but after that is works like a charm. We have an installation script that configures our new computer, running under Linux, macOS or Windows. I can prepare a PR after the AMIA conference, when nobody else does it before.

@ablwr
Copy link
Member

ablwr commented Nov 9, 2018

+++++++++++++++++++

@ablwr
Copy link
Member

ablwr commented Dec 10, 2018

I'd like to see this added and also we should mention that paths need to be changed/updated to point to the locally-compiled ffmpeg rather than the one installed via apt or homebrew, etc. I'm doing that right now! ;D

@ablwr
Copy link
Member

ablwr commented Dec 10, 2018

Oh I'll add that I think there is value in presenting this as a thing to do and just pointing towards the resources (above) that help do this. Knowing what can be done and where to go is at least 80% of the battle, imo! 🥔

@retokromer
Copy link
Member

retokromer commented Feb 28, 2019

Update:

  • Linuxbrew has been merged into Homebrew
  • Sadly, all options have been removed from the official Homebrew formula. Yet parameterisable formulae are now available in taps here and here.

@ablwr
Copy link
Member

ablwr commented Jun 4, 2019

status / thoughts on this?

@retokromer
Copy link
Member

Things are becoming better, but there are still a few issues for an easy cross compiling for all common platforms. (I will possibly meet later this week Carl Eugen in Vienna.)

@ablwr
Copy link
Member

ablwr commented Jun 4, 2019

Tell Carl I say hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@retokromer
Copy link
Member

retokromer commented May 24, 2020

Update:

  • Terminal on Windows 10 works very well now (I presume, it will be officially launched on 28th May with the Version 2004)

This allows to use the same commands on Linux, macOS and Windows!

@kfrn
Copy link
Member

kfrn commented Jun 4, 2020

Update:

  • Terminal on Windows 10 works very well now (I presume, it will be officially launched on 28th May with the Version 2004)

This allows to use the same commands on Linux, macOS and Windows!

That's really cool!

If you'd said a decade ago that Microsoft would now be a big proponent of open-source ...

@retokromer
Copy link
Member

Somethink like

git clone "https://git.ffmpeg.org/ffmpeg.git" <path>

cd <path/folder>

#for <patch>; do git apply <patch>; done

./configure --prefix=/usr/local --enable-shared --enable-version3 \
  --cc=clang --enable-gpl --enable-libfreetype --enable-libmp3lame \
  --enable-librubberband --enable-libtesseract --enable-libx264 \
  --enable-libx265 --enable-libxvid --disable-lzma --enable-libopenjpeg \
  --disable-decoder=jpeg2000 --extra-version=$(date +'%F')

make -j <threads>

make -j <threads> install

make clean

with a few explanation would fit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants