You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Aleš Trček <Al...@halcom.si> on 2013/05/28 02:09:14 UTC

Building qpid C++ broker on AIX

Hi all,

Since I obviously won't succeed with this so easily, I'm opening a thread on the subject. Many thanks to all who can help me.

System with AIX 5.3 / xlC 9.0 (yeah old as sh*t, but I can't do anything about that soon) and Boost 1.34, building qpidc-0.20.
Anyway, I managed to go over some obstacles so far, but currently I'm stuck with the following error(s):
[ 20%] Building CXX object src/CMakeFiles/qpidcommon.dir/qpid/sys/posix/AsynchIO.o
"/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line 96.5: 1540-0218 (S) The call does not match any parameter list for "DispatchHandle::DispatchHandle".
"/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", line 88.24: 1540-1283 (I) "qpid::sys::DispatchHandle::DispatchHandle(const qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
"/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line 96.12: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &" cannot be initialized with an expression of type "const qpid::sys::Socket".
"/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line 168.5: 1540-0218 (S) The call does not match any parameter list for "DispatchHandle::DispatchHandle".
"/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", line 88.24: 1540-1283 (I) "qpid::sys::DispatchHandle::DispatchHandle(const qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
"/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line 168.20: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &" cannot be initialized with an expression of type "const qpid::sys::Socket".
"/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line 306.5: 1540-0218 (S) The call does not match any parameter list for "DispatchHandle::DispatchHandle".
"/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", line 88.24: 1540-1283 (I) "qpid::sys::DispatchHandle::DispatchHandle(const qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
"/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line 306.20: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &" cannot be initialized with an expression of type "const qpid::sys::Socket".

So, DispatchHandle has a constructor:
QPID_COMMON_EXTERN DispatchHandle(const IOHandle& h, Callback rCb, Callback wCb, Callback dCb);

which takes IOHandle& as the first parameter, however in AsynchIO, the constructor is called with the qpid::sys::Socket e.g:
AsynchAcceptor::AsynchAcceptor(const Socket& s, AsynchAcceptor::Callback callback) :
    acceptedCallback(callback),
    handle(s, boost::bind(&AsynchAcceptor::readable, this, _1), 0, 0),
    socket(s)

(Member "handle" is of type DispatchHandle.)

The thing is, IOHandle and Socket are totally unrelated. For this to ever work, Socket would need to extend IOHandle (or one of its derived classes). So the question is, how does this compile anywhere? :)

Regards,
Ales

RE: Building qpid C++ broker on AIX

Posted by Aleš Trček <Al...@halcom.si>.
Heh, I got it. The only problem here was that the qpid libraries were built with 'xlC' instead of 'xlC_r', which is the exe name you should use when using threads (it uses thread safe versions of libraries or sth). After rebuild, it just started working. Interesting that there are no warnings or errors just freeze. Well, I'm glad this works now, I just have to test with a real application instead of test sample now.
When I manage to build the broker too (or if I get stuck, heh) I'll let you know. I'll post patches for AIX too when everything is tested.

Regards,
Ales

-----Original Message-----
From: Aleš Trček [mailto:Ales.Trcek@halcom.si] 
Sent: Wednesday, December 11, 2013 7:12 PM
To: users@qpid.apache.org
Subject: RE: Building qpid C++ broker on AIX

Hi all,

After some while I got back to building qpidc (just the client part actually) on AIX. In the meanwhile I got an upgraded box with AIX 7.1 (on POWER CPU) and latest compiler xlc 12.1. I then built boost 1.47.0 (with some IBM patch required for xlc) and after a few more problems managed to build qpid (make all) v0.24 to the point of linking qpidd, which fails because of some undefined boost program_options symbols. I'll deal with this later, since I need the client and required libraries libqpidtypes.so, libqpidcommon.so, libqpidclient.so and libqpidmessaging.so got built OK AFAICT.
So, I try to build a simple client using example from the web site, and the executable is created OK. When I run it though, it freezes at one point and stays like this indefinetly. It has to do something with connection and threads but I haven't been able to figure out the cause. I did some analysis and here are the facts:

gdb output (we can see where it waits in main thread):
++++++++++++++++++
#4  0xd051d660 in pthread_cond_wait () from /usr/lib/libpthreads.a(shr_xpg5.o)
#5  0xd6c83cc8 in qpid::sys::Condition::wait( (qpid::sys::Mutex &)) (this=0x201b97b0, mutex=@0x201b977c: ???)
    at /temporar/qpid_build/qpidc-0.24/src/../include/qpid/sys/posix/Condition.h:63
#6  0xd6c83d9c in qpid::sys::Monitor::wait( (void)) (this=0x201b977c) at /temporar/qpid_build/qpidc-0.24/src/../include/qpid/sys/Monitor.h:41
#7  0xd6c83e60 in waitFor__Q3_4qpid6client12StateManagerFQ2_3std3setXTiTQ2_3std4lessXTi_TQ2_3std9allocatorXTi__ (this=0x201b9778, desired=@0x2ff21910: ???)
    at /temporar/qpid_build/qpidc-0.24/src/qpid/client/StateManager.cpp:51
    ...
++++++++++++++++++

Specifically this is here:
++++++++++++++++++
qpid/sys/posix/Condition.h:
   62   void Condition::wait(Mutex& mutex) {
   63       QPID_POSIX_ASSERT_THROW_IF(pthread_cond_wait(&condition, &mutex.mutex)); // <====
   64   }
++++++++++++++++++

Qpid logs:
Client log:
++++++++++++++++++
2013-12-10 17:35:47 [Client] debug Created connection 192.168.0.142:5672 with {}
2013-12-10 17:35:47 [Client] debug Starting connection, urls=[192.168.0.142:5672]
2013-12-10 17:35:47 [Client] info Trying to connect to 192.168.0.142:5672...
2013-12-10 17:35:47 [Client] debug Created IO thread: 0
2013-12-10 17:35:47 [Network] debug TCPConnector created for 0-10
2013-12-10 17:35:47 [Client] info Set TCP_NODELAY
2013-12-10 17:35:47 [System] info Connecting: 192.168.0.142:5672
++++++++++++++++++

Server log (this is trace level!):
++++++++++++++++++
2013-12-11 16:41:32 [System] error Connection qpid.192.168.0.142:5672-192.168.0.135:47415 No protocol received closing
++++++++++++++++++

Netstat first shows established connection and then close_wait:
++++++++++++++++++
tcp4       0      0  192.168.0.135.47401    192.168.0.142.5672     ESTABLISHED
...
tcp4       0      0  192.168.0.135.47401    192.168.0.142.5672     CLOSE_WAIT
...
++++++++++++++++++

Output of truss (similar to strace on Linuxes):
++++++++++++++++++
...
8454278: 29950155: socket(2, 1, 0)                      = 5
8454278: 29950155: kioctl(5, -2147195266, 0x2FF20F10, 0x00000000) = 0
8454278: 29950155: kioctl(5, -2147195267, 0x2FF20F10, 0x00000000) = 0
8454278: 29950155: kfcntl(5, F_SETFL, 0x00000004)       = 0
8454278: 29950155: getsockopt(5, 65535, 4104, 0x2FF21374, 0x2FF21370) = 0
8454278: 29950155: connext(5, 0x201FB688, 16)           Err#55 EINPROGRESS
8454278: 29950155: ngetsockname(5, 0x2FF20BD0, 0x2FF210DC) = 0
8454278: 29950155: kwrite(4, "  ", 1)                   = 1
[and then nothing]
++++++++++++++++++


Based on all this it seems that the connection get established, but then something weird is happening with the Poller thread. When I try to debug the run() function it gets stuck on if clause in line 724:
++++++++++++++++++
    if (lastReturnedHandle) {  // <== here
        impl->resetMode(*lastReturnedHandle);
        lastReturnedHandle = 0;
    }
++++++++++++++++++

gdb session with trace log on stdout:
++++++++++++++++++ 
(gdb) break PosixPoller.cpp:724
No source file named PosixPoller.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (PosixPoller.cpp:724) pending.
(gdb) run
Starting program: /temporar/atk/qtmin
[New Thread 1]
entry
args
2013-12-11 18:52:23 [Unspecified] debug Config file not read: /usr/local/etc/qpid/qpidc.conf
2013-12-11 18:52:23 [Unspecified] debug Config file not read: /usr/local/etc/qpid/qpidc.conf
2013-12-11 18:52:23 [Unspecified] debug Config file not read: /usr/local/etc/qpid/qpidc.conf
2013-12-11 18:52:23 [Unspecified] debug Config file not read: /usr/local/etc/qpid/qpidc.conf
2013-12-11 18:52:23 [Client] debug Created connection 192.168.0.142:5672 with {} conn
2013-12-11 18:52:23 [Client] debug Starting connection, urls=[192.168.0.142:5672]
2013-12-11 18:52:23 [Client] info Trying to connect to 192.168.0.142:5672...
2013-12-11 18:52:23 [Client] debug Created IO thread: 0 [New Thread 258] [Switching to Thread 258]

Breakpoint 1, qpid::sys::Poller::wait( (qpid::sys::Duration)) (this=0x201b7e98, event=@0x201d8a88: ???, timeout=<incomplete type>)
    at /temporar/qpid_build/qpidc-0.24/src/qpid/sys/posix/PosixPoller.cpp:724
724         if (lastReturnedHandle) {
(gdb) bt
#0  qpid::sys::Poller::wait( (qpid::sys::Duration)) (this=0x201b7e98, event=@0x201d8a88: ???, timeout=<incomplete type>)
    at /temporar/qpid_build/qpidc-0.24/src/qpid/sys/posix/PosixPoller.cpp:724
#1  0xd6070dd4 in qpid::sys::Poller::run( (void)) (this=0x201b7e98) at /temporar/qpid_build/qpidc-0.24/src/qpid/sys/posix/PosixPoller.cpp:690
#2  0xd622fb44 in qpid::sys::Thread.cpp-0::runRunnable( (void *)) (p=0x201b7e98) at /temporar/qpid_build/qpidc-0.24/src/qpid/sys/posix/Thread.cpp:35
#3  0xd04fad88 in _pthread_body () from /usr/lib/libpthreads.a(shr_xpg5.o)
#4  0x00000000 in ?? ()
(gdb) step
2013-12-11 18:52:33 [Network] debug TCPConnector created for 0-10
2013-12-11 18:52:33 [Client] info Set TCP_NODELAY
2013-12-11 18:52:33 [System] info Connecting: 192.168.0.142:5672

[and then the endless wait]
++++++++++++++++++


If you managed to stay with me to this point, any ideas? :) Please note that I had to hack quite some things to make it build on AIX, though semantically there should be no change. Beside this I had to take ifaddrs.h and ifaddrs.cpp from somebody on samba.org list and link with it, since this is not included in AIX - I don't know if this should have any impact.
Btw, this is how I built the exe:
xlC_r -g -o qtmin ifaddrs.c qtest.cpp -I/temporar/qpid_build/qpidc-0.24/include -L/temporar/qpid_build/qpidc-0.24/build/src/ -lqpidcommon -lqpidmessaging -lpthreads -Wl,-brtl

I really appreciate any help with this.

Regards,
Ales


RE: Building qpid C++ broker on AIX

Posted by Aleš Trček <Al...@halcom.si>.
Hi all,

After some while I got back to building qpidc (just the client part actually) on AIX. In the meanwhile I got an upgraded box with AIX 7.1 (on POWER CPU) and latest compiler xlc 12.1. I then built boost 1.47.0 (with some IBM patch required for xlc) and after a few more problems managed to build qpid (make all) v0.24 to the point of linking qpidd, which fails because of some undefined boost program_options symbols. I'll deal with this later, since I need the client and required libraries libqpidtypes.so, libqpidcommon.so, libqpidclient.so and libqpidmessaging.so got built OK AFAICT.
So, I try to build a simple client using example from the web site, and the executable is created OK. When I run it though, it freezes at one point and stays like this indefinetly. It has to do something with connection and threads but I haven't been able to figure out the cause. I did some analysis and here are the facts:

gdb output (we can see where it waits in main thread):
++++++++++++++++++
#4  0xd051d660 in pthread_cond_wait () from /usr/lib/libpthreads.a(shr_xpg5.o)
#5  0xd6c83cc8 in qpid::sys::Condition::wait( (qpid::sys::Mutex &)) (this=0x201b97b0, mutex=@0x201b977c: ???)
    at /temporar/qpid_build/qpidc-0.24/src/../include/qpid/sys/posix/Condition.h:63
#6  0xd6c83d9c in qpid::sys::Monitor::wait( (void)) (this=0x201b977c) at /temporar/qpid_build/qpidc-0.24/src/../include/qpid/sys/Monitor.h:41
#7  0xd6c83e60 in waitFor__Q3_4qpid6client12StateManagerFQ2_3std3setXTiTQ2_3std4lessXTi_TQ2_3std9allocatorXTi__ (this=0x201b9778, desired=@0x2ff21910: ???)
    at /temporar/qpid_build/qpidc-0.24/src/qpid/client/StateManager.cpp:51
    ...
++++++++++++++++++

Specifically this is here:
++++++++++++++++++
qpid/sys/posix/Condition.h:
   62   void Condition::wait(Mutex& mutex) {
   63       QPID_POSIX_ASSERT_THROW_IF(pthread_cond_wait(&condition, &mutex.mutex)); // <====
   64   }
++++++++++++++++++

Qpid logs:
Client log:
++++++++++++++++++
2013-12-10 17:35:47 [Client] debug Created connection 192.168.0.142:5672 with {}
2013-12-10 17:35:47 [Client] debug Starting connection, urls=[192.168.0.142:5672]
2013-12-10 17:35:47 [Client] info Trying to connect to 192.168.0.142:5672...
2013-12-10 17:35:47 [Client] debug Created IO thread: 0
2013-12-10 17:35:47 [Network] debug TCPConnector created for 0-10
2013-12-10 17:35:47 [Client] info Set TCP_NODELAY
2013-12-10 17:35:47 [System] info Connecting: 192.168.0.142:5672
++++++++++++++++++

Server log (this is trace level!):
++++++++++++++++++
2013-12-11 16:41:32 [System] error Connection qpid.192.168.0.142:5672-192.168.0.135:47415 No protocol received closing
++++++++++++++++++

Netstat first shows established connection and then close_wait:
++++++++++++++++++
tcp4       0      0  192.168.0.135.47401    192.168.0.142.5672     ESTABLISHED
...
tcp4       0      0  192.168.0.135.47401    192.168.0.142.5672     CLOSE_WAIT
...
++++++++++++++++++

Output of truss (similar to strace on Linuxes):
++++++++++++++++++
...
8454278: 29950155: socket(2, 1, 0)                      = 5
8454278: 29950155: kioctl(5, -2147195266, 0x2FF20F10, 0x00000000) = 0
8454278: 29950155: kioctl(5, -2147195267, 0x2FF20F10, 0x00000000) = 0
8454278: 29950155: kfcntl(5, F_SETFL, 0x00000004)       = 0
8454278: 29950155: getsockopt(5, 65535, 4104, 0x2FF21374, 0x2FF21370) = 0
8454278: 29950155: connext(5, 0x201FB688, 16)           Err#55 EINPROGRESS
8454278: 29950155: ngetsockname(5, 0x2FF20BD0, 0x2FF210DC) = 0
8454278: 29950155: kwrite(4, "  ", 1)                   = 1
[and then nothing]
++++++++++++++++++


Based on all this it seems that the connection get established, but then something weird is happening with the Poller thread. When I try to debug the run() function it gets stuck on if clause in line 724:
++++++++++++++++++
    if (lastReturnedHandle) {  // <== here
        impl->resetMode(*lastReturnedHandle);
        lastReturnedHandle = 0;
    }
++++++++++++++++++

gdb session with trace log on stdout:
++++++++++++++++++ 
(gdb) break PosixPoller.cpp:724
No source file named PosixPoller.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (PosixPoller.cpp:724) pending.
(gdb) run
Starting program: /temporar/atk/qtmin
[New Thread 1]
entry
args
2013-12-11 18:52:23 [Unspecified] debug Config file not read: /usr/local/etc/qpid/qpidc.conf
2013-12-11 18:52:23 [Unspecified] debug Config file not read: /usr/local/etc/qpid/qpidc.conf
2013-12-11 18:52:23 [Unspecified] debug Config file not read: /usr/local/etc/qpid/qpidc.conf
2013-12-11 18:52:23 [Unspecified] debug Config file not read: /usr/local/etc/qpid/qpidc.conf
2013-12-11 18:52:23 [Client] debug Created connection 192.168.0.142:5672 with {}
conn
2013-12-11 18:52:23 [Client] debug Starting connection, urls=[192.168.0.142:5672]
2013-12-11 18:52:23 [Client] info Trying to connect to 192.168.0.142:5672...
2013-12-11 18:52:23 [Client] debug Created IO thread: 0
[New Thread 258]
[Switching to Thread 258]

Breakpoint 1, qpid::sys::Poller::wait( (qpid::sys::Duration)) (this=0x201b7e98, event=@0x201d8a88: ???, timeout=<incomplete type>)
    at /temporar/qpid_build/qpidc-0.24/src/qpid/sys/posix/PosixPoller.cpp:724
724         if (lastReturnedHandle) {
(gdb) bt
#0  qpid::sys::Poller::wait( (qpid::sys::Duration)) (this=0x201b7e98, event=@0x201d8a88: ???, timeout=<incomplete type>)
    at /temporar/qpid_build/qpidc-0.24/src/qpid/sys/posix/PosixPoller.cpp:724
#1  0xd6070dd4 in qpid::sys::Poller::run( (void)) (this=0x201b7e98) at /temporar/qpid_build/qpidc-0.24/src/qpid/sys/posix/PosixPoller.cpp:690
#2  0xd622fb44 in qpid::sys::Thread.cpp-0::runRunnable( (void *)) (p=0x201b7e98) at /temporar/qpid_build/qpidc-0.24/src/qpid/sys/posix/Thread.cpp:35
#3  0xd04fad88 in _pthread_body () from /usr/lib/libpthreads.a(shr_xpg5.o)
#4  0x00000000 in ?? ()
(gdb) step
2013-12-11 18:52:33 [Network] debug TCPConnector created for 0-10
2013-12-11 18:52:33 [Client] info Set TCP_NODELAY
2013-12-11 18:52:33 [System] info Connecting: 192.168.0.142:5672

[and then the endless wait]
++++++++++++++++++


If you managed to stay with me to this point, any ideas? :) Please note that I had to hack quite some things to make it build on AIX, though semantically there should be no change. Beside this I had to take ifaddrs.h and ifaddrs.cpp from somebody on samba.org list and link with it, since this is not included in AIX - I don't know if this should have any impact.
Btw, this is how I built the exe:
xlC_r -g -o qtmin ifaddrs.c qtest.cpp -I/temporar/qpid_build/qpidc-0.24/include -L/temporar/qpid_build/qpidc-0.24/build/src/ -lqpidcommon -lqpidmessaging -lpthreads -Wl,-brtl

I really appreciate any help with this.

Regards,
Ales


RE: Building qpid C++ broker on AIX

Posted by Aleš Trček <Al...@halcom.si>.
Unfortunately, for the combination of OS and compiler, this is as good as it can be... building on AIX requires some IBM patches to be applied to original boost distribution (which are only for specific AIX & xlc versions).
Not a bad idea though to just try to use a more recent version of boost bind - since it is only a header package - and see if there is any improvement.

Regards,
Ales

-----Original Message-----
From: Andrew Stitcher [mailto:astitcher@redhat.com] 
Sent: Monday, June 03, 2013 5:22 PM
To: users@qpid.apache.org
Subject: Re: Building qpid C++ broker on AIX

On Sun, 2013-06-02 at 15:45 +0000, Aleš Trček wrote:
> ...
> Now I have another issue, which I fear is not going to be an easy one to resolve.

One thing I notice is that you are using a very old version of boost. It may not help at all, but maybe newer versions of boost have a work around for whatever problems this early compiler has.

Andrew



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org


Re: Building qpid C++ broker on AIX

Posted by Andrew Stitcher <as...@redhat.com>.
On Sun, 2013-06-02 at 15:45 +0000, Aleš Trček wrote:
> ...
> Now I have another issue, which I fear is not going to be an easy one to resolve.

One thing I notice is that you are using a very old version of boost. It
may not help at all, but maybe newer versions of boost have a work
around for whatever problems this early compiler has.

Andrew



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


RE: Building qpid C++ broker on AIX

Posted by Aleš Trček <Al...@halcom.si>.
Hi all,

Thanx, I was not aware of the type conversion operator... It seems that in this case the compiler doesn't realize that it should do the implicit conversion... Anyway, I used Andrew's suggestion and added a function that returns the IOHandle&, fixed the call in 2 places I think, and it worked.

Now I have another issue, which I fear is not going to be an easy one to resolve.
[  5%] Building CXX object src/CMakeFiles/qpidcommon.dir/qpid/framing/SequenceSet.o
     cd /achinst/atk/qpid_build/build/src && /usr/vacpp/bin/xlC  -+ -Dqpidcommon_EXPORTS -DHAVE_CONFIG_H -qthreaded -qhalt=e -qrtti=all -qtemplateregistry=/achinst/atk/qpid_build/build/template_registry -qstaticinline -qalias=noansi -qtls   -g   -I/usr/local/include/boost-1_34 -I/achinst/atk/qpid_build/qpidc-0.20/src -I/achinst/atk/qpid_build/qpidc-0.20/src/../include -I/achinst/atk/qpid_build/build/src -I/achinst/atk/qpid_build/build/src/../include -I/usr/local/include    -o CMakeFiles/qpidcommon.dir/qpid/framing/SequenceSet.o -c /achinst/atk/qpid_build/qpidc-0.20/src/qpid/framing/SequenceSet.cpp
"/usr/local/include/boost-1_34/boost/bind.hpp", line 66.22: 1540-0065 (S) The qualifier "F" is neither a class nor a namespace.
"/usr/local/include/boost-1_34/boost/bind/bind_template.hpp", line 15.13: 1540-0700 (I) The previous message was produced while processing "struct boost::_bi::result_traits<boost::_bi::unspecified,qpid::RangeSet<qpid::framing::SequenceNumber> &(qpid::RangeSet<qpid::framing::SequenceNumber>::*)(const qpid::Range<qpid::framing::SequenceNumber> &)>".

bind.hpp:
64  template<class F> struct result_traits<unspecified, F>
65  {
66      typedef typename F::result_type type;
67  };

The problem lies in line 243 in RangeSet.h:
240  template <class T> void RangeSet<T>::addSet(const RangeSet<T>& s) {
241      typedef RangeSet<T>& (RangeSet<T>::*RangeSetRangeOp)(const Range<T>&);
242      std::for_each(s.ranges.begin(), s.ranges.end(),
243                    boost::bind((RangeSetRangeOp)&RangeSet<T>::operator+=, this, _1));
244  }

So xlC is having problems calling bind function in bind.hpp.

Then I read FAQ on http://www.boost.org/doc/libs/1_53_0/libs/bind/bind.html and tried with alternative call:
boost::bind<RangeSetRangeOp>((RangeSetRangeOp)&RangeSet<T>::operator+=, this, _1));

which gives me:
"/usr/local/include/boost-1_34/boost/mem_fn.hpp", line 318.5: 1540-0142 (S) cv-qualifiers must not be added to a typedef of function type.
"/usr/local/include/boost-1_34/boost/bind.hpp", line 278.36: 1540-0700 (I) The previous message was produced while processing "class boost::_mfi::dm<qpid::RangeSet<qpid::framing::SequenceNumber> &(const qpid::Range<qpid::framing::SequenceNumber> &),qpid::RangeSet<qpid::framing::SequenceNumber> >".

mem_fn.hpp:
314  template<class R, class T> class dm
315  {
316  public:
317
318      typedef R const & result_type;
319      typedef T const * argument_type;

As a side note, if I remove const, it goes further, but the compiler has problems with all such lines, e.g.:
template<class U> R const & call(U & u, T const *) const
...

reports the same error, while changed to:
template<class U> R& call(U & u, T const *) const
...

it works. Of course, if I change all such occurences, the compiler starts to complain about not maching params (const vs. not const)...

I have no idea why it doesn't work... it has to have some relevance to how the compiler is handling partial template specialization. Any ideas?

Regards,
Ales

-----Original Message-----
From: Andrew Stitcher [mailto:astitcher@redhat.com] 
Sent: Tuesday, May 28, 2013 5:08 PM
To: users@qpid.apache.org
Subject: Re: Building qpid C++ broker on AIX

On Tue, 2013-05-28 at 14:39 +0000, Steve Huston wrote:
> Hi Ales,
> 
> The IOHandle conversion comes from this method on Socket:
> 
> virtual operator const IOHandle&() const = 0;
> 
> I've been having problems with this type of thing trying to get Qpid 
> building XL C++ 11 too, so I'm not sure you'd be in much better shape 
> with an updated compiler :-(
> 
> Try putting a cast to const IOHandle& - let us know how that goes.

That conversion operator was put in because in a previous design Socket did in fact extend IOHandle. But upon some refactoring that seemed like a bad idea - it isn't obvious that 'Socket "is a" IOHandle' makes a lot more sense than 'Socket "has a" IOHandle'. Given that aggregation generally causes less coupling than inheritance I think it is a better design, so I changed it and added the conversion operator to deal with any code that still needed to do the conversion.

All of which is long winded explanation to say it would be better to make the conversion explicit and to add:
	virtual const IOHandle& getIOHandle() const = 0; Obviously this may cause some knock-on changes throughout the code base, but I suspect not too many.

Try this and see if it helps your situation. if so changing Socket in this way seems like a good idea to me.

Andrew

> 
> -Steve
> 
> > -----Original Message-----
> > From: Aleš Trček [mailto:Ales.Trcek@halcom.si]
> > Sent: Monday, May 27, 2013 8:09 PM
> > To: users@qpid.apache.org
> > Subject: Building qpid C++ broker on AIX
> > 
> > Hi all,
> > 
> > Since I obviously won't succeed with this so easily, I'm opening a 
> > thread on the subject. Many thanks to all who can help me.
> > 
> > System with AIX 5.3 / xlC 9.0 (yeah old as sh*t, but I can't do 
> > anything about that soon) and Boost 1.34, building qpidc-0.20.
> > Anyway, I managed to go over some obstacles so far, but currently 
> > I'm stuck with the following error(s):
> > [ 20%] Building CXX object
> > src/CMakeFiles/qpidcommon.dir/qpid/sys/posix/AsynchIO.o
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp"
> > , line
> > 96.5: 1540-0218 (S) The call does not match any parameter list for 
> > "DispatchHandle::DispatchHandle".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", 
> > line
> > 88.24: 1540-1283 (I) 
> > "qpid::sys::DispatchHandle::DispatchHandle(const
> > qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp"
> > , line
> > 96.12: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &"
> > cannot be initialized with an expression of type "const qpid::sys::Socket".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp"
> > , line
> > 168.5: 1540-0218 (S) The call does not match any parameter list for 
> > "DispatchHandle::DispatchHandle".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", 
> > line
> > 88.24: 1540-1283 (I) 
> > "qpid::sys::DispatchHandle::DispatchHandle(const
> > qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp"
> > , line
> > 168.20: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &"
> > cannot be initialized with an expression of type "const qpid::sys::Socket".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp"
> > , line
> > 306.5: 1540-0218 (S) The call does not match any parameter list for 
> > "DispatchHandle::DispatchHandle".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", 
> > line
> > 88.24: 1540-1283 (I) 
> > "qpid::sys::DispatchHandle::DispatchHandle(const
> > qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp"
> > , line
> > 306.20: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &"
> > cannot be initialized with an expression of type "const qpid::sys::Socket".
> > 
> > So, DispatchHandle has a constructor:
> > QPID_COMMON_EXTERN DispatchHandle(const IOHandle& h, Callback rCb, 
> > Callback wCb, Callback dCb);
> > 
> > which takes IOHandle& as the first parameter, however in AsynchIO, 
> > the constructor is called with the qpid::sys::Socket e.g:
> > AsynchAcceptor::AsynchAcceptor(const Socket& s, 
> > AsynchAcceptor::Callback
> > callback) :
> >     acceptedCallback(callback),
> >     handle(s, boost::bind(&AsynchAcceptor::readable, this, _1), 0, 0),
> >     socket(s)
> > 
> > (Member "handle" is of type DispatchHandle.)
> > 
> > The thing is, IOHandle and Socket are totally unrelated. For this to 
> > ever work, Socket would need to extend IOHandle (or one of its 
> > derived classes). So the question is, how does this compile 
> > anywhere? :)
> > 
> > Regards,
> > Ales
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> additional commands, e-mail: users-help@qpid.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Building qpid C++ broker on AIX

Posted by Andrew Stitcher <as...@redhat.com>.
On Tue, 2013-05-28 at 14:39 +0000, Steve Huston wrote:
> Hi Ales,
> 
> The IOHandle conversion comes from this method on Socket:
> 
> virtual operator const IOHandle&() const = 0;
> 
> I've been having problems with this type of thing trying to get Qpid building XL C++ 11 too, so I'm not sure you'd be in much better shape with an updated compiler :-(
> 
> Try putting a cast to const IOHandle& - let us know how that goes.

That conversion operator was put in because in a previous design Socket
did in fact extend IOHandle. But upon some refactoring that seemed like
a bad idea - it isn't obvious that 'Socket "is a" IOHandle' makes a lot
more sense than 'Socket "has a" IOHandle'. Given that aggregation
generally causes less coupling than inheritance I think it is a better
design, so I changed it and added the conversion operator to deal with
any code that still needed to do the conversion.

All of which is long winded explanation to say it would be better to
make the conversion explicit and to add:
	virtual const IOHandle& getIOHandle() const = 0;
Obviously this may cause some knock-on changes throughout the code base,
but I suspect not too many.

Try this and see if it helps your situation. if so changing Socket in
this way seems like a good idea to me.

Andrew

> 
> -Steve
> 
> > -----Original Message-----
> > From: Aleš Trček [mailto:Ales.Trcek@halcom.si]
> > Sent: Monday, May 27, 2013 8:09 PM
> > To: users@qpid.apache.org
> > Subject: Building qpid C++ broker on AIX
> > 
> > Hi all,
> > 
> > Since I obviously won't succeed with this so easily, I'm opening a thread on
> > the subject. Many thanks to all who can help me.
> > 
> > System with AIX 5.3 / xlC 9.0 (yeah old as sh*t, but I can't do anything about
> > that soon) and Boost 1.34, building qpidc-0.20.
> > Anyway, I managed to go over some obstacles so far, but currently I'm stuck
> > with the following error(s):
> > [ 20%] Building CXX object
> > src/CMakeFiles/qpidcommon.dir/qpid/sys/posix/AsynchIO.o
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> > 96.5: 1540-0218 (S) The call does not match any parameter list for
> > "DispatchHandle::DispatchHandle".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", line
> > 88.24: 1540-1283 (I) "qpid::sys::DispatchHandle::DispatchHandle(const
> > qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> > 96.12: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &"
> > cannot be initialized with an expression of type "const qpid::sys::Socket".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> > 168.5: 1540-0218 (S) The call does not match any parameter list for
> > "DispatchHandle::DispatchHandle".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", line
> > 88.24: 1540-1283 (I) "qpid::sys::DispatchHandle::DispatchHandle(const
> > qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> > 168.20: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &"
> > cannot be initialized with an expression of type "const qpid::sys::Socket".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> > 306.5: 1540-0218 (S) The call does not match any parameter list for
> > "DispatchHandle::DispatchHandle".
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", line
> > 88.24: 1540-1283 (I) "qpid::sys::DispatchHandle::DispatchHandle(const
> > qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
> > "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> > 306.20: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &"
> > cannot be initialized with an expression of type "const qpid::sys::Socket".
> > 
> > So, DispatchHandle has a constructor:
> > QPID_COMMON_EXTERN DispatchHandle(const IOHandle& h, Callback rCb,
> > Callback wCb, Callback dCb);
> > 
> > which takes IOHandle& as the first parameter, however in AsynchIO, the
> > constructor is called with the qpid::sys::Socket e.g:
> > AsynchAcceptor::AsynchAcceptor(const Socket& s, AsynchAcceptor::Callback
> > callback) :
> >     acceptedCallback(callback),
> >     handle(s, boost::bind(&AsynchAcceptor::readable, this, _1), 0, 0),
> >     socket(s)
> > 
> > (Member "handle" is of type DispatchHandle.)
> > 
> > The thing is, IOHandle and Socket are totally unrelated. For this to ever work,
> > Socket would need to extend IOHandle (or one of its derived classes). So the
> > question is, how does this compile anywhere? :)
> > 
> > Regards,
> > Ales
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


RE: Building qpid C++ broker on AIX

Posted by Steve Huston <sh...@riverace.com>.
Hi Ales,

The IOHandle conversion comes from this method on Socket:

virtual operator const IOHandle&() const = 0;

I've been having problems with this type of thing trying to get Qpid building XL C++ 11 too, so I'm not sure you'd be in much better shape with an updated compiler :-(

Try putting a cast to const IOHandle& - let us know how that goes.

-Steve

> -----Original Message-----
> From: Aleš Trček [mailto:Ales.Trcek@halcom.si]
> Sent: Monday, May 27, 2013 8:09 PM
> To: users@qpid.apache.org
> Subject: Building qpid C++ broker on AIX
> 
> Hi all,
> 
> Since I obviously won't succeed with this so easily, I'm opening a thread on
> the subject. Many thanks to all who can help me.
> 
> System with AIX 5.3 / xlC 9.0 (yeah old as sh*t, but I can't do anything about
> that soon) and Boost 1.34, building qpidc-0.20.
> Anyway, I managed to go over some obstacles so far, but currently I'm stuck
> with the following error(s):
> [ 20%] Building CXX object
> src/CMakeFiles/qpidcommon.dir/qpid/sys/posix/AsynchIO.o
> "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> 96.5: 1540-0218 (S) The call does not match any parameter list for
> "DispatchHandle::DispatchHandle".
> "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", line
> 88.24: 1540-1283 (I) "qpid::sys::DispatchHandle::DispatchHandle(const
> qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
> "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> 96.12: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &"
> cannot be initialized with an expression of type "const qpid::sys::Socket".
> "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> 168.5: 1540-0218 (S) The call does not match any parameter list for
> "DispatchHandle::DispatchHandle".
> "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", line
> 88.24: 1540-1283 (I) "qpid::sys::DispatchHandle::DispatchHandle(const
> qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
> "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> 168.20: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &"
> cannot be initialized with an expression of type "const qpid::sys::Socket".
> "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> 306.5: 1540-0218 (S) The call does not match any parameter list for
> "DispatchHandle::DispatchHandle".
> "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/DispatchHandle.h", line
> 88.24: 1540-1283 (I) "qpid::sys::DispatchHandle::DispatchHandle(const
> qpid::sys::IOHandle &, Callback, Callback, Callback)" is not a viable candidate.
> "/achinst/atk/qpid_build/qpidc-0.20/src/qpid/sys/posix/AsynchIO.cpp", line
> 306.20: 1540-0256 (I) A parameter of type "const qpid::sys::IOHandle &"
> cannot be initialized with an expression of type "const qpid::sys::Socket".
> 
> So, DispatchHandle has a constructor:
> QPID_COMMON_EXTERN DispatchHandle(const IOHandle& h, Callback rCb,
> Callback wCb, Callback dCb);
> 
> which takes IOHandle& as the first parameter, however in AsynchIO, the
> constructor is called with the qpid::sys::Socket e.g:
> AsynchAcceptor::AsynchAcceptor(const Socket& s, AsynchAcceptor::Callback
> callback) :
>     acceptedCallback(callback),
>     handle(s, boost::bind(&AsynchAcceptor::readable, this, _1), 0, 0),
>     socket(s)
> 
> (Member "handle" is of type DispatchHandle.)
> 
> The thing is, IOHandle and Socket are totally unrelated. For this to ever work,
> Socket would need to extend IOHandle (or one of its derived classes). So the
> question is, how does this compile anywhere? :)
> 
> Regards,
> Ales

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org