[muscle] Re: Patching MUSCLE to compile on AMD64

  • From: Lior Okman <lior.okman@xxxxxxxxxxxxxxxxxxxxxxxx>
  • To: muscle@xxxxxxxxxxxxx
  • Date: Sat, 28 Jan 2006 18:51:52 +0200


Hi Jeremy,

Here is the compiler output:

lior:~/muscle/server$ make
g++ -I.. -DMUSCLE_SINGLE_THREAD_ONLY -DMUSCLE_ENABLE_ZLIB_ENCODING -O3
-DMUSCLE_ENABLE_MEMORY_TRACKING -c -o Message.o ../message/Message.cpp
g++ -I.. -DMUSCLE_SINGLE_THREAD_ONLY -DMUSCLE_ENABLE_ZLIB_ENCODING -O3
-DMUSCLE_ENABLE_MEMORY_TRACKING -c -o AbstractMessageIOGateway.o
../iogateway/AbstractMessageIOGateway.cpp
../util/Hashtable.h: In member function ‘uint32
muscle::HashFunctor<T>::operator()(T) const [with T = muscle::PulseNode*]’:
../util/Hashtable.h:697: instantiated from ‘uint32
muscle::Hashtable<KeyType, ValueType,
HashFunctorType>::ComputeHash(const KeyType&) const [with KeyType =
muscle::PulseNode*, ValueType = bool, HashFunctorType =
muscle::HashFunctor<muscle::PulseNode*>]’
../util/Hashtable.h:292: instantiated from ‘bool
muscle::Hashtable<KeyType, ValueType,
HashFunctorType>::ContainsKey(const KeyType&) const [with KeyType =
muscle::PulseNode*, ValueType = bool, HashFunctorType =
muscle::HashFunctor<muscle::PulseNode*>]’
../util/PulseNode.h:85: instantiated from here
../util/Hashtable.h:30: error: cast from ‘muscle::PulseNode*’ to
‘uint32’ loses precision
make: *** [AbstractMessageIOGateway.o] Error 1


Similar errors occur for the other two files I changed in the patch. I
think that the problem is that the hash functor assumes that the address
used to generate the hashcode is 32bit wide, and this is not true for
64bit architectures.

I'm using g++ version 4.0, which is the default g++ compiler on Debian
for AMD64 (unstable branch).

g++ (GCC) 4.0.3 20060115 (prerelease) (Debian 4.0.2-7)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Regards,
Lior

Jeremy Friesner wrote:

>Hi Lior,
>
>Thanks for the patch.  From looking at the changes, it's not clear to me why 
>they are necessary for the code to build.  Can you send me the errors that the 
>compiler generates when you try to compile the unpatched code?  I want to 
>understand the issue better before I merge the changes into the CVS tree.
>
>Thanks,
>Jeremy
>
>  
>
>>Hi,
>>
>>
>>Attached is a patch for making MUSCLE compile on AMD64.
>>
>>After applying this patch MUSCLE compiles, but I'm afraid I haven't done
>>any real testing on the result (other than the most basic - it runs and
>>MUSCLE clients can connect and send basic messages).
>>
>>Regards,
>>Lior
>>
>>    
>>
>
>
>
>  
>


Other related posts: