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

Failed to build smtp module on CentOS 7 #39

Closed
olegrok opened this issue Apr 28, 2021 · 4 comments · Fixed by #40
Closed

Failed to build smtp module on CentOS 7 #39

olegrok opened this issue Apr 28, 2021 · 4 comments · Fixed by #40
Labels
bug Something isn't working build

Comments

@olegrok
Copy link
Contributor

olegrok commented Apr 28, 2021

#27 203.7 [ 66%] Building C object smtp/CMakeFiles/lib.dir/smtpc.c.o
#27 203.7 /tmp/luarocks_smtp-0.0.5-1-kgB1u4/smtp/smtp/smtpc.c: In function ‘check_libcurl_protocol’:
#27 203.7 /tmp/luarocks_smtp-0.0.5-1-kgB1u4/smtp/smtp/smtpc.c:103:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
#27 203.7   for (const char * const *p = info->protocols; *p != NULL; ++p) {
#27 203.7   ^
#27 203.7 /tmp/luarocks_smtp-0.0.5-1-kgB1u4/smtp/smtp/smtpc.c:103:2: note: use option -std=c99 or -std=gnu99 to compile your code
#27 203.7 gmake[2]: *** [smtp/CMakeFiles/lib.dir/smtpc.c.o] Error 1
#27 203.7 gmake[1]: *** [smtp/CMakeFiles/lib.dir/all] Error 2
#27 203.7 gmake: *** [all] Error 2
#27 203.7 
#27 203.7 Error: Failed installing dependency: http://rocks.tarantool.org/smtp-0.0.5-1.rockspec - Build error: Failed building.
#27 211.1    ⨯ Failed to install rocks: Failed to run 
#27 211.1 /opt/tarantool-enterprise/tarantoolctl rocks make
olegrok added a commit that referenced this issue Apr 28, 2021
This patch adds "-std=gnu99" flag to fix following error when user
tries to build on CentOS 7:
```
[ 66%] Building C object smtp/CMakeFiles/lib.dir/smtpc.c.o
/tmp/luarocks_smtp-0.0.5-1-kgB1u4/smtp/smtp/smtpc.c: In function ‘check_libcurl_protocol’:
/tmp/luarocks_smtp-0.0.5-1-kgB1u4/smtp/smtp/smtpc.c:103:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
 for (const char * const *p = info->protocols; *p != NULL; ++p) {
 ^
/tmp/luarocks_smtp-0.0.5-1-kgB1u4/smtp/smtp/smtpc.c:103:2: note: use option -std=c99 or -std=gnu99 to compile your code
gmake[2]: *** [smtp/CMakeFiles/lib.dir/smtpc.c.o] Error 1
gmake[1]: *** [smtp/CMakeFiles/lib.dir/all] Error 2
gmake: *** [all] Error 2

Error: Failed installing dependency: http://rocks.tarantool.org/smtp-0.0.5-1.rockspec - Build error: Failed building.
```

Closes #39
@olegrok olegrok mentioned this issue Apr 28, 2021
@olegrok olegrok added bug Something isn't working build labels Apr 28, 2021
@Totktonada
Copy link
Member

$ docker run -it centos:7
[root@b5dc13f9efe1 /]# yum install -y gcc
[root@b5dc13f9efe1 /]# gcc --version | head -n 1
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

The problem is quite similar to tarantool/small#25.

@olegrok
Copy link
Contributor Author

olegrok commented Apr 28, 2021

And there was the same problem in tuple-merger tarantool/tuple-merger@489ac0e

@djorem
Copy link

djorem commented Apr 28, 2021

I have the same problem.

@Totktonada
Copy link
Member

I'll merge Oleg's PR and make release 0.0.6 a bit sooner today.

Totktonada pushed a commit that referenced this issue Apr 28, 2021
This patch adds "-std=gnu99" flag to fix following error when user
tries to build on CentOS 7:
```
[ 66%] Building C object smtp/CMakeFiles/lib.dir/smtpc.c.o
/tmp/luarocks_smtp-0.0.5-1-kgB1u4/smtp/smtp/smtpc.c: In function ‘check_libcurl_protocol’:
/tmp/luarocks_smtp-0.0.5-1-kgB1u4/smtp/smtp/smtpc.c:103:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
 for (const char * const *p = info->protocols; *p != NULL; ++p) {
 ^
/tmp/luarocks_smtp-0.0.5-1-kgB1u4/smtp/smtp/smtpc.c:103:2: note: use option -std=c99 or -std=gnu99 to compile your code
gmake[2]: *** [smtp/CMakeFiles/lib.dir/smtpc.c.o] Error 1
gmake[1]: *** [smtp/CMakeFiles/lib.dir/all] Error 2
gmake: *** [all] Error 2

Error: Failed installing dependency: http://rocks.tarantool.org/smtp-0.0.5-1.rockspec - Build error: Failed building.
```

Closes #39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants