Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.2.0 won't compile on AIX 7.1 #2234

Closed
mbeddo opened this issue Dec 1, 2016 · 30 comments · Fixed by #2240 or #2241
Closed

4.2.0 won't compile on AIX 7.1 #2234

mbeddo opened this issue Dec 1, 2016 · 30 comments · Fixed by #2240 or #2241

Comments

@mbeddo
Copy link

mbeddo commented Dec 1, 2016

zeromq 4.1.6 compiles on my AIX box and passes all tests. However, attempting to build zeromq 4.2.0 I find compile problems. Details follow:

$ xlC -qversion
IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72)
Version: 12.01.0000.0000
$ oslevel
7.1.0.0

$ configure CC=xlc CXX=xlC
$ make
Making all in doc
make[1]: Entering directory /home/meb/zeromq-4.2.0/doc' make[1]: Nothing to be done for all'.
make[1]: Leaving directory /home/meb/zeromq-4.2.0/doc' make[1]: Entering directory /home/meb/zeromq-4.2.0'
CXX src/src_libzmq_la-proxy.lo
"src/proxy.cpp", line 157.34: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
"src/proxy.cpp", line 188.22: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
"src/proxy.cpp", line 189.51: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
"src/proxy.cpp", line 197.22: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
"src/proxy.cpp", line 198.25: 1540-0217 (S) "rtnevents" is not a member of "struct zmq_pollitem_t".
make[1]: *** [src/src_libzmq_la-proxy.lo] Error 1
make[1]: Leaving directory `/home/meb/zeromq-4.2.0'
make: *** [all-recursive] Error 1

@bluca
Copy link
Member

bluca commented Dec 1, 2016

Since I don't have access to an AIX system, would you be able to test this fix?

https://github.com/bluca/libzmq/tree/aix_poll

The include order was changed at some point, I suspect that's the issue.

@mbeddo
Copy link
Author

mbeddo commented Dec 2, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 2, 2016

Thanks, I've seen the snippet on the mailing list, that's definitely what's causing the problem.

Could you please try changing the very first include of poll.h in src/proxy.cpp and src/signaler.cpp from poll.h to sys/poll.h ?

@mbeddo
Copy link
Author

mbeddo commented Dec 2, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 2, 2016

Ah yes of course, the zmq_pollitem_t members won't match. Fixing it without breaking API and ABI is going to be interesting.

Perhaps adding a conditional #define at the bottom, something like:

typedef struct zmq_pollitem_t
{
    void *socket;
#if defined _WIN32
    SOCKET fd;
#else
    int fd;
#endif
    short events;
    short revents;
#if defined (ZMQ_HAVE_AIX)
#define reqevents events
#define rtnevents revents
#endif
} zmq_pollitem_t;

To make things even funnier they are different types, as the 64 bit ones are unsigned short instead of short...
Could you please try this?

Also it was added recently, specifically for AIX use, a different poller implementation: pollset
You might want to try that if it gets you going.

@mbeddo
Copy link
Author

mbeddo commented Dec 5, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 5, 2016

Is that with the patches or with the pollset?

@mbeddo
Copy link
Author

mbeddo commented Dec 5, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 5, 2016

A short while ago an AIX-specific poll implementation was added, so I was wondering if that would help you. You can select it with:

./configure --with-poller=pollset

@mbeddo
Copy link
Author

mbeddo commented Dec 5, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 5, 2016

Could you please run one of the tests manually to see what's the precise error?

LD_LIBRARY_PATH=src/.libs tests/.libs/test_pair_tcp

(This works on Linux, I hope it works on AIX too!)

Also, could you please do one more try with this branch and see if it still compiles? If it does I'll open a PR so that we can make progress. Once it at least builds then we can continue with the test case failures.

https://github.com/bluca/libzmq/tree/aix_poll

@mbeddo
Copy link
Author

mbeddo commented Dec 6, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 6, 2016

Ok, let's take it one bit at a time. Since the last version of the branch gives you a build and a test pass I'll start with that.

Once it's merged, we can go on.

Thanks for the assistance!

@bluca bluca reopened this Dec 6, 2016
@bluca
Copy link
Member

bluca commented Dec 6, 2016

Ok, could you please try from libzmq/master and see where we are now?

@mbeddo
Copy link
Author

mbeddo commented Dec 6, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 6, 2016

test_shutdown_stress and test_many_sockets are very resource-dependent so I wouldn't worry too much if they fail.

You could try to increase the limit of per-process file descriptors with:

ulimit -n 64000

And see if that helps.

For test_stream_exceeds_buffer I think some includes are missing (again!), could you please try from my branch:

https://github.com/bluca/libzmq/tree/aix_test

For libsodium, it's a library to provide encryption functionality to be used with ZMQ_CURVE. You do not need it if you are not going to use CURVE encryption. Also there is an internal implementation with tweetnacl, but for enterprise usage it's recommended to use libsodium as distributed by the supported platform in use.

@mbeddo
Copy link
Author

mbeddo commented Dec 6, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 6, 2016

I can't see how that diff could make the tests fail, that is very strange...

What's the error if you run one manually?

@mbeddo
Copy link
Author

mbeddo commented Dec 6, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 6, 2016

Ah, my master branch is extremely out of date as I don't use it.

This means the tests used to work, but at some point between today and the 16th of December 2015 they broke. This is going to be fun :-)

It's complaining that the signaler file descriptor is invalid. I can't see why, I'll try to have a look.

@mbeddo
Copy link
Author

mbeddo commented Dec 7, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 7, 2016

Ok, could you please do a git pull and try again? I fixed more headers

@bluca bluca reopened this Dec 7, 2016
@bluca
Copy link
Member

bluca commented Dec 7, 2016

@hnwyllmm you did some work on AIX, any chance you could please help us with this issue?

@mbeddo
Copy link
Author

mbeddo commented Dec 7, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 7, 2016

Ok, so at least it builds now :-)

I don't really know why the tests are reporting a bad file descriptor, I hope @hnwyllmm can help us

@hnwyllmm
Copy link
Contributor

hnwyllmm commented Dec 12, 2016

sorry for the late reponse. I forget to check the email.
In my test, the test_pair_tcp is running fine.
Here are the flags used with configure

export CFLAGS=-q64
export CXXFLAGS=-q64
export CC=xlc_r
export CXX=xlC_r
export LDFLAGS="-brtl -q64"
export NM="nm -X64"
export AR="ar -X64"

But there are other failure, such as test_req_correlate, test_inproc_connect and test_getsockopt_memset and so on.

@hnwyllmm
Copy link
Contributor

closed by #2251
All of test cases passed.
NOTE: you should use LIBPATH instead of LD_LIBRARY_PATH on AIX

@bluca
Copy link
Member

bluca commented Dec 13, 2016

Thanks! @mbeddo let us know if the latest version of master fixed the problem for you as well

@mbeddo
Copy link
Author

mbeddo commented Dec 13, 2016 via email

@bluca
Copy link
Member

bluca commented Dec 13, 2016

It could be. I'm glad all works now, sorry it took a while :-)

Since it's all building and all tests are passing I'm closing this now. Please open a new issue if you find other problems.

@bluca bluca closed this as completed Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants