How to: Build GLEW on Debian

GLEW - The GL Extension WranglerI’ve just jumped ship from Ubuntu to Linux Mint Debian Edition (20011-08 RC1, 64-bit Gnome version) because as much as I tried, I just couldn’t get along with Xfce and Thunar, and I’ve had it up to my eyeballs with the Ubuntu desktop experience *@&%ers making decisions for me.

So now I need to be able to build the latest version of a few packages. Again. In this case, it’s GLEW 1.7.0 – but thankfully this one’s pretty do-able:

1.) Install some GLEW build pre-req’s with:

2.) Get the GLEW source and extract it.

3.) If you want to install in /usr/local/ instead of /usr/ (which is generally a good idea for packages you’ve built yourself so you can easily distinguish them from “system packages”) then edit the Makefile in your extracted glew folder and make the following change:

Should be modified to read:

4.) On Debian it appears that /usr/local/lib64 doesn’t already exist as a symlink to /usr/local/lib (which means that you could end up with some of your stuff in the local/lib folder and some in the local/lib64 folder – which would be rubbish), so create the symlink yourself first with:

5.) Run make then sudo make install

6.) Finally, once you have your GLEW stuff installed, don’t forget to link in libGL.so to your OpenGL projects, which if you’re making the switch from Ubuntu to Debian like I am, have now moved from /usr/lib/libGL.so to /usr/lib/x86_64-linux-gnu/libGL.so, at least on my 64-bit setup.

Fun, eh? Sheesh!

How To: Build OpenKinect/LibFreenect in Linux

The Kinect just came out in Australia today, so I’m already a little bit late to the party, but I’m keen to see what I can do with it so I went and picked one up earlier – a couple of minutes after unboxing and it’s happily working with Linux. Awesome =D

The GLView example running on LibFreenect
The GLView example running on LibFreenect

Anyways, here’s what you need to do to build the library for yourself:

  1. Using synaptic or apt-get, install the following packages: libusb1.0-dev, freeglut3-dev, git, cmake
  2. It’s possible you may need to install some other packages as well depending on what you currently have or don’t have installed, but if you need anything additional then cmake will let you know about it when you get to that step.

  3. Download the libFreenect source code using git (this will make a directory for you called libfreenect):

  4. Make a directory inside the c folder where you’ve downloaded the libFreenect source code and use cmake to configure the build:

  5. Actually compile the library:

That’s it – you’re done!

Now you can check out what the kinect’s seeing by going into the examples directory (which will now exist at ~/libfreenect/build/examples) and running ./glview as root:

I think we’re going to have a lot of fun with this… =D

How-To: Install or Build a Working Version of Handbrake for Ubuntu

Update: To install a working version of Handbrake in Ubuntu 10.10 or 11.04, you’ll need to install from the PPA, and you’re probably best off doing so like this…

First, you’ll need to add the Handbrake PPA (personal package archive) to your Ubuntu system. Open up a Terminal window and use this command:
For the official builds:

Or for the nightly builds:

After the repository has been added, update your system’s listing of its repositories with this command:

Once the repository listings have been updated, you can then install the graphical version of Handbrake with this command:

You can also install the command line version of Handbrake with this command:

Props to Jonathon Moeller for his write up on this 10.10 technique.


If You’re Still Want to Build Your Own Copy However…

The currently available pre-packaged version of Handbrake (the Video/DVD transcoder/ripper) at the time of writing is 0.9.4 (actual filename for the 64-bit version: HandBrake-0.9.4-Ubuntu_GUI_x86_64.deb) – and it’s about as much use as a chocolate teapot on Ubuntu 10.04… You simply can’t endcode/transcode with it because it’s broken, with the Add to Queue and Start buttons permanently greyed out because the functionality behind them is mashed.

So let’s build a fresh version that works!

Step 1.) Get the Necessary Libraries

A quick trip to the command line will get everything you need (where everything you already have in this list is simply ignored):

Step 2.) Get the Source Code

Create a folder for it, move to it, then grab the latest source code via subversion like this:

Step 3.) Build It!

Once we’re in the right place, this configure line with the given switch will configure and make Handbrake in one fell swoop:

Step 4.) Test It!

After a successful build, you’ll see the executable HandBrake-CLI in the build folder – but you’re probably after the GUI version, which is tucked away in build/gtk/src and called ghb – just go to the right folder, launch it and give it a try out – should be absolutely mint.

There are a stack of different options for the encoding process which can slow down the encode/transcode process and increase the quality – I went with these final settings to get high encoding quality without the encode process taking all week:

HandBrake - Working
HandBrake - Now Working! Woo-Hoo!

Cheers!

How To: Compile and Use the Dolphin Gamecube/Wii Emulator in Linux

It’s really easy to get this emulator up and working – but you do have to compile it yourself in linux – still, it’s only a couple of commands and you’re set. I did it on Ubuntu 9.10 64-bit and it worked like a charm…

Update (04/07/2011): Easiest way yet – simply add the PPA and get it (for Ubuntu 10.10 & 11.04 32/64 bit only) like this:

Update (Older than above): I found that you can download pre-compiled .deb files for Ubuntu 9.10 here (PPA addition required) – be careful with that sudo apt-get upgrade command in the instructions though – I don’t really think you need it and you probably don’t want to upgrade your entire linux distribution just to play an emulator… I’m confusing sudo apt-get upgrade (which upgrades currently installed packages) with sudo apt-get dist-upgrade (which updates your linux distribution if there is a newer version available) – my bad.

Either way, I’d recommend you just compile it yourself – it only takes a couple of minutes.

Update – Nov 2011: Like anything published, it ages and what might have been correct at the time of writing may no longer be the case – so with that in mind, if you’re going to build your own copy of Dolphin, you’re probably best off going to http://code.google.com/p/dolphin-emu/wiki/Linux_Build and using the instructions there.

Issues: If you’re getting errors along the line of Looking for lib Cg… no. Plugin_VideoOGL must have cg and cggl to be build, then the fix is to install the nvidia-cg-toolkit package with:

With all that done, it takes around five minutes to compile and build, then you can go to the Binary folder inside your source-code download location to find the executable and launch it. Once it’s up and running just go File | Open and point it at an Wii or Gamecube ISO and you’re in business!

Dolphin Gamecube/Wii Emulator

By default you get a gamecube controller bound to the keyboard (Enter = Start button, x = A button, cursor keys up/down/left/right) and an emulated Wiimote is bound to the mouse (where the left mouse button is the A button), but you can use joysticks, real Wiimotes etc as well without too much fuss. Fantastic stuff :)

If you’re having any issues, just read more about linux confix/setup/dependencies here, while the main Dolphin wiki lives here.