5

I think this is simply a general c++ question:

I'm attempting to compile a local version of ffmpeg on Linux Fedora using the gnu c++ compiler. I have source code in a bunch of folders under:

~/<username>/Downloads/Code/ffmpeg_sources/

which is where I'm attempting to set the config flags to install the build to a target not under this tree but at a root level directory with local shared libraries:

/usr/local/

There is this following section near the beginning of the configuration file:

Standard options:

 --prefix=PREFIX          install in PREFIX []
 --bindir=DIR             install binaries in DIR [PREFIX/bin]
 --datadir=DIR            install data files in DIR [PREFIX/share/ffmpeg]
 --docdir=DIR             install documentation in DIR [PREFIX/share/doc/ffmpeg]
 --libdir=DIR             install libs in DIR [PREFIX/lib]
 --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]
 --incdir=DIR             install includes in DIR [PREFIX/include]
 --mandir=DIR             install man page in DIR [PREFIX/share/man]
 --enable-rpath           use rpath to allow installing libraries in paths
                          not part of the dynamic linker search path

I may have completely misunderstood this, but I thought that setting a value like

--prefix=/usr/local

or

--prefix=[/usr/local]

might work, but it appears not to, as once the ./config, make&&make install is complete, it has done a bunch of stuff but there's nothing installed at the target. There are a LOT of new executable files built in the source directory, so presumably the build is working but I'm simply specifying the paths incorrectly? A part of the same problem is that it's unclear whether, once I've set the

--prefix=[PREFIX]

correctly, I need to set all of the further

--datadir, --libdir

etc. or whether the first --prefix value is enough?

What is the above configuration syntax trying to show me?

whatshisface
  • 79
  • 1
  • 8
  • Related, see [Linux configure/make, --prefix?](https://stackoverflow.com/q/8902698/608639) – jww Sep 29 '19 at 19:17

2 Answers2

4

It should be the first one --prefix=/usr/local but to install files in that location you need root privileges. So you need to either change to the root account su or use sudo if you are a sudo user aka sudo make install. Only do that for the install phase, don't build like that.

Also /usr/local is usually the default install location so you don't usually need to specify that. Normally you only use --prefix to install into a different location like --prefix=/opt or your home folders: --prefix=$HOME/3rdparty.

Incidentally, if you install into your home folder you won't need root privileges.

Galik
  • 47,303
  • 4
  • 80
  • 117
  • oh! thanks for this :0) I don't particularly mind where the local build goes. I'm doing it in order to compile Audacity against those specific ffmep libs. I read/was told that Audacity would look for it at /usr/local... presumably then this is the default for most things? Will try again with the make. Thanks again :0) – whatshisface May 03 '16 at 11:01
0

In my situation, ./configure end up with warning/error, so --prefix= works with the default location (/usr/local). After I sorted out the warning/error, it worked as expected.

jww
  • 97,681
  • 90
  • 411
  • 885
Prasaathviki
  • 1,147
  • 2
  • 11
  • 22