[vtkusers] Build problem on x86_64 (AMD Opteron) machine.

tom fogal tfogal at apollo.sr.unh.edu
Thu May 27 00:12:53 EDT 2004


It looks like your mesa library was compiled incorrectly... the 'Bad value'
particularly worries me.
Do a 'file' on the mesa shared object, and make sure its 64 bit. If it is,
it was probably just compiled without -fPIC, in which case you'd have to
recompile Mesa with -fPIC. If you must recompile, take special care to
make sure mesa recognizes any hardware acceleration you may have (i'm
assuming you're using DRI?).

My interpretation of fPIC from manpages / random docs. I make no claim to
the accuracy, but its probably pretty close =):
'fPIC' instructs gcc to create _P_osition _I_ndependent _C_ode. Basically
all the variables and function addresses are stored in the binary file,
normally as some kind of "exact" address. fPIC instructs the operating
system that 'the address of all the functions in this binary file isnt
the address listed - its the address listed + X' where X is some integer,
and can vary for each individual address.
Anyway, the upshot is that the system running the executable / library
code that was compiled with fPIC does a symbol lookup instead of just
jmping to a hardcoded address.
http://www.iecc.com/linker/linker10.html seems to be a good page (I havent
read all of it) if you're really interested.

HTH,

-tom

 <opr8mq2fhrp890gu at localhost>Jan Kolar writes:
>Tom,
>
>thanks for your advice, i've got further but still just to another error. 
>It is again regarding relocation R_X86_64_32. To be honest, i do not 
>exactly understand what does the -fPIC specify.
>
>Building shared library 
>/home/kolda/Installations/VTK/bin/libvtkRenderingJava.so...
>/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.1/../../../../x86_64-suse-linux/bin/l
>d: 
>/usr/lib64/libMesaGL.a(glapi.o): relocation R_X86_64_32 can not be used 
>when making a shared object; recompile with -fPIC
>/usr/lib64/libMesaGL.a: could not read symbols: Bad value
>collect2: ld returned 1 exit status
>make[3]: *** [/home/kolda/Installations/VTK/bin/libvtkRenderingJava.so] 
>Error 1
>make[2]: *** [default_target] Error 2
>make[1]: *** [default_target_Rendering] Error 2
>make: *** [default_target] Error 2
>
>I have -fPIC for all CFLAGS now. I think I am really close to the end 
>since the other shared libraries has been build succesfully---this list of 
>the bin directory after the error:
>
>kolda at atlas:~/Installations/VTK> ls bin/
>libvtkCommon.a          libvtkfreetype.a       libvtkIO.a         
>libvtkzlib.a
>libvtkCommonJava.so     libvtkftgl.a           libvtkIOJava.so    
>mkg3states
>libvtkDICOMParser.a     libvtkGraphics.a       libvtkjpeg.a       
>vtkParseJava
>libvtkexpat.a           libvtkGraphicsJava.so  libvtkpng.a        
>vtkWrapJava
>libvtkFiltering.a       libvtkImaging.a        libvtkRendering.a
>libvtkFilteringJava.so  libvtkImagingJava.so   libvtktiff.a
>
>any other ideas? --jan
>
>On Wed, 26 May 2004 11:08:52 -0400, tom fogal <tfogal at apollo.sr.unh.edu> 
>wrote:
>> Jan,
>>
>> rerun ccmake and add '-fPIC' to all the CFLAGS variables. Make sure you 
>> do a
>> 'clean' build, so that all objects are rebuilt.
>> In general, you should compile all of your 64bit libraries with -fPIC.
>>
>> HTH,
>>
>> -tom
>>
>>  <opr8kwif0op890gu at localhost>Jan Kolar writes:
>>> I am trying to build VTK, as obtained recently form CVS, on x86_64
>>> (Opteron) machine.
>>> I cannot get over following error:
>>>
>>> Building shared library
>>> /home/kolda/Installations/VTK/bin/libvtkCommonJava.so...
>>> /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.1/../../../../x86_64-suse-linux/bi
>n/l
>>> d:
>>> /home/kolda/Installations/VTK/bin/libvtkCommon.a(vtkAbstractMapper.o):
>>> relocation R_X86_64_32 can not be used when making a shared object;
>>> recompile with -fPIC
>>> /home/kolda/Installations/VTK/bin/libvtkCommon.a: could not read 
>>> symbols:
>>> Bad value
>>> collect2: ld returned 1 exit status
>>> make[3]: *** [/home/kolda/Installations/VTK/bin/libvtkCommonJava.so] 
>>> Error
>>> 1
>>> make[2]: *** [default_target] Error 2
>>> make[1]: *** [default_target_Common] Error 2
>>> make: *** [default_target] Error 2
>>>
>>> With the same settings in CMakeCache.txt but VTK_WRAP_JAVA:BOOL=OFF I 
>>> make
>>> a clean build. The CMakeCache.txt is pasted at the end of the message. 
>>> Any
>>> suggestion? 	--Jan
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cg
>i-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list