vaizard / abandoned-MurmurHash3PHP

A C++ fork/rewrite of the smhasher project to bring Murmurhash v.3 to the Linux shell and to the PHP scripting language.
http://murmur.vaizard.org/en/
GNU General Public License v3.0
21 stars 13 forks source link

Centos/Rhel 5.7 Compile Problem #4

Open Qubitium opened 12 years ago

Qubitium commented 12 years ago

On SL 6.1 (RHEL 6.1) everything compiles fine with php 5.3.8 on a 64bit machine. But on a Centos 5.7 64bit machine it does not compile.

[root@penguin1 murmur]# make /bin/sh /root/murmur/libtool --mode=compile g++ -I. -I/root/murmur -DPHP_ATOM_INC -I/root/murmur/include -I/root/murmur/main -I/root/murmur -I/xingwww/php5/include/php -I/xingwww/php5/include/php/main -I/xingwww/php5/include/php/TSRM -I/xingwww/php5/include/php/Zend -I/xingwww/php5/include/php/ext -I/xingwww/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/murmur/MurmurHash3.cpp -o MurmurHash3.lo g++ -I. -I/root/murmur -DPHP_ATOM_INC -I/root/murmur/include -I/root/murmur/main -I/root/murmur -I/xingwww/php5/include/php -I/xingwww/php5/include/php/main -I/xingwww/php5/include/php/TSRM -I/xingwww/php5/include/php/Zend -I/xingwww/php5/include/php/ext -I/xingwww/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/murmur/MurmurHash3.cpp -fPIC -DPIC -o .libs/MurmurHash3.o /root/murmur/MurmurHash3.cpp: In function ‘void MurmurHash3_x86128(const void, int, uint32t, void)’: /root/murmur/MurmurHash3.cpp:80: sorry, unimplemented: inlining failed in call to ‘uint32_t getblock(const uint32t, int)’: function not inlinable /root/murmur/MurmurHash3.cpp:198: sorry, unimplemented: called from here /root/murmur/MurmurHash3.cpp:80: sorry, unimplemented: inlining failed in call to ‘uint32_t getblock(const uint32t, int)’: function not inlinable /root/murmur/MurmurHash3.cpp:199: sorry, unimplemented: called from here /root/murmur/MurmurHash3.cpp:80: sorry, unimplemented: inlining failed in call to ‘uint32_t getblock(const uint32t, int)’: function not inlinable /root/murmur/MurmurHash3.cpp:200: sorry, unimplemented: called from here /root/murmur/MurmurHash3.cpp:80: sorry, unimplemented: inlining failed in call to ‘uint32_t getblock(const uint32t, int)’: function not inlinable /root/murmur/MurmurHash3.cpp:201: sorry, unimplemented: called from here /root/murmur/MurmurHash3.cpp:93: sorry, unimplemented: inlining failed in call to ‘uint32_t fmix(uint32_t)’: function not inlinable /root/murmur/MurmurHash3.cpp:264: sorry, unimplemented: called from here /root/murmur/MurmurHash3.cpp:93: sorry, unimplemented: inlining failed in call to ‘uint32_t fmix(uint32_t)’: function not inlinable /root/murmur/MurmurHash3.cpp:265: sorry, unimplemented: called from here /root/murmur/MurmurHash3.cpp:93: sorry, unimplemented: inlining failed in call to ‘uint32_t fmix(uint32_t)’: function not inlinable /root/murmur/MurmurHash3.cpp:266: sorry, unimplemented: called from here /root/murmur/MurmurHash3.cpp:93: sorry, unimplemented: inlining failed in call to ‘uint32_t fmix(uint32_t)’: function not inlinable /root/murmur/MurmurHash3.cpp:267: sorry, unimplemented: called from here make: *\ [MurmurHash3.lo] Error 1


Here is the GCC version on Centos 5.7

[root@penguin1 murmur]# gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux Thread model: posix gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)

Qubitium commented 12 years ago

Temp Fix: Remove all references to _FORCEINLINE made it compile. Likely it is not compatible with older version of gcc shipped with rhel 5.X.

Is there a reason for the FORCE_INLINE?

Qubitium commented 12 years ago

Macro change to detect RHEL 5's gcc which is 4.1.

if defined(GNUC) && ((GNUC > 4) || (GNUC == 4 && GNUC_MINOR >= 4))

/* gcc version >= 4.4 4.1 = RHEL 5, 4.4 = RHEL 6. Don't inline for RHEL 5 gcc which is 4.1*/

define FORCE_INLINE attribute((always_inline))

else

define FORCE_INLINE

endif