[GRASS-dev] nviz compilation problem

Glynn Clements glynn at gclements.plus.com
Wed Jun 27 00:53:37 EDT 2007


Helena Mitasova wrote:

> I have compiled the CVS GRASS63 on a new 64bit computer with nvidia  
> graphics card running
> RedHat Enterprise Linux. Everything compiled successfully except for  
> nviz that has some troubles with
> shared GL libraries.
> I have seen others with similar problems (I had it on another machine  
> too ) mostly due to broken symlink,
> but that does not seem to be the case here:
> 
> Errors in:
> /local/home/helena/grassdev/grass6/lib/ogsf
> /local/home/helena/grassdev/grass6/visualization/nviz
> 
> (cd /local/home/helena/grassdev/grass6/dist.x86_64-unknown-linux-gnu/lib; ln -f -s libgrass_ogsf.6.3.cvs.so /local/home/helena/grassdev/grass6/dist.x86_64-unknown-linux-gnu/lib/libgrass_ogsf.so)
> /usr/bin/ld: /usr/X11R6/lib64/libGL.a(glapi.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
> /usr/X11R6/lib64/libGL.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make: *** [/local/home/helena/grassdev/grass6/dist.x86_64-unknown-linux-gnu/lib/libgrass_ogsf.6.3.cvs.so] Error 1
> 
> what to recompile with -fPIC?

libGL.a :(

> if that is really the problem?

The main problem is that you have a static libGL rather than a shared
libGL. The GRASS build system tends to assume that all external libraries
are shared libraries (unless building with --disable-shared, in which
case either will work).

You can probably work around it by removing $(OPENGLLIB) $(OPENGLULIB)
from the definition of EXTRA_LIBS in lib/ogsf/Makefile, and adding them
either to the definition of OGSFLIB in include/Make/Grass.make[.in] or to
the individual Makefiles (primarily, visualization/nviz/src/Makefile).

Actually, the NVIZ Makefile adds these explicitly, and r3.showdspf is no
longer compiled, so simply removing them from lib/ogsf/Makefile will
probably suffice.

Ideally, external shared libraries would be linked into the library while
external static libraries would be linked into each module which uses the
library. But I have no idea how to tell whether an external library is
shared or static; configure just checks whether adding "-l<library>"
works.

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




More information about the grass-dev mailing list