[ODE] Build of UNSTABLE fails on AMD-64

Bill Sellers wis at mac.com
Sat Dec 3 02:45:45 MST 2005


Hi, it seems to me that we should use long anytime we cast a pointer  
to an integer anyway - at least on gcc this is recommended since long  
is 4 bytes on 32 bit systems and 8 bytes on 64 bit systems (and for  
all I know it will be 16 bytes on 128 bit systems). You never know,  
someone might get around to standardizing 'long' as the smallest  
integer that will fit a pointer. Intel's compiler also currently  
follows this convention but does complain that there might be  
problems in future. Much neater than having conditional typedefs or  
whatever.

Cheers
Bill

On 2 Dec 2005, at 22:09, Rodrigo Hernandez wrote:

> Ok, like you said, the first problem is easily solved, I did add the
> flag, I am not sure if checks should be made to see if the flag is
> actually needed,
> I know Linux x86 can handle the flag, and Windows just warns that the
> flag has no effect, if someone reports broken compilation because  
> of the
> flag,
> I'll write the propper checks.
>
> The second issue, well, give me some time, it requires adding config.h
> and checking for a platform macro.
>
> Cheers!
>
> Peter Onion wrote:
>
>
>> I just tried to build ode UNSTABLE on my new AMD_64 SuSE 10.0  
>> machine.
>> There are two problems....
>>
>> FIRST PROBLEM
>>
>> g++ -I../../include -I../../include   -g   -o libode.so -shared
>> obstack.o collision_util.o array.o ode.o error.o odemath.o
>> collision_kernel.o export-dif.o quickstep.o collision_quadtreespace.o
>> rotation.o collision_space.o collision_std.o joint.o
>> step.o collision_transform.o lcp.o stepfast.o mass.o testing.o mat.o
>> timer.o matrix.o util.o memory.o misc.o fastldlt.o fastltsolve.o
>> fastdot.o fastlsolve.o   -lstdc++ -lm -lpthread
>> /usr/lib64/gcc/x86_64-suse-linux/4.0.2/../../../../x86_64-suse- 
>> linux/bin/ld: obstack.o: relocation R_X86_64_32 against `a local  
>> symbol' can not be used when making a shared object; recompile  
>> with -fPIC
>> obstack.o: could not read symbols: Bad value
>> collect2: ld returned 1 exit status
>> make[2]: *** [libode.so] Error 1
>>
>>
>> As gcc helpfully pointed out the addition of "-fPIC" to the flags  
>> in the
>> Makefile.am in the ode src directory fixed it....
>>
>> SECOND PROBLEM
>> if g++ -DHAVE_CONFIG_H -I. -I. -I../../include/ode   -g -g
>> -I../../include -I../../include -g -MT test_space.o -MD -MP -MF
>> ".deps/test_space.Tpo" -c -o test_space.o test_space.cpp; \
>> then mv -f ".deps/test_space.Tpo" ".deps/test_space.Po"; else rm -f
>> ".deps/test_space.Tpo"; exit 1; fi
>> test_space.cpp: In function ‘void nearCallback(void*, dxGeom*,
>> dxGeom*)’:
>> test_space.cpp:127: error: cast from ‘void*’ to ‘int’ loses precision
>> test_space.cpp:128: error: cast from ‘void*’ to ‘int’ loses precision
>> make[2]: *** [test_space.o] Error 1
>>
>>
>> The code in question is
>>
>> 124 static void nearCallback (void *data, dGeomID o1, dGeomID o2)
>>    125 {
>>    126   int i,j;
>>    127   i = (int) dGeomGetData (o1);
>>    128   j = (int) dGeomGetData (o2);
>>    129   if (i==j)
>>    130     printf ("collision (%d,%d) is between the same object
>> \n",i,j);
>>    131   if (!good_matrix[i][j] || !good_matrix[j][i])
>>    132     printf ("collision (%d,%d) is incorrect\n",i,j);
>>    133   if (test_matrix[i][j] || test_matrix[j][i])
>>    134     printf ("collision (%d,%d) reported more than once 
>> \n",i,j);
>>    135   test_matrix[i][j] = 1;
>>    136   test_matrix[j][i] = 1;
>>    137 }
>>
>> Since pointers and ints are nolonger the same size on AMD_64s this  
>> won't
>> work anymore....  The pointers will either have to be used to  
>> actually
>> point at something, or cast them to a long (OK until we all have  
>> 128 bit
>> machines !).
>>
>> Peter
>>
>>
>> _______________________________________________
>> ODE mailing list
>> ODE at q12.org
>> http://q12.org/mailman/listinfo/ode
>>
>>
>>
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>

--
Dr. Bill Sellers, Editor Primate Eye   Email:  
William.Sellers at manchester.ac.uk
Faculty of Life Sciences               Tel.   0161 275 1719
3.614 Stopford Building                Fax:   0161 275 3938
The University of Manchester           Mob:   0775 107 8997
Oxford Road, Manchester, M13 9PT, UK   http://sellers.sbc.man.ac.uk/ASL/

Primate Society of Great Britain WWW site http://www.psgb.org/





More information about the ODE mailing list