exaexa / scattermore

very fast scatterplots for R
https://exaexa.github.io/scattermore/
GNU General Public License v3.0
243 stars 7 forks source link

ERROR: compilation failed for package ‘scattermore’ | error: ‘for’ loop initial declarations are only allowed in C99 mode #9

Closed carmensandoval closed 2 years ago

carmensandoval commented 3 years ago

When attempting to install scattermore (as a dependency of Seurat), I get the following error:

scattermore.c:109:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int x = pxb; x < pxe; ++x)                                        \
  ^
scattermore.c:131:5: note: in expansion of macro ‘paint_circle’
     paint_circle;
     ^
scattermore.c:110:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (int y = pyb; y < pye; ++y) {                              \
   ^
scattermore.c:131:5: note: in expansion of macro ‘paint_circle’
     paint_circle;
     ^
make: *** [scattermore.o] Error 1
ERROR: compilation failed for package ‘scattermore’

I suspect it is related to this: https://stackoverflow.com/questions/29338206/error-for-loop-initial-declarations-are-only-allowed-in-c99-mode

Any suggestions on how to overcome this error?

Thank you.

exaexa commented 3 years ago

Hi! Thanks for reporting this -- technically, I made an error there because using non-C99 syntax for the loop iterators, it's an easy fix though. Will try to push the fixed version ASAP. Just for completeness -- what precise environment/C compiler produces this error for you?

exaexa commented 3 years ago

ok that was quicker than I expected, can you try the fixed version from the master branch using this:

devtools::install_github('exaexa/scattermore')

?

exaexa commented 2 years ago

I assume this is closed by 1dc0a0eee8b8346636a79ae11797dd047ffc66b3 , I will release this in version 0.8 on CRAN asap now. Please reopen if the problem doesn't get fixed.