[Pacemaker] Errors compiling pacemaker 1.1.8 with corosync 2.1.0

Bernardo Cabezas Serra bcabezas at apsl.net
Tue Oct 30 12:29:10 EDT 2012


Got some errors compiling pacemaker 1.1.8 (also tested previous
versions) on top of corosync 2.1.0.

At the end of the mail you can se ./configure output for both corosync
and pacemaker. [**]

First error (solved for me), was this one:
make[2]: Entering directory `/usr/src/pacemaker.git/lib/common'
  CC     ipc.lo
In file included from ipc.c:19:0:
../../include/crm_internal.h:235:1: error: conflicting types for
/opt/ha/include/corosync/corotypes.h:135:12: note: previous declaration
of 'qb_to_cs_error' was here
make[2]: *** [ipc.lo] Error 1
make[2]: Leaving directory `/usr/src/pacemaker.git/lib/common'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/pacemaker.git/lib'
make: *** [core] Error 1

"Solved" by removing qb_to_cs_error declaration from
include/crm_internal.h (see diff below) [*]

But now I get this second error:

make[2]: Entering directory `/usr/src/pacemaker.git/lib/cluster'
  CC     cluster.lo
  CC     membership.lo
  CC     legacy.lo
legacy.c: In function 'init_cs_connection_classic':
legacy.c:938:35: error: 'COROSYNC_SOCKET_NAME' undeclared (first use in
this function)
legacy.c:938:35: note: each undeclared identifier is reported only once
for each function it appears in
make[2]: *** [legacy.lo] Error 1
make[2]: Leaving directory `/usr/src/pacemaker.git/lib/cluster'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/pacemaker.git/lib'
make: *** [core] Error 1

This is caused because COROSYNC_SOCKET_NAME is no longer declared in
corosync's corodefs.h

Why is pacemaker trying to connect trough COROSYNC_SOCKET_NAME?

Below you have build environ descriptions.


[*] The patch removing qb_to_cs_error. Why do I have this error?
diff --git a/include/crm_internal.h b/include/crm_internal.h
index 1cfea09..82ba820 100644
--- a/include/crm_internal.h
+++ b/include/crm_internal.h
@@ -231,11 +231,6 @@ typedef struct qb_ipc_response_header
 #      include <corosync/corodefs.h>
 #      include <corosync/coroipcc.h>
 #      include <corosync/coroipc_types.h>
-static inline int
-qb_to_cs_error(int a)
-    return a;

 typedef coroipc_request_header_t cs_ipc_header_request_t;
 typedef coroipc_response_header_t cs_ipc_header_response_t;

[**] Compiling environ:

export PREFIX=/opt/ha
export PKG_CONFIG_PATH=/opt/ha/lib/pkgconfig
export LCRSODIR=$PREFIX/libexec/lcrso
export CLUSTER_USER=hacluster
export CLUSTER_GROUP=haclient
export LDFLAGS=-L/opt/ha/lib
export CPPFLAGS=-I/opt/ha/include
export CFLAGS=-I/opt/ha/include

Pacemaker configure params and output:
./configure --prefix=$PREFIX --without-cman --without-heartbeat
--with-corosync --enable-fatal-warnings=no --with-lcrso-dir=$LCRSODIR

pacemaker configuration:
  Version                  = 1.1.8 (Build: 5db5f53)
  Features                 = generated-manpages ncurses libqb-logging
libqb-ipc lha-fencing upstart systemd  corosync-plugin snmp libesmtp

  Prefix                   = /opt/ha
  Executables              = /opt/ha/sbin
  Man pages                = /opt/ha/share/man
  Libraries                = /opt/ha/lib
  Header files             = /opt/ha/include
  Arch-independent files   = /opt/ha/share
  State information        = /opt/ha/var
  System configuration     = /opt/ha/etc
  Corosync Plugins         =

  Use system LTDL          = yes

  HA group name            = haclient
  HA user name             = hacluster

  CFLAGS                   = -I/opt/ha/include -I/opt/ha/include
-I/opt/ha/include/heartbeat    -ggdb  -fgnu89-inline
-fstack-protector-all -Wall -Waggregate-return -Wbad-function-cast
-Wcast-align -Wdeclaration-after-statement -Wendif-labels -Wfloat-equal
-Wformat=2 -Wformat-security -Wformat-nonliteral -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -Wno-long-long
-Wno-strict-aliasing -Wunused-but-set-variable -Wpointer-arith
-Wstrict-prototypes -Wwrite-strings
  Libraries                = -lgnutls -lplumb -lpils -lqb -lbz2 -lxslt
-lxml2 -lc -lglib-2.0 -lglib-2.0 -luuid -lpam -lrt -ldl  -lglib-2.0
-lltdl -L/opt/ha/lib -lqb -ldl -lrt -lpthread
  Stack Libraries          =   -lcoroipcc   -L/opt/ha/lib -lcpg
-L/opt/ha/lib -lcfg   -lconfdb

Corosync configure options and output:

./configure --prefix=$PREFIX
corosync configuration:
  Version                  =
  Prefix                   = /opt/ha
  Executables              = ${exec_prefix}/sbin
  Man pages                = ${datarootdir}/man
  Doc dir                  = ${datarootdir}/doc/${PACKAGE_TARNAME}
  Libraries                = ${exec_prefix}/lib
  Header files             = ${prefix}/include
  Arch-independent files   = ${datarootdir}
  State information        = ${prefix}/var
  System configuration     = ${prefix}/etc
  System init.d directory  = ${prefix}/etc/init.d
  System systemd directory = /lib/systemd/system
  System init wraps dir    = /opt/ha/share/corosync
  corosync config dir      = ${prefix}/etc/corosync
  Features                 = pie relro bindnow

corosync build info:
  Library SONAME           = 5.0.0
  CFG Library SONAME       = 6.0.0
  CPG Library SONAME       = 4.1.0
  QUORUM Library SONAME    = 5.0.0
  SAM Library SONAME       = 4.4.0
  VOTEQUORUM Library SONAME  = 6.0.0
  CMAP Library SONAME      = 4.1.0
  Default optimization     = -O3
  Default debug options    =
  Extra compiler warnings  =
  Env. defined CFLAG       = -I/opt/ha/include
  Env. defined CPPFLAGS    = -I/opt/ha/include
  Env. defined LDFLAGS     = -L/opt/ha/lib
  ANSI defined CPPFLAGS    =
  Coverage     CFLAGS      =
  Coverage     LDFLAGS     =
  Fatal War.   CFLAGS      =
  Final        CFLAGS      = -I/opt/ha/include  -fPIC -DPIC  -fPIE -O3
-ggdb3 	  -Wall -Wshadow -Wmissing-prototypes -Wmissing-declarations
-Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith
-Wwrite-strings -Wcast-align -Wbad-function-cast
-Wmissing-format-attribute -Wformat=2 -Wformat-security
-Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing 	
  Final        CPPFLAGS    = -I/opt/ha/include
-I$(top_builddir)/include -I$(top_srcdir)/include
-I$(top_builddir)/include/corosync -I$(top_srcdir)/include/corosync
  Final        LDFLAGS     = -L/opt/ha/lib  -fPIC -DPIC  -pie
-Wl,-z,relro -Wl,-z,now -Wl,--as-needed

I got some problems building corosync, solved (for me) as explained in
my post on corosync list:

*Bernardo Cabezas Serra*

More information about the Pacemaker mailing list