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

Fails to build on SL6.9 because of old unity version C99 incompatibility #3603

Closed
bl0x opened this issue Jul 31, 2019 · 7 comments
Closed

Fails to build on SL6.9 because of old unity version C99 incompatibility #3603

bl0x opened this issue Jul 31, 2019 · 7 comments

Comments

@bl0x
Copy link
Contributor

bl0x commented Jul 31, 2019

Please use this template for reporting suspected bugs or requests for help.

Issue description

Build fails with error message because of C99 style variable initialisation in bundled unity framework.

Environment

  • libzmq version (commit hash if unreleased):
    commit a8d1905
  • OS:
    Scientific Linux 6.9
  • Compiler:
    gcc 4.4.7

Minimal test code / Steps to reproduce the issue

  1. Compilation fails

What's the actual result? (include assertion message & call stack if applicable)

[ 49%] Building C object tests/CMakeFiles/unity.dir/__/external/unity/unity.c.o
/home/AMS/drasiams/libzmq/external/unity/unity.c: In function ‘UnityParseOptions’:
/home/AMS/drasiams/libzmq/external/unity/unity.c:1408: error: ‘for’ loop initial declarations are only allowed in C99 mode
/home/AMS/drasiams/libzmq/external/unity/unity.c:1408: note: use option -std=c99 or -std=gnu99 to compile your code

What's the expected result?

Compilation should succeed.

@bluca
Copy link
Member

bluca commented Jul 31, 2019

This works fine in our CI (afaik CentOS 6 has the same base as SL6, same GCC version):

https://build.opensuse.org/build/network:messaging:zeromq:git-stable/CentOS_6/x86_64/libzmq/_log

Looks like a problem in your build environment or in CMake, can you use autotools instead?

@bluca
Copy link
Member

bluca commented Jul 31, 2019

ah I see the problem - in autoconf we set std=c99, but in cmake we don't. If you want to use cmake, can you send a PR to fix that?

@bluca
Copy link
Member

bluca commented Jul 31, 2019

basically this IF needs an ELSE that sets -std=gnu99: https://github.com/zeromq/libzmq/blob/master/CMakeLists.txt#L68

@bl0x
Copy link
Contributor Author

bl0x commented Aug 1, 2019

Opened PR #3605 to fix this issue.

@bl0x
Copy link
Contributor Author

bl0x commented Aug 1, 2019

I've tried using autotools, but the version of autoconf is too old. 2.63 instead of required 2.64.

When using autoconf from another machine to produce the configure.sh script, autotools build succeeds on SL6.9 without any change required.

sigiesec added a commit that referenced this issue Aug 1, 2019
@bluca
Copy link
Member

bluca commented Aug 1, 2019

@bl0x thanks for the PR, 2 suggestions:

  1. We publish make-dist tarballs which means you don't have to use autotools, the configure is provided, eg: https://github.com/zeromq/libzmq/releases/download/v4.3.2/zeromq-4.3.2.tar.gz
  2. On most Linux distros and architectures we also provide packages so you don't have to rebuild at all, and CentOS 6 is included: https://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Arelease-stable&package=zeromq-devel

@bl0x
Copy link
Contributor Author

bl0x commented Aug 1, 2019

Thank you for these suggestions.
In the current case I had no permission to install a package on the machine in question.

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

No branches or pull requests

2 participants