0.29 benchmark compilation fails on stange printf with PRIu64

Bug #923183 reported by Alexander Piavlo
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Gearman
Fix Released
Low
Brian Aker

Bug Description

  CXX benchmark/benchmark.lo
benchmark/benchmark.cc: In function 'void benchmark_check_time(gearman_benchmark_st*)':
benchmark/benchmark.cc:30: error: expected `)' before 'PRIu64'
cc1plus: warnings being treated as errors
benchmark/benchmark.cc:40: warning: conversion lacks type at end of format [-Wformat]
benchmark/benchmark.cc:40: warning: too many arguments for format [-Wformat-extra-args]
make[1]: *** [benchmark/benchmark.lo] Error 1
make[1]: Leaving directory `/root/programs/gearman/gearmand-trunk-487'
make: *** [all] Error 2

Revision history for this message
Brian Aker (brianaker) wrote :

What platform is this?

Changed in gearmand:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
piavlo (piavka) wrote :

# uname -a
Linux dev4.internal 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 athlon i386 GNU/Linux

# cat /etc/issue
CentOS release 5.6 (Final)
Kernel \r on an \m

Revision history for this message
Didier Fabert (dfabert) wrote :

Same thing here with CentOS 5.7 but compile on CentOS 6.2

found in configure.log
checking the location of cstdint... <boost/cstdint.hpp>
checking the location of cinttypes... configure: WARNING: Could not find a cinttypes header.
<inttypes.h>
checking for x86_64-redhat-linux-gnu-pkg-config... no

The problem is not a warning but an error and the configure script must exit with error status if not found (compilation error)

Revision history for this message
Didier Fabert (dfabert) wrote :

Try this for CentOS 5 before launching configure script

yum install gcc44 g++44

export CC='gcc44'
export CXX='g++44'

the error are gone away and compilation success.

Revision history for this message
John Freund (john-freund) wrote :

I think you mean to install the package "gcc44-c++" and not "g++44". Once doing this I finally... finally got gearmand to build. My god, what an awful build process this was.

Revision history for this message
Brian Aker (brianaker) wrote : Re: [Bug 923183] 0.29 benchmark compilation fails on stange printf with PRIu64

Hi,

We have zero CentOS boxes (and the support has zero customers using it).

CentOS is very much an after thought. Fedora and Ubuntu are what we typically support.

Cheers,
 -Brian

On Feb 10, 2012, at 2:26 PM, John Freund wrote:

> I think you mean to install the package "gcc44-c++" and not "g++44".
> Once doing this I finally... finally got gearmand to build. My god,
> what an awful build process this was.
>
> --
> You received this bug notification because you are subscribed to
> Gearman.
> https://bugs.launchpad.net/bugs/923183
>
> Title:
> 0.29 benchmark compilation fails on stange printf with PRIu64
>
> Status in Gearman Server and Client Libraries:
> Incomplete
>
> Bug description:
> CXX benchmark/benchmark.lo
> benchmark/benchmark.cc: In function 'void benchmark_check_time(gearman_benchmark_st*)':
> benchmark/benchmark.cc:30: error: expected `)' before 'PRIu64'
> cc1plus: warnings being treated as errors
> benchmark/benchmark.cc:40: warning: conversion lacks type at end of format [-Wformat]
> benchmark/benchmark.cc:40: warning: too many arguments for format [-Wformat-extra-args]
> make[1]: *** [benchmark/benchmark.lo] Error 1
> make[1]: Leaving directory `/root/programs/gearman/gearmand-trunk-487'
> make: *** [all] Error 2
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gearmand/+bug/923183/+subscriptions

Brian Aker (brianaker)
Changed in gearmand:
status: Incomplete → Triaged
Revision history for this message
symphonyx (erich-beyrent) wrote :

John - can you be more specific about how you got this to work?

Revision history for this message
symphonyx (erich-beyrent) wrote :

Here's how I fixed this issue for CentOS - once I made these changes, I was able to compile successfully.

Revision history for this message
Karl Debisschop (karl-debisschop) wrote :

The minimal change is to include inttypes.h, as per the diff below. For older RHEL-based systems, there are a few environment settings also requierd which are incorporated in the attached RPM spec file, which you can use to build an RPM for RHEL/Centos 5 that will install cleanly with no components in /usr/local

> cat ~/rpmbuild/SOURCES/gearmand-benchmark-rhel5.patch
--- benchmark/benchmark.cc-orig 2012-03-01 03:40:08.000000000 -0500
+++ benchmark/benchmark.cc 2012-03-01 03:42:43.000000000 -0500
@@ -12,6 +12,7 @@
  */

 #include <benchmark/benchmark.h>
+#include <inttypes.h>
 #include <stdio.h>

 /*

Brian Aker (brianaker)
Changed in gearmand:
assignee: nobody → Brian Aker (brianaker)
status: Triaged → Fix Committed
milestone: none → 0.29
Revision history for this message
cgsmith105 (cgsmith105) wrote :

Hello,

I have had just the most horrible time compiling Gearman 0.28. I understand this fix has been committed in 0.29, but for this is for people who had the same problems as I have.

I am running the following CentOS and cPanel versions:

# uname -a
Linux 2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:13:52 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/redhat-release
CentOS release 5.8 (Final)

# /usr/local/cpanel/cpanel -V
11.30.6 (build 4)

I could not install using "pecl install gearman" because it errors at libgearman not installed. I could not install libgearman because Boost was not up-to-date. After updating Boost, I could not make Gearman 0.28 because of this bug.

Here are the steps I did to fix the errors:

*****Fix Boost 1.39 >= must be installed issue*****:

1. Download epel-release-5-4.noarch.rpm (or suitable version) from http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F

2. Install the EPEL repo list using "rpm -Uvh epel-release-5-4.noarch.rpm"

3. yum install boost141-devel

4. ln -s /usr/include/boost141/boost/ /usr/include/boost

5. export LDFLAGS="-L/usr/lib64/boost141"

6. export LD_LIBRARY_PATH=/usr/lib64/boost141:$LD_LIBRARY_PATH

*****Fix Gearman benchmark.lo error (before 0.29) *****:
1. yum install gcc44 gcc-c++

2. export CC="gcc44"

3. export CXX="g++44"

*****Configure, Make, Make Install (no rinsing or repeating)*****:
1. ./configure in your gearman folder after using wget for the current release

2. make

3. make install

*****INSTALL THE PECL EXTENSION!!! YAY!*****:
1. pecl install gearman

If you're running cPanel 11.31.2.x and lower, like me, you will have to copy it to the correct location due to a cPanel bug.

2. cp gearman.so /usr/local/lib/php/extensions/no-debug-non-zts-20090626 (for me - check yours!)

3. chmod 775 gearman.so for good measure!

More importantly, give me a call if you need any help... seriously. This was the biggest pain in the ass and I'm a newbie in the Linux world.

Number can be found at http://www.cgsmith.net/

Thanks guys!
Chris Smith

Revision history for this message
Brian Aker (brianaker) wrote : Re: [Bug 923183] Re: 0.29 benchmark compilation fails on stange printf with PRIu64
Download full text (3.2 KiB)

http://download.datadifferential.com/gearmand-0.29.tar.gz

Cheers,
 -Brian

On Mar 14, 2012, at 7:21 PM, Chris Smith wrote:

> Hello,
>
> I have had just the most horrible time compiling Gearman 0.28. I
> understand this fix has been committed in 0.29, but for this is for
> people who had the same problems as I have.
>
> I am running the following CentOS and cPanel versions:
>
> # uname -a
> Linux 2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:13:52 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
>
> # cat /etc/redhat-release
> CentOS release 5.8 (Final)
>
> # /usr/local/cpanel/cpanel -V
> 11.30.6 (build 4)
>
>
> I could not install using "pecl install gearman" because it errors at libgearman not installed. I could not install libgearman because Boost was not up-to-date. After updating Boost, I could not make Gearman 0.28 because of this bug.
>
> Here are the steps I did to fix the errors:
>
>
> *****Fix Boost 1.39 >= must be installed issue*****:
>
> 1. Download epel-release-5-4.noarch.rpm (or suitable version) from
> http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F
>
> 2. Install the EPEL repo list using "rpm -Uvh epel-
> release-5-4.noarch.rpm"
>
> 3. yum install boost141-devel
>
> 4. ln -s /usr/include/boost141/boost/ /usr/include/boost
>
> 5. export LDFLAGS="-L/usr/lib64/boost141"
>
> 6. export LD_LIBRARY_PATH=/usr/lib64/boost141:$LD_LIBRARY_PATH
>
> *****Fix Gearman benchmark.lo error (before 0.29) *****:
> 1. yum install gcc44 gcc-c++
>
> 2. export CC="gcc44"
>
> 3. export CXX="g++44"
>
>
> *****Configure, Make, Make Install (no rinsing or repeating)*****:
> 1. ./configure in your gearman folder after using wget for the current release
>
> 2. make
>
> 3. make install
>
> *****INSTALL THE PECL EXTENSION!!! YAY!*****:
> 1. pecl install gearman
>
> If you're running cPanel 11.31.2.x and lower, like me, you will have to
> copy it to the correct location due to a cPanel bug.
>
> 2. cp gearman.so /usr/local/lib/php/extensions/no-debug-non-zts-20090626
> (for me - check yours!)
>
> 3. chmod 775 gearman.so for good measure!
>
> More importantly, give me a call if you need any help... seriously.
> This was the biggest pain in the ass and I'm a newbie in the Linux
> world.
>
> Number can be found at http://www.cgsmith.net/
>
> Thanks guys!
> Chris Smith
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/923183
>
> Title:
> 0.29 benchmark compilation fails on stange printf with PRIu64
>
> Status in Gearman Server and Client Libraries:
> Fix Committed
>
> Bug description:
> CXX benchmark/benchmark.lo
> benchmark/benchmark.cc: In function 'void benchmark_check_time(gearman_benchmark_st*)':
> benchmark/benchmark.cc:30: error: expected `)' before 'PRIu64'
> cc1plus: warnings being treated as errors
> benchmark/benchmark.cc:40: warning: conversion lacks type at end of format [-Wformat]
> benchmark/benchmark.cc:40: warning: too many arguments for format [-Wformat-extra-args]
> make[1]: *** [benchmark/benchmark.lo] Error 1
> make[1]: Leaving directory `/root/programs/gearman/gearmand-trunk-487'
> make: *** [all] Error 2
>
> To manag...

Read more...

Revision history for this message
cgsmith105 (cgsmith105) wrote :

Ah darn :D!

After I fixed it too :).

Thanks Brian!

--
Chris

Revision history for this message
Dossy Shiobara (dossy) wrote :

I'm working on building Gearman 0.29 on CentOS 5.7, and ran into similar problems.

I addressed the PRIu64 issue with the following:

====8< cut here ============================================

--- config.in.orig 2012-03-23 21:02:28.000000000 -0400
+++ config.in 2012-03-23 21:03:01.000000000 -0400
@@ -14,6 +14,7 @@
 #undef AC_APPLE_UNIVERSAL_BUILD

 /* the location of <cinttypes> */
+#define __STDC_FORMAT_MACROS /* for PRIu64 */
 #undef CINTTYPES_H

 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP

====8< cut here ============================================

Of course, http://en.wikipedia.org/wiki/Printf_format_string clearly states that PRIu64 is defined for ISO C99, and using it in C++ is IMHO incorrect. Is it worth filing a bug about this, or will this start a holy war? :-)

Brian Aker (brianaker)
Changed in gearmand:
status: Fix Committed → Fix Released
Revision history for this message
Dossy Shiobara (dossy) wrote :

So, what was the fix that was committed for this? It's non-trivial to figure out which bzr revision the commit happened in ... ?

Revision history for this message
Brian Aker (brianaker) wrote :

It is fixed in the 0.31 release.

On Apr 9, 2012, at 13:56, Dossy Shiobara <email address hidden> wrote:

> So, what was the fix that was committed for this? It's non-trivial to
> figure out which bzr revision the commit happened in ... ?
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/923183
>
> Title:
> 0.29 benchmark compilation fails on stange printf with PRIu64
>
> Status in Gearman Server and Client Libraries:
> Fix Released
>
> Bug description:
> CXX benchmark/benchmark.lo
> benchmark/benchmark.cc: In function 'void benchmark_check_time(gearman_benchmark_st*)':
> benchmark/benchmark.cc:30: error: expected `)' before 'PRIu64'
> cc1plus: warnings being treated as errors
> benchmark/benchmark.cc:40: warning: conversion lacks type at end of format [-Wformat]
> benchmark/benchmark.cc:40: warning: too many arguments for format [-Wformat-extra-args]
> make[1]: *** [benchmark/benchmark.lo] Error 1
> make[1]: Leaving directory `/root/programs/gearman/gearmand-trunk-487'
> make: *** [all] Error 2
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gearmand/+bug/923183/+subscriptions

Revision history for this message
symphonyx (erich-beyrent) wrote :

So the fix was to include config.h instead of inttypes.h, per the patches in #8 and #9?

Revision history for this message
Brian Aker (brianaker) wrote : Re: [Bug 923183] 0.29 benchmark compilation fails on stange printf with PRIu64

Final fix was done via updating config and m4 files.

On Apr 10, 2012, at 8:08 AM, symphonyx wrote:

> So the fix was to include config.h instead of inttypes.h, per the
> patches in #8 and #9?
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/923183
>
> Title:
> 0.29 benchmark compilation fails on stange printf with PRIu64
>
> Status in Gearman Server and Client Libraries:
> Fix Released
>
> Bug description:
> CXX benchmark/benchmark.lo
> benchmark/benchmark.cc: In function 'void benchmark_check_time(gearman_benchmark_st*)':
> benchmark/benchmark.cc:30: error: expected `)' before 'PRIu64'
> cc1plus: warnings being treated as errors
> benchmark/benchmark.cc:40: warning: conversion lacks type at end of format [-Wformat]
> benchmark/benchmark.cc:40: warning: too many arguments for format [-Wformat-extra-args]
> make[1]: *** [benchmark/benchmark.lo] Error 1
> make[1]: Leaving directory `/root/programs/gearman/gearmand-trunk-487'
> make: *** [all] Error 2
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gearmand/+bug/923183/+subscriptions

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.