Perl OpenGL Installation

Setup

  • POGL depends on Perl; 5.8.x is recommended.

  • On X11 platforms, update your X11 libs.

  • Install the latest OpenGL drivers for your platform and video card.

  • Install FreeGLUT (or compatible); FreeGLUT libraries may be downloaded from freeglut.sourceforge.net.

  • Build/install POGL.

  • If you plan to use ImageMagick with OpenGL::Image, you need to install ImageMagick first. Version 6.3.5 or newer is strongly recommended to leverage new POGL APIs added to PerlMagick.

    Note: If you simply need to load/save Targa files (uncompressed RGBA), you can use the default Targa driver that comes with OpenGL-Image (v0.00_2 or newer) - there's no need to install ImageMagick.

  • Build/Install OpenGL-Image.

  • Build/Install OpenGL-Shader.

    Binaries

    Windows:
    It is recommended that you install POGL via ActivePerl PPM Binaries, and skip all the steps below.
    If you prefer to build from source, you'll need VC++ 6.

    Building From Source

  • Download the source; extract as appropriate.

  • Read the INSTALL and the README files applicable to your installation.

    For standard installations on supported platforms, use the following instructions for all POGL packages (OpenGL, OpenGL-Image. OpenGL-Shader):

    • perl Makefile.PL
    • make
    • make test
    • sudo make install

    Note: for Windows, use nmake instead of make, and omit sudo.

    Read the following for more detailed build information.

    Unsupported Platforms and Cards

    OpenGL libraries and GPU drivers are named and located in different places on various platforms; The POGL team has made every effort to support a broad range of platforms and OpenGL installations... however - for some older cards, and for platforms that have not been tested with POGL, you may need to modify library names and locations in Makefile.PL.

  • You can add libs to @check_libs.

  • You can add lib search directories to $libdirs.

  • You can add include file search directories to $includes.

  • You may also need to modify the get_libs function.

    If you succeed in getting Makefile.PL to work on an unsupported platform, please send notes, patches and test.pl console output to the POGL team.

    Alternate Installations

    If you wish to install POGL to an alternate location, you can add the following Makefile.PL options:

      PREFIX=DESTFOLDER LIB=DESTFOLDER

    Where DESTFOLDER is the alternative location.

    Note: if you use alternative installations, you need to let Perl know where they are. This can be done through any of the following methods:

    • Reconfiguring Perl @LIB global variable
    • Setting your PERL5LIB environment variable
    • If using mod_perl, add use lib 'DESTFOLDER'; in your startup code
    • Adding use lib 'DESTFOLDER'; to your Perl code

    Makefiles

  • Run: perl Makefile.PL

      If you have GLUT installed, this will build a glversion utility, which will query your OpenGL installation and determine what version and extensions it supports.

      From this, Makefile.PL will create a gl_exclude.h header file that will be used to exclude features not supported by your installation. You can edit this file to override or add feature support.

      If you intend to build a distributable binary (eg: an ActivePerl PPM), delete the contents of this file (but do not delete the file).

      At this point, you may see a bunch of warnings indicating possible missing files. This is MakeMake atempting to guess where all your libs are.

      Unless you see No OpenGL libs found, you are probably OK. If you see this message, or if no makefile is created, then Makefile.PL was unable to locate your OpenGL libs; try the steps for Unsupported Platforms and Cards above.

      If you get past this point, Makefile.PL has created a makefile appropriate for your platform and OpenGL installation.

  • Run: make (use nmake on Windows)

      Depending on your libs and header files, you may see some compile warnings during the build process. If you get a build error, try the steps for Unsupported Platforms and Cards above.

      If you get a link error, send your console output, OS/version, and OpenGL lib names/locations to the POGL team for investigation.

  • Run: make test (use nmake on Windows)

      This will attempt to run test.pl - which depends on GLUT; if you do not have GLUT installed, this will fail.

      Note: if you have an X11-based system, you may be able to use POGL with glpOpenWindow instead of GLUT. Most of the sample code in the examples folder of POGL's source distribution (eg: cube) use glpOpenWindow, instead of GLUT. If these run, you can still use POGL, but won't be able to use any of the GLUT APIs. It is strongly recommended that you install GLUT to simplify the installation and testing process.

      If you have the latest version of GLUT installed and test.pl fails to run, send your console output, OS/version, and OpenGL lib names/locations to the POGL team for investigation.

      If test.pl runs (you should see a spinning cube), then hit q or ESC (note: the test window must have keyboard focus).

  • Run: sudo make install (use nmake install on Windows)

      If you encounter installation problems, send your console output, OS/version, and OpenGL lib names/locations to the POGL team for investigation.