• Home
  • Log
  • Projects
  • Gallery
  • About
  • Contact

GLUT and OpenBSD

October 31st, 2005

I’m an OpenBSD user, have been for a very long time. Aside from my server at home my primary OpenBSD machine is my laptop. I’ve been pushing the limits on this old 333Mhz Dell for quite some time and OpenBSD isn’t always the easiest to find software for. Don’t get me wrong, OpenBSD has a really large library of free software available as packages. However, due to their strict licensing requirements (for good reason) some software packages have been either overlooked or even removed from their list. Seeing that I’m currently working on graphics as part of one of my classes I find it necessary to be using the GLUT (GL Utility Library) for my projects. GLUT was at one time included as a package in OpenBSD but it was removed several versions ago for reasons already stated.

Though the software is still available for download for Unix, this of course means it must be compiled and installed manually. So for my reference and hopefully yours, I’ve included the directions for doing so below.

Start off my untarring the files. “tar -zxvf glut-3.7.tar.gz”. This results in the creation of the ‘glut-3.7′ folder, looking inside we find a mass of README files. I’ve taken the liberty to read them for you, though you should read them anyway (teach a man to fish….).

GLUT provided an imake file to aid in the portability of the software. To make use of this and make the package on OpenBSD simply type ‘mkmkfiles.imake’ This generates the the needed Makefiles for the next step. This step and the following will take some time to complete so have patience. When this is completed follow up with a simple ‘make’.

If these steps have completed successfully you should have all the files you need. These files will be distributed throughout your ‘glut-3.7′ folder. To finish the install of the GLUT package we must locate these files and move them to folders included in our GCC search directories. To accomplish this first I must preface with a little information. As of OpenBSD 3.3 the new XF4 added the Mesa library bindings to the default install. Therefore if you are running XF4 and OpenBSD 3.3 or greater you should already have the necessary libraries. These Mesa library and header files are located in ‘/usr/X11R6/lib’ and ‘/usr/X11R6/include/GL’ respectively.

It is up to you at this point how to handle the final installation of your GLUT files. Take all of the files located in your ‘glut-3.7/include/GL’ folder and copy them into your ‘/usr/X11R6/include/GL’ folder. Then take the ‘/glut-3.7/lib/glut/libglut.a’ file and copy it into ‘/usr/X11R6/lib’ folder. This is for consistency. Since the Mesa libraries are already installed in the X11 directories it makes sense to co-locate the GLUT libraries with them. Of course you could always copy the contents of your X11 libraries into your standard ‘/usr/include’ and ‘/usr/lib’ folders as well. Thirdly you could even create symlinks in the later folders pointing into the former (eg. ‘ln -s /usr/X11R6/include/GL /usr/include/GL’).

Any of these should allow you to correctly compile your GLUT applications. Of course remember to correctly link your libraries at compile time. Good luck.

Posted in Graphics, Programming |


Leave a Reply

  • Pages

    • About
  • Archives

    • October 2008
    • November 2007
    • November 2006
    • October 2006
    • August 2006
    • July 2006
    • June 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • October 2005
    • May 2005
  • Categories

    • Uncategorized (1)
    • Music (1)
    • Graphics (3)
    • Programming (8)
    • Misc (15)
    • Travel (3)
    • Linux (3)
 Use OpenOffice.org

Powered by WordPress Entries (RSS)
and Comments (RSS). 14 queries. 0.261 seconds.