tos has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

after an enervating installation-process including recompilation of gcc-2.95.3 to support f77 and several problems with lib-references and glx i finally succeeded in the installation of PDL v2.4.0 on my Linux-2.4.20-Athlon-System with perl, v5.8.0 built for i686-linux-thread-multi.

As a reward i now want to enjoy a visual pleasant 3D-Plot which i saw in a PC-journal. The plot should show a 3d-function in three partially coloured lattice-levels on top of each other.

#!/usr/bin/perl use strict; use warnings; use PDL; use PDL::Graphics::TriD; my $size = 25; # compute coordinates of the surface my $x = (xvals zeroes $size+1, $size+1)/$size; my $y = (yvals zeroes $size+1, $size+1)/$size; my $z = 0.5 + 0.5 * (sin($x*6.3) * sin($y*6.3)) ** 3; # coordinates determ color my $r=$x; my $g=$y; my $b=$z; # create 3d-plot imag3d [$x,$y,$z]; hold3d(); # ... colored surface above imag3d_ns [$x,$y,$z], [$r,$g,$b]; # ... colored lattice below lattice3d [$x,$y,$z-1], [$r,$g,$b];
Unfortunately all i get is
# perl pdl perl: error while loading shared libraries: /usr/local/lib/perl5/site_ +perl/5.8.0/i686-linux-thread-multi/auto/PDL/Graphics/OpenGL/ +: undefined symbol: gluOrtho2D
Any suggestions ?

thanks in advance, tos

p.s.: which documation would you recommend for piddle-newbies ?

Replies are listed 'Best First'.
Re: PDL-problem: undefined symbol: gluOrtho2D
by fglock (Vicar) on Jun 29, 2003 at 12:27 UTC

    It looks like it is a known problem:

    It seems to be related to PDL installation options, see INSTALL file. It might be looking for libraries in the wrong place.

    Q: I want TriD, but include files are not found. A: You need to add -I/usr/openwin/include etc. (or whatever is appropr +iate on your platform) to the relevant entry in perldl.conf (see above), i.e. something like OPENGL_INC => '-I/usr/openwin/include', Additionally, you might have to specify name and location of the appro +priate library on your platform, e.g. OPENGL_LIBS => '-L/usr/openwin/lib -L/usr/X11R6/lib -L/usr/lib/mesa -lGL'. ' -lGLU -lXext -lX11', You may also need to pass some flags to cpp, see the README in the PDL/Graphics/TriD/OpenGL directory for details. OPENGL_DEFINE => '-DGL_GLEXT_LEGACY', Then, start the build process again as described above (from the toplevel): perl Makefile.PL etc... Q: Compilation of TriD complains about undefined functions or somesuch +. A: Please see the file Graphics/TriD/OpenGL/README. If that doesn't h +elp please report this problem to, include +the appropriate platform and GL version information.
      Hi fglock,

      your hint showed the right direction.

      After installation of MesaLib-5.0.1 to /usr/local/lib i modified perldl.conf as follows

      ... OPENGL_LIBS => '-L/usr/local/lib -lGL -lGLU -lXext -lX11', # Mesa need -DGL_GLEXT_LEGACY for glPolygonOffsetEXT amoung others OPENGL_DEFINE => '-DGL_GLEXT_LEGACY', OPENGL_INC => '-I/usr/include/GL/', ...
      Then i made PDL once more. Now the gluOrtho2D-error does no more appear and i get a window with GL-visualisation. Not quite the hoped-for, but this must have to do with the script itself. That means my main-problem is solved.

      Thank you, :)

Re: PDL-problem: undefined symbol: gluOrtho2D
by Mirage (Sexton) on Jun 29, 2003 at 12:48 UTC

    sorry about asking, but you do have glu installed, do you?
    (and had while compiling pdl)