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!

3 thoughts on “How to: Build GLEW on Debian”

  1. have to agree with your choice i was using debian before ubuntu and even though ubuntu is good with hardware detection and user friendly for the new user i still much rather debian

    1. I’m getting to quite liking Debian (or LMDE), too – not sure if I’ll still feel the same way if it doesn’t play ball with my relatively-soon-to-be-purchased rig tho!

  2. Your instructions show what a complete inexperience noob you really are. the method you used, should never be used by anyone ever! building and installing that way leaves you with unremovable packages… do not tell people yo use that method. it is just so irresponsible!!!!

    at the very least you could use sudo checkinstall instead of sudo make install

    … but for a real debian build you should be using these instructions as a template

    after installing dependencies, run the following commands

    dh_make -p the name of the package_then the version number –createorig

    ie

    dh_make -p glew_1.7..0 –createorig

    then

    dpkg-buildpackage

    this will create the .deb package of the program you are building that can be easily installed and uninstalled that is specific for your arcitecture, ie i386 amd64 or whatever you are running…

    cd ..

    then install your package

    sudo dpkg -i *.deb

    or

    sudo dpkg -i your package name_your.version-number_your arcitecture.deb

    ie

    sudo dpkg glew_1.7-0_amd64.deb

Leave a Reply

Your email address will not be published.