How to compile and run FRAPIX on Ubuntu

In my quest to look for more On-Screen Displays (OSD) for showcasing framerates in OpenGL games on Ubuntu, I’ve come across Frapix.

Now, to get this up and running, we’ll need to build it from source code. It’s not that difficult, but I would put this at intermediate difficulty especially if you’ve never coded or compiled anything before.

Compiling FRAPIX

Download the source code

To start, we’ll need the source code for two things. libimago and frapix.

Just click Download Zip for each. You’ll want to extract both of those onto your Desktop to make things easy.

Alternatively, if you don’t want to you use the Download Zip button but instead want to use git, we could do it like this. The following will clone (download) the source code to whichever directory your Terminal is currently in:

git clone https://github.com/jtsiomb/libimago
git clone https://github.com/jtsiomb/frapix

Installing the dependencies

Before compiling, we need a couple of things installed first. Go ahead and copy/paste this into a Terminal and hit Enter.

sudo apt-get install -y libx11-dev mesa-common-dev libjpeg-dev libpng-dev

Alright, we’re set, let’s first build and install libimago. After that we can build and install frapix.

Building libimago

First, cd into libimago’s folder wherever you extracted it to. For me, that’s on the desktop. This is what it should look like (ismail is my username).

cd '/home/ismail/Desktop/libimago-master'

Now, let’s start building it. Enter the following one-by-one.

./configure
make

This is what it should look like so far:

Installing libimago

Hopefully, no errors turn up here. Time to install it system wide.

sudo make install

Building FRAPIX

With that done, we can now build frapix. Open a new Terminal, and CD into the frapix source code folder wherever you extracted it. For me, that is on the desktop and looks something like this:

cd '/home/ismail/Desktop/frapix-master'

Now, let’s start building it.

make

Installing FRAPIX

sudo make install

That’s it, we’re done! You should now be able to run frapix with any OpenGL application or game and get a suitable fps OSD to display. The cool thing about frapix is that it changes the color of the numbers depending on the background color. If it’s a dark background, the OSD turns to a bright color to constrast it and vice versa.

Running FRAPIX

To test if frapix is working, we can run it with glxgears like so:

frapix glxgears

You should see a neat little OSD with fps numbers on the top right like I do. If you want to run it with Steam games, that’s also possible. Just right click your favourite game in Steam, and add the following to the Launch Options for that game like so:

LD_PRELOAD=/usr/local/lib/libfrapix.so %command%

Click OK and now all you have to do is start the game, it should work! This is what I get in Cities Skylines:

There is one problem though. If you’re on a 32bit OS, you should be fine. However, if you’re on a 64bit OS like me, you’ll end up with the 64bit version of frapix. What does this mean? Any game or OpenGL application that is 32bit-only will not have the frapix OSD appear.

I’m not yet sure how to overcome this problem, as there doesn’t seem to be a way to have both the 32bit version and 64bit version installed at the same time unlike GLXOSD.

Additionally, I have been unable to get any OSD to work in Wine which is the ultimate goal I’m setting out to achieve here. So, sadly, this does not work in Wine.

This should work on any Ubuntu version, but I’ve only really tested it on Ubuntu 15.04 (both 32bit and 64bit versions). I hope this post was helpful to you in one way or another! 😀

6 Responses to How to compile and run FRAPIX on Ubuntu

  1. followtechtr says:

    Is it quote article, user name you are using ismail 🙂

    Your youtube channel you are using on videos purple fps counter is that?

  2. followtechtr says:

    Is your name ismail? You are using username ismail 🙂

    And this fps counter your youtube videos on them purple one?

  3. Nuclear says:

    I’m sorry to admit it, but the changing color of the fps counter is not intentional, and certainly doesn’t depend on the background. It’s just a bug 🙂 And it should be very easy to fix in fact, I just never bothered to do so.

Leave a comment