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

Compilation issue on 0.2.5 #50

Closed
areski opened this issue Dec 11, 2018 · 6 comments
Closed

Compilation issue on 0.2.5 #50

areski opened this issue Dec 11, 2018 · 6 comments

Comments

@areski
Copy link

areski commented Dec 11, 2018

On Debian 8 (jessie) I'm having a compilation issue, see message below, this error doesn't occur if I pin to the previous release 0.2.4.
For info, I use esqlite elixir/sqlitex.

===> Compiling pc
===> Compiling esqlite
===> Compiling /app/deps/esqlite/c_src/esqlite3_nif.c
===> /app/deps/esqlite/c_src/esqlite3_nif.c: In function �make_row�:
/app/deps/esqlite/c_src/esqlite3_nif.c:537:5: error: �for� loop initial declarations are only allowed in C99 or C11 mode
for(int i = 0; i < size; i++)
^
/app/deps/esqlite/c_src/esqlite3_nif.c:537:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
/app/deps/esqlite/c_src/esqlite3_nif.c: At top level:
/app/deps/esqlite/c_src/esqlite3_nif.c:107:1: warning: �make_row_tuple� defined but not used [-Wunused-function]
make_row_tuple(ErlNifEnv *env, ERL_NIF_TERM value)
^

Docker images -> https://github.com/areski/excdr-pusher/tree/master/docker

Let me know if I can provide more information to help solving this issue.
Thanks!

@ConnorRigby
Copy link
Contributor

This is interesting. What OS and version of GCC are you using?

@areski
Copy link
Author

areski commented Dec 11, 2018

Thanks for quick answer.
Using docker to compile to match our production OS, we use Debian 8 (Jessie) using that docker file -> https://github.com/areski/excdr-pusher/blob/master/docker/Dockerfile.Jessie.Erlang21

gcc --version
gcc (Debian 4.9.2-10+deb8u1) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE

@ConnorRigby
Copy link
Contributor

gcc 4.9 was released way back in 2015, i highly suggest upgrading if you can.
I suspect this is the
commit that broke this for you. I will pull request a fix and release as soon as it's merged.

@areski
Copy link
Author

areski commented Dec 11, 2018

Thanks a bunch for the pointer! Which version of gcc would you recommend?

@ConnorRigby
Copy link
Contributor

cc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

modern Ubuntu uses 7.3

cc --version                                                                                                                                5.2s  Tue 11 Dec 2018 08:42:29 AM PST
cc (GCC) 8.2.1 20181127
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

My Arch Linux install uses 8.2

That said i opened a PR that should fix this issue. If you could test it out i'd appreciate it. Let me know if you have any more issues.

@areski
Copy link
Author

areski commented Dec 11, 2018

Downloaded your PR locally and my build works, so it works for me.
Thanks a lot, let me know if there is a way I can buy you a beer!

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

No branches or pull requests

2 participants