Re: [ClusterLabs] pacemaker compile error

2016-10-31 Thread Jan Pokorný
On 27/10/16 19:13 +0200, ferdinando wrote:
> i'm trying to install pacemaker cluster in a testing environment (2 nodes
> Fedora release 24, 4.7.9-200.fc24.x86_64)
> i have problems compiling last commit
> (19c0d74717fb1e9701d51b206823a3386a114caa) of pacemaker.
> chunk of log:
> 
> [...]
> 
>   CC   libcrmcommon_la-mainloop.lo
> mainloop.c:406:8: error: unknown type name ‘qb_array_t’
>  static qb_array_t *gio_map = NULL;
> ^~
> 
> [...]
> 
> 
> libqb compile is fine:
> 
> libqb.pc
> ===
> prefix=/usr
> exec_prefix=${prefix}
> libdir=/usr/lib64
> includedir=${prefix}/include
> 
> Name: libqb
> Version: 1.0.0.53-026a
> 
> [...]

This indicates you are using current bleeding-edge master branch of
libqb, which is quite relevant, see below.

> qbarray.h is present and qb_array_t seems to be declared.
> 
> i'm not a guru so can anyone help me to figure out what i have to do to solve
> this error?


The issue should be solved with this PR:
https://github.com/ClusterLabs/pacemaker/pull/1163

> Low: fix missing qbarray.h include, no longer brought by qbipc[cs].h
> 
> Pacemaker should by no mean rely on fancy (and sometimes improper)
> transitive includes present with some versions of libqb, and use
> the API properly; here: when you use functionality from qbarray.h,
> care to include it.
> 
> References:
>   http://oss.clusterlabs.org/pipermail/users/2016-October/004411.html
>   (initial report, thanks Ferdinando!)
>   
> https://github.com/ClusterLabs/libqb/pull/228/commits/c1c26c94cb38e1b40d063a7e5fa29f2de033ed37
>   (commit that introduced the change at the libqb side)

Hope this helps.

> sorry for my bad english...
> thanks in advance! =)

Again, thanks for the report!

It takes effort to catch usage mistakes like these.


-- 
Jan (Poki)


pgp6EiPE3LL1J.pgp
Description: PGP signature
___
Users mailing list: Users@clusterlabs.org
http://clusterlabs.org/mailman/listinfo/users

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org


[ClusterLabs] pacemaker compile error

2016-10-27 Thread ferdinando
  hello,

i'm trying to install pacemaker cluster in a testing
environment (2 nodes Fedora release 24, 4.7.9-200.fc24.x86_64)
i have
problems compiling last commit
(19c0d74717fb1e9701d51b206823a3386a114caa) of pacemaker.
chunk of
log:

===

pacemaker
configuration:
 Version = 1.1.15 (Build: 19c0d74)
 Features =
generated-manpages agent-manpages ascii-docs publican-docs ncurses
libqb-logging libqb-ipc systemd nagios corosync-native atomic-attrd snmp
libesmtp

 Prefix = /usr
 Executables = /usr/sbin
 Man pages =
/usr/share/man
 Libraries = /usr/lib64
 Header files = /usr/include

Arch-independent files = /usr/share
 State information = /var
 System
configuration = /etc

 Use system LTDL = yes

 HA group name = haclient

HA user name = hacluster

 CFLAGS = -g -O2 -I/usr/include/dbus-1.0
-I/usr/lib64/dbus-1.0/include -ggdb -fgnu89-inline -Wall
-Waggregate-return -Wbad-function-cast -Wcast-align
-Wdeation-after-statement -Wendif-labels -Wfloat-equal
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs
-Wno-long-long -Wno-strict-aliasing -Wpointer-arith
-Wwrite-stringsnused-but-set-variable -Wformat=2
-fstack-protector-strong
 CFLAGS_HARDENED_EXE = -fPIE

CFLAGS_HARDENED_LIB =
 LDFLAGS_HARDENED_EXE = -Wl,-z,relro -pie
-Wl,-z,now -Wl,--as-needed
 LDFLAGS_HARDENED_LIB = -Wl,-z,relro
-Wl,-z,now -Wl,--as-needed
 Libraries = -lgnutls -lqb -lcorosync_common
-lqb -lqb -ldl -lrt -lpthread -lbz2 -lxslt -lxml2 -luuid -lpam -lrt -ldl
-lglib-2.0 -lltdl
 Stack Libraries = -lqb -ldl -lrt -lpthread -lcpg
-lcfg -lcmap
-lquorum
===
.

CC libcrmcommon_la-mainloop.lo
mainloop.c:406:8: error: unknown type
name 'qb_array_t'
 static qb_array_t *gio_map = NULL;

^~
mainloop.c: In function 'mainloop_cleanup':
mainloop.c:412:9:
error: implicit declaration of function 'qb_array_free'
[-Werror=implicit-function-declaration]
 qb_array_free(gio_map);

^
mainloop.c:412:9: error: nested extern declaration of
'qb_array_free' [-Werror=nested-externs]
mainloop.c: In function
'gio_poll_dispatch_update':
mainloop.c:465:11: error: implicit
declaration of function 'qb_array_index'
[-Werror=implicit-function-declaration]
 res = qb_array_index(gio_map,
fd, (void **));
 ^~
mainloop.c:465:5: error: nested
extern declaration of 'qb_array_index' [-Werror=nested-externs]
 res =
qb_array_index(gio_map, fd, (void **));
 ^~~
mainloop.c: In
function 'mainloop_add_ipc_server':
mainloop.c:594:19: error: implicit
declaration of function 'qb_array_create_2'
[-Werror=implicit-function-declaration]
 gio_map = qb_array_create_2(64,
sizeof(struct gio_to_qb_poll), 1);
 ^
mainloop.c:594:9:
error: nested extern declaration of 'qb_array_create_2'
[-Werror=nested-externs]
 gio_map = qb_array_create_2(64, sizeof(struct
gio_to_qb_poll), 1);
 ^~~
mainloop.c:594:17: error: assignment makes
pointer from integer without a cast [-Werror=int-conversion]
 gio_map =
qb_array_create_2(64, sizeof(struct gio_to_qb_poll), 1);
 ^
cc1: all
warnings being treated as errors
Makefile:754: recipe for target
'libcrmcommon_la-mainloop.lo' failed
gmake[2]: ***
[libcrmcommon_la-mainloop.lo] Error 1
gmake[2]: Leaving directory
'/usr/local/src/pacemaker/lib/common'
Makefile:565: recipe for target
'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]:
Leaving directory '/usr/local/src/pacemaker/lib'
Makefile:1242: recipe
for target 'core' failed
make: *** [core] Error 1

git log
commit
19c0d74717fb1e9701d51b206823a3386a114caa
Merge: 722276c a22b02e
Author:
Ken Gaillot 
Date: Tue Oct 25 11:59:10 2016 -0500

 Merge pull request
#1160 from wenningerk/fix_atomic_attrd

 fix usage of HAVE_ATOMIC_ATTRD
in
attrd_updater
===

libqb
compile is
fine:

libqb.pc
===
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=${prefix}/include

Name:
libqb
Version: 1.0.0.53-026a
Description: libqb
Requires:
Libs:
-L${libdir} -lqb -ldl -lrt -lpthread
Cflags:
-I${includedir}
===

/usr/include/qb/
-rw-r--r--
1 root root 8.6K Oct 27 18:26 qblist.h
-rw-r--r-- 1 root root 4.6K Oct
27 18:26 qbhdb.h
-rw-r--r-- 1 root root 3.0K Oct 27 18:26
qbdefs.h
-rw-r--r-- 1 root root 7.2K Oct 27 18:26 qbutil.h
-rw-r--r-- 1
root root 8.5K Oct 27 18:26 qbrb.h
-rw-r--r-- 1 root root 7.3K Oct 27
18:26 qbmap.h
-rw-r--r-- 1 root root 7.6K Oct 27 18:26
qbloop.h
-rw-r--r-- 1 root root 22K Oct 27 18:26 qblog.h
-rw-r--r-- 1
root root 14K Oct 27 18:26 qbipcs.h
-rw-r--r-- 1 root root 1.8K Oct 27
18:26 qbipc_common.h
-rw-r--r-- 1 root root 8.0K Oct 27 18:26
qbipcc.h
-rw-r--r-- 1 root root 1.5K Oct 27 18:26 qbconfig.h
-rw-r--r--
1 root root 7.1K Oct 27 18:26 qbatomic.h
-rw-r--r-- 1 root root 3.2K Oct
27 18:26 qbarray.h

===

qbarray.h is