phensley / python-smhasher

Python 2.x/3.x wrappers for the SMHasher library
MIT License
25 stars 12 forks source link

compilation failure on Ubuntu 12.10 - patch included #5

Closed lebedov closed 10 years ago

lebedov commented 11 years ago

Compilation of python-smhasher fails on Ubuntu 12.10 with the following errors:

error: inlining failed in call to always_inline ‘uint64_t fmix(uint64_t)’: function body can be overwritten at link time

The following patch appears to solve the problem:

--- smhasher/MurmurHash3.cpp.bak    2013-02-13 13:53:35.289521367 -0500
+++ smhasher/MurmurHash3.cpp    2013-02-13 13:53:48.825665790 -0500
@@ -29,7 +29,7 @@

 #else  // defined(_MSC_VER)

-#define    FORCE_INLINE __attribute__((always_inline))
+#define    FORCE_INLINE inline

 inline uint32_t rotl32 ( uint32_t x, int8_t r )
 {
utilitarianexe commented 11 years ago

I did this instead. Just inline does not actually inline in many cases and it seemed to be the authors intention to force it. Although given this was 5 months ago in your post not much hope that there is any active maintenance. FORCE_INLINE inline attribute((always_inline))

phensley commented 10 years ago

I wasn't able to reproduce this locally. I merged in r150 from the upstream MurmurHash repository -- leave a comment if the compile error remains.

utilitarianexe commented 10 years ago

Seems to work for me now. I am on ubuntu 11.10 now though.

phensley commented 10 years ago

Ok thanks, will reopen if it returns