Hello Jonathan, we recently got another report of compilation issue with old GCC, thus I went ahead and made setup.py pass the -std=gnu99 flag to the compiler. This works on my local setup and on the CI, and I am confident that it fixes the problem for you.
You can verify if the the patch solves your issue installing from the PR branch. These commands should do it, installing beancount in a virtual environment: mkdir beancount2.3 cd beancount2.3 python -m venv . bin/python -m pip install \ git+https://github.com/beancount/beancount.git@refs/pull/632/head Cheers, Dan On 25/02/2021 16:43, Jonathan Salles wrote: > Hi Dan, > > By the way, this is not a serious issue for me. I was just trying to > set up this CentOS system and use that, I still have my Mac Mini with > the old verson of Beancount (2.1 ish) and can/will install the newest on > the Macbook to try it there before I try to break the Mini one. > > Regards, > > Jonathan > > On Thursday, February 25, 2021 at 10:39:18 AM UTC-5 Jonathan Salles wrote: > > Hi Dan, > > Yes, Red Hat and therefore CentOS tend to be using "stable" > therefore old versions of everything. I am not even sure there is > Python 3 included, if it is it is 3.5 or less. Python 3 is not on > one or two of my CentOS systems. That may change with the new > version of CentOS, 8, as it is going to be ahead of Red Hat much to > the consternation of some sysadmins. If no one else is using > CentOS, instead of you going through the work of changing especially > the code, I could hack my setup.py or maybe install a newer gcc and > just put out a warning to CentOS users. > > Regards, > > Jonathan > > On Thursday, February 25, 2021 at 10:06:42 AM UTC-5 > [email protected] wrote: > > On 25/02/2021 15:58, Jonathan Salles wrote: > > Hi Dan, > > > > Thanks for replying. I did mean Python 3.8.2. I can never > find a > > keyboard that works properly ;>) The gcc in the work Centos, and > > probably the home, is gcc (GCC) 4.8.5 20150623 (Red Hat > 4.8.5-44). > > Uhm... This is a very old GCC! According to the docs, only more > recent > GCC versions default to gnu99 as C standard. I'll what is easier > between > tweaking setup.py without breaking it for other compilers and > removing > gnu99-C features from the C code. > > > I > > did see a make file in the git repository, is that used for > the general > > process and not the gcc? > > It is only used for automating some development tasks. > > Cheers, > Dan > > > > On Thursday, February 25, 2021 at 9:03:55 AM UTC-5 > [email protected] wrote: > > > > On 25/02/2021 14:50, Jonathan Salles wrote: > > > Hello Martin, and all. > > > > > > First, thanks Martin for creating and continuing to improve. > > Thanks to > > > all the users and contributors. Greatly appreciated. > > > > > > After a bit of a hiatus I am starting to upgrade as I am a bit > > behind. > > > My main use system is a Mac Mini running Mojave or High > Sierra (can't > > > upgrade, too old, stupid Apple). I have a Macbook Pro running > > Catalina, > > > but haven't installed Beancount to that. > > > > > > Trying to install on two CentOS systems, one mine and one at > > work. Both > > > running Centos 7.8 and recently updated. One has Python > 8.1, one has > > > Python 8.2. > > > > I think you mean Python 3.8.1 or 3.8.2. > > > > > Both are incurring this error: > > > beancount/parser/parser.c: In function ‘strtonl’: > > > beancount/parser/parser.c:53:5: error: ‘for’ loop initial > > > declarations are only allowed in C99 mode > > > for (size_t i = 0; i < len; ++i) { > > > ^ > > > beancount/parser/parser.c:53:5: note: use option > -std=c99 or > > > -std=gnu99 to compile your code > > > error: command 'gcc' failed with exit status 1 > > > > > > From the error and some web searching it looks like -std=c99 or > > > -std=gnu99 needs to be added to the makefile, or I need to > set it > > > somewhere in my gcc options. In the makefile it would > prevent others > > > from having this issue. > > > > Python extensions are compiled with setuptools, not wit a > Makefile, > > thus > > the setup.py may require some tweaking, or the code adjusted > to do not > > rely on c99 features. > > > > Which version of GCC is CentOS 7.8 shipping? > > > > Cheers, > > Dan > > > > -- > > You received this message because you are subscribed to the > Google > > Groups "Beancount" group. > > To unsubscribe from this group and stop receiving emails from > it, send > > an email to [email protected] > > <mailto:[email protected]>. > > To view this discussion on the web visit > > > > https://groups.google.com/d/msgid/beancount/0381a8f7-42ce-490c-9b2d-c6ad62fa5fa5n%40googlegroups.com > > <https://groups.google.com/d/msgid/beancount/0381a8f7-42ce-490c-9b2d-c6ad62fa5fa5n%40googlegroups.com> > > > > > <https://groups.google.com/d/msgid/beancount/0381a8f7-42ce-490c-9b2d-c6ad62fa5fa5n%40googlegroups.com?utm_medium=email&utm_source=footer > > <https://groups.google.com/d/msgid/beancount/0381a8f7-42ce-490c-9b2d-c6ad62fa5fa5n%40googlegroups.com?utm_medium=email&utm_source=footer>>. > > > -- > You received this message because you are subscribed to the Google > Groups "Beancount" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/57596f2f-7f46-4971-8355-73f806a5a05bn%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/57596f2f-7f46-4971-8355-73f806a5a05bn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/a21a0d54-d754-7ff4-510e-d378d2255e0b%40grinta.net.
