[GRASS-dev] nviz compilation problem

Glynn Clements glynn at gclements.plus.com
Thu Jun 28 07:09:38 EDT 2007


Helena Mitasova wrote:

> thank you for your help - removing $(OPENGLLIB) $(OPENGLULIB) from
> the ogsf/Makefile solved the ogsf compilation problem.
> 
> The nviz compilation still gives a related error:
> 
> Errors in:
> /local/home/helena/grassdev/grass6/visualization/nviz
> 
> /usr/X11R6/lib64/libGL.a(glxcmds.o)(.text+0x32c1): In function `glXGetMscRateOML':
> : undefined reference to `XF86VidModeQueryVersion'

Ick. You should be able to work around this by manually adding
-lXxf86vm to the definition of OPENGLLIB in Platform.make (once
configure has generated it).

Unfortunately, it's hard for configure to detect this sort of thing
when using static libraries.

Linking against a shared library uses the entire library as a
monolithic entity, and will require any dependencies which the library
has.

OTOH, linking against a static library only uses the specific object
files which are actually required to satisfy any unresolved symbols,
and so only requires any dependencies of those specific object files.

The result is that a test program which uses a single function (e.g. 
one generated by autoconf's AC_CHECK_LIB) will typically have fewer
dependencies than the real program (e.g. NVIZ).

E.g. a test program linked against -lGL will only require -lXxf86vm if
it references a function which is defined in glxcmds.o. Currently, the
test is for glBegin, which will certainly be in a different file (the
generic gl* functions and the X11-specific glX* functions are largely
separate), so the test doesn't need -lXxf86vm although NVIZ itself
does.

We could change the autoconf test to check for e.g. glXCreateContext,
which is more likely to require that file. But, ultimately, the only
solution for static libraries is to play "whack-a-mole", continually
adjusting the tests whenever ATI/nVidia change their OpenGL drivers.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list