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

Fix build #35

Closed
wants to merge 3 commits into from
Closed

Fix build #35

wants to merge 3 commits into from

Conversation

ptpt
Copy link

@ptpt ptpt commented Dec 11, 2015

  1. ZMQ_STREAM_NOTIFY actually is avaliable since zeromq 4.2. See http://lists.zeromq.org/pipermail/zeromq-dev/2015-September/029619.html
  2. The flag -lpthread seems to be required
  3. The if statement without braces causes syntax error in newer gcc versions (gcc5.2 and 5.3)
src/netstring_protocol.cpp: In member function ‘virtual void prime_server::netstring_server_t::dequeue(const uint64_t&, size_t)’:
src/netstring_protocol.cpp:161:5: error: ‘else’ without a previous ‘if’
     else if(log)
     ^

@kevinkreiser
Copy link
Owner

RE: ZMQ_STREAM_NOTIFY, not true, it was just that they broke it for a small time, see: zeromq/libzmq#1316

wow new gcc care about brackets like that, that seems ridiculous...

we cant require pthread without checking for it in configure and setting up some variables to hold it. so ill see about making and testing these fixes possibly this weekend.

@ptpt
Copy link
Author

ptpt commented Dec 11, 2015

On Fri, Dec 11, 2015 at 1:22 PM, Kevin Kreiser notifications@github.com
wrote:

RE: ZMQ_STREAM_NOTIFY, not true, it was just that they broke it for a
small time, see: zeromq/libzmq#1316
zeromq/libzmq#1316

​It's broken in 4.1.3 which is the latest stable version
http://zeromq.org/intro:get-the-software. Exclude this version in the macro
preprocessor?

@kevinkreiser
Copy link
Owner

so i fired up a vm with ubuntu 15.10. installed gcc 5.2. if you use the libzmq package that comes with the system as the readme suggests everything compiles without issue. ill try getting 4.1.3 and confirming that its broken, because i definitely like the way you checked if ZMQ_STREAM_NOTIFY is defined or not instead of the version checking.

i cannot reproduce the pthread stuff or the stuff with brackets. with respect to the latter i cant see how any compiler would ever make that illegal since its been standard syntax for decades..

the pthread stuff i have heard from others before but couldnt make it happen. it seems that some systems automatically link it if needed? what os are you doing this on? to solve the pthread stuff once and for all it would be nice to detect it with AX_ macros and have variables set to use in the Makefile.am instead of hardcoding it.

@ptpt
Copy link
Author

ptpt commented Dec 12, 2015

Sorry it's me forgetting update the submodules. I was using the submodule logging of 7 month old. In that version the macro LOG_WARN ends with a semicolon, and in the code LOG_WARN("..."); ends with another semicolon. Double semicolon under the if caused the syntax problem.

I'm using Arch Linux and here are the packages shipped with the system:

boost 1.59.0-5
boost-libs 1.59.0-5
gcc 5.3.0-2
gcc-libs 5.3.0-2
zeromq 4.1.3-4

@kevinkreiser
Copy link
Owner

hey @ptpt, i've resolved 2 of the 3 things in this pr via other issues. specifically I've fixed up the use of ZMQ_STREAM_NOTIFY and the braces around that LOG_WARN

do you mind if i convert this pr into an issue stating that some os's require you to add -lpthread to use std::thread stuff? i am hoping that there is something i can do with autotools in configure.ac that will make this happen automatically

@ptpt
Copy link
Author

ptpt commented Apr 21, 2016

Sure @kevinkreiser
Thanks for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants