jaxry / bubblechan

the two-dimensional 4chan reader.
Other
5 stars 2 forks source link

npm run build error #1

Closed lehitoskin closed 9 years ago

lehitoskin commented 9 years ago
lehi@rydia ~/p/j/bubblechan> npm run build

> bubblechan@0.0.1 build /home/lehi/prog/js/bubblechan
> gcc force_direct.c -o ./bin/force_direct -lm -O3

force_direct.c: In function ‘create_nodes’:
force_direct.c:81:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < nodes_length; i++) 
     ^
force_direct.c:81:5: note: use option -std=c99 or -std=gnu99 to compile your code
force_direct.c: In function ‘create_edges’:
force_direct.c:102:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < edges_length; i++)
     ^
force_direct.c: In function ‘output_graph’:
force_direct.c:115:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < nodes.size; i++) 
     ^
force_direct.c: In function ‘force_direct’:
force_direct.c:129:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < ITERATIONS; i++)
     ^
force_direct.c:131:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for (int n = 0; n < nodes.size; n++) 
         ^
force_direct.c:136:18: error: redefinition of ‘n’
         for (int n = 0; n < nodes.size; n++)
                  ^
force_direct.c:131:18: note: previous definition of ‘n’ was here
         for (int n = 0; n < nodes.size; n++) 
                  ^
force_direct.c:136:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for (int n = 0; n < nodes.size; n++)
         ^
force_direct.c:138:13: error: ‘for’ loop initial declarations are only allowed in C99 mode
             for (int p = n + 1; p < nodes.size; p++)
             ^
force_direct.c:147:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for (int e = 0; e < edges.size; e++) 
         ^
force_direct.c:155:18: error: redefinition of ‘n’
         for (int n = 0; n < nodes.size; n++)
                  ^
force_direct.c:136:18: note: previous definition of ‘n’ was here
         for (int n = 0; n < nodes.size; n++)
                  ^
force_direct.c:155:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for (int n = 0; n < nodes.size; n++)
         ^

npm ERR! bubblechan@0.0.1 build: `gcc force_direct.c -o ./bin/force_direct -lm -O3`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bubblechan@0.0.1 build script.
npm ERR! This is most likely a problem with the bubblechan package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gcc force_direct.c -o ./bin/force_direct -lm -O3
npm ERR! You can get their info via:
npm ERR!     npm owner ls bubblechan
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.0.5-gentoo
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "run" "build"
npm ERR! cwd /home/lehi/prog/js/bubblechan
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/lehi/prog/js/bubblechan/npm-debug.log
npm ERR! not ok code 0

Obviously it'd be simple to just specify -std=gnu99, but I can't seem to find the relevant file that contains the compilation instructions. (and I'm tired).

lehitoskin commented 9 years ago

After a few hours of sleep, I found things. PR incoming.

jaxry commented 9 years ago

Would it make more sense to use C11 since it is the current standard?

lehitoskin commented 9 years ago

Not unless there's C11-specific stuff. This will also allow people to run older versions of gcc that don't have C11.