x264 benchmark compilation & installation guide for Oracle Solaris 11.2 (2014-11-28)
To compile and install the x264 benchmark on Oracle Solaris 11.2 we will need some GNU base software. Additionally I would recommend the installation of a graphical user interface, if not yet existing. This is not absolutely required, but will make things easier. On top of that we need to ensure that the machine has internet access, and then we need to run the following commands as user root. The first one is only required if you still need to or wish to install a graphical user interface, a process after which you should by the way also reboot.
- pkg install solaris-desktop
- pkg install autoconf git gcc
To further simplify the compilation process, I'd suggest to add the path /usr/local/bin to your search path, which is not the default on Oracle Solaris 11.2. Reason is, that our software will be installed into the prefix /usr/local. The search path can be updated temporarily or permanently. The temporary solution (first command) only applies until you log out or close the terminal window. For the permanent one (second command) you will also need to log out / close the terminal once after applying the change, after which it will always apply. The permanent setting is also user specific, so if you want to be able to use it as root or as any other user too, you will need to run the command as each user separately:
- export PATH="$PATH:/usr/local/bin"
- echo "export PATH=\"$PATH:/usr/local/bin\"" >> ~/.bashrc
Yasm on x86 machines
This step is only required on machines using processors with a x86 architecture. If installing on a SPARC machine, yasm may be skipped as the assembler builds highly optimized code only for instruction set extensions like Intel SSE/2/3/4 or AMD LZCNT.
To assemble highly optimized x86 code, we'll compile the yasm assembler ourselves, but you'll need to download it first:
Unpack the archive file by running tar -xzvf ./yasm-1.3.0.tar.gz, and enter the newly created yasm folder. Since yasm is well prepared for Solaris, we can just start configuring and building, this is a relatively simple process:
- ./configure --prefix=/usr/local
- gmake install
yasm should now be locatable and executable on your system (verify by running yasm --version), so we can continue with libav and x264.
The benchmark software itself
To use x264 we need the decoding filters of libavcodec (libav in short) and the x264 encoder itself, which will be linked against libav during the installation. Additionally, we need the input video file, download links are available at the bottom of the [results list].
For simplicities' sake we shall assume that the files are now sitting in /export/home/user/x264src. Additionally we will assume that the yasm assembler is present and locatable. Switch to that directory on the terminal, and start with libav. Unpack it by running something like tar -xzvf <filename.tgz> on the actual file name, after which there will be a libav folder. Enter that folder, and set some environment variables that we will need through the entire remaining process. Should you need to log out or close the terminal window, you need to set those again!
- export CFLAGS="-I/usr/local/include -L/usr/local/lib"
- export CXXFLAGS="-I/usr/local/include -L/usr/local/lib"
- export LDFLAGS="-I/usr/local/include -L/usr/local/lib"
Now start the configuration process for the libav source tree as follows (The opus codec of modern libav is broken on several UNIX systems including Solaris, so we'll disable it):
- ./configure --disable-decoder=opus --disable-parser=opus
Following that we need to edit the make file to prevent the system from invoking the wrong installer. Open the Makefile with your preferred text editor and look for the following block:
install: install-progs install-data
Add the following line exactly before that block, then save the file:
Now we can compule and install the libav suite:
- gmake install
Now libav is installed, and we can handle the last part, x264 itself. Before starting, you should once again ensure that your CFLAGS, CXXFLAGS and LDFLAGS environment variables are still set by executing export. Then, unpack x264 like this: tar -xjvf last_x264.tar.bzw. After that, enter the newly created x264 folder, and open the script configure inside with your favorite text editor. Then look for the following block:
if cc_check "" /usr/lib/64/values-xpg6.o; then
if test -x /usr/ucb/install ; then
elif test -x /usr/bin/ginstall ; then
elif test -x /usr/gnu/bin/install ; then
Replace the entire block with the following:
LDFLAGS="$LDFLAGS -lm -lxnet -lresolv /usr/lib/values-xpg6.o"
Now we can run the configuration by calling configure like this:
- ./configure --prefix=/usr/local (After that, make sure that the output shows "lavf" is "yes". We can only build a functioning x264 if we can link cleanly against libav!
Assuming all went well we can compile x264:
- gmake install
Now, if all worked out nicely, you may verify the functionality of x264 by running x264 --version. Should that work and should x264 show up as being linked against libswscale and libavformat, all is ok. Now you can download the benchmark script for UNIX:
Copy that file launchbenchmark.sh into a folder dedicated to the benchmark, create one in case you haven't already: mkdir -p /export/home/user/x264benchmark. You should also put the input video file elephantsdream_source.264 into that folder.
You you can essentially just run the benchmark. To do that, enter the following command while sitting in your benchmark folder, e.g. /export/home/user/x264benchmark after having made sure that the benchmark script inside is executable (chmod +x ./launchbenchmark.sh):
- time ./launchbenchmark.sh
That could look somewhat like this (click to enlarge). The result can be read from the terminal after the benchmark is done, the important value here is the one that will be shown besides the string "Real":
Depending on the host machine that might take some hours, in extreme cases even days, weeks or months. If you have problems with this guide or if there are any additional questions about the x264 benchmark on Oracle Solaris 11.2, please refer to the [according forum thread] and ask there. The forum is german, but if you ask in english, you will still get a reply, at least by me. :)
[Back to the x264 benchmark results list]
[Comment on this guide]