Installation of OpenGL and GLUT under Solaris


This document describes (quick and dirty) how to install OpenGL and GLUT libraries under Solaris 7 on a Sun workstation.

The Development Tools:

Make sure you have a Solaris DEVELOPER installation on your machine. This means you have all the header files that are nessesary for program development under Solaris installed. The easiest way is to install Solaris as a development version. This can be done from the normal Solaris installation CD ROM.

After you've done this you should have your /usr/include and /usr/openwin/include directories filled with nice liddle header files.

The C Compiler:

Sun doesn't ship a C or C++ compiler with Solaris. But you're lucky. You don't have to pay :-)

http://www.sunfreeware.com

There you find gcc the GNU Compiler Collection for Solaris precompiled and ready for easy installation. Get the version you like and install it.

> pkgadd gcc-xxxversion

This will install gcc under /usr/local. You can also do this with admintool:

> admintool

Browse->Software
Edit->Add

Then choose Source: "Hard disk" and specify the directory that you've stored the package in.

I recommend also downloading and installation of the libstdc++ library if nessesary for you gcc version.

The OpenGL library

OpenGL should be shipped with Solaris these days. Check if you've already installed it.

> cd /usr/openwin/lib
> ls libGL*

This should print:
libGL.so@     libGLU.so@     libGLw.so@
libGL.so.1*   libGLU.so.1*   libGLw.so.1*
This means that you have the libraries already installed (runtime version).

But are the header files also there?

> cd /usr/openwin/include/GL
> ls

This should print:
gl.h          glu.h         glxmd.h       glxtokens.h
glmacros.h    glx.h         glxproto.h
I have it. But what version is it?

This is a FAQ.

http://www.sun.com/software/graphics/OpenGL/Developer/FAQ-1.1.2.html

Helps you with questions dealing with OpenGL on Sun platforms.

Yes cool. Seems they're ready. Skip the rest of this step and go to GLUT.

You don't already have OpenGL? Your version is too old? Download a new one:

http://www.sun.com/solaris/opengl

Helps you. Make sure to get the nessesary patches for your OS version and install them. BTW. You need root access to do this. Ask you local sysadmin to do it for you. Follow the online guide for installation.

GLUT

Now you have OpenGL but not GLUT. Where can you get it? Look right here:

http://www.sun.com/software/graphics/OpenGL/Demos/index.html

Following the links will take you to this location:

http://reality.sgi.com/opengl/glut3/glut3.html#sun

I've personally downloaded the 32bit version unless I run the 64 bit kernel of Solaris. I've installed GLUT under /usr/local. This is normally a good place for stuff like this.

Well I have it, but when I try to run the samples in progs/ it claims that it can't find libglut.a. To tell your OS where to look for runtime libraries you need to add the path to GLUT to your variable LD_LIBRARY_PATH.

If you're using /bin/sh do something like this:

> LD_LIBRARY_PATH=/lib:/usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/usr/local/sparc_solaris/glut-3.7/lib/glut
> export LD_LIBRARY_PATH

If you're using a csh do something like this:

>setenv LD_LIBRARY_PATH /lib:/usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/usr/local/sparc_solaris/glut-3.7/lib/glut

Verify that everything is correct:

> echo $LD_LIBRARY_PATH
/lib:/usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/usr/local/sparc_solaris/glut-3.7/lib/glut

Congratulations you're done!

That's it folks. Now you should be ready to compile and run NeHe's OpenGL tutorials.

If you find spelling mistakes (I'm not a native english speaking beeing), errors in my description, outdated links, or have a better install procedure please contact me.

- Lakmal Gunasekara 1999 for NeHe Productions.