ledatelescope / bifrost

A stream processing framework for high-throughput applications.
BSD 3-Clause "New" or "Revised" License
66 stars 29 forks source link

ValueError: invalid literal for long() with base 8: '08420217248550443400745280086994171' #115

Closed gijzelaerr closed 2 years ago

gijzelaerr commented 6 years ago

compiling latest master branch 1e61eda4276f5cebf3784234df333f39ba947612 gives

λ  make
make -C src all
make[1]: Entering directory '/packaging/kern/upstream_repos/bifrost/src'
make[1]: Leaving directory '/packaging/kern/upstream_repos/bifrost/src'
make -C python build
make[1]: Entering directory '/packaging/kern/upstream_repos/bifrost/python'
ctypesgen.py -lbifrost -I../src ../src/bifrost/address.h ../src/bifrost/ring.h ../src/bifrost/cuda.h ../src/bifrost/fdmt.h ../src/bifrost/transpose.h ../src/bifrost/udp_capture.h ../src/bifrost/memory.h ../src/bifrost/udp_transmit.h ../src/bifrost/common.h ../src/bifrost/unpack.h ../src/bifrost/udp_socket.h ../src/bifrost/affinity.h ../src/bifrost/fft.h ../src/bifrost/map.h ../src/bifrost/proclog.h ../src/bifrost/linalg.h ../src/bifrost/array.h ../src/bifrost/quantize.h ../src/bifrost/reduce.h -o bifrost/libbifrost_generated.py
INFO: Status: Preprocessing /tmp/tmpzPyj7b.h
INFO: Status: gcc -E -U __GNUC__ -dD -I../src "-Dinline=" "-D__inline__=" "-D__extension__=" "-D__const=const" "-D__asm__(x)=" "-D__asm(x)=" "-DCTYPESGEN=1" "/tmp/tmpzPyj7b.h"
Traceback (most recent call last):
  File "/usr/bin/ctypesgen.py", line 154, in <module>
    descriptions=ctypesgencore.parser.parse(options.headers,options)
  File "/usr/lib/python2.7/dist-packages/ctypesgencore/parser/__init__.py", line 21, in parse
    parser.parse()
  File "/usr/lib/python2.7/dist-packages/ctypesgencore/parser/datacollectingparser.py", line 69, in parse
    ctypesparser.CtypesParser.parse(self, fname, None)
  File "/usr/lib/python2.7/dist-packages/ctypesgencore/parser/cparser.py", line 113, in parse
    self.preprocessor_parser.parse(filename)
  File "/usr/lib/python2.7/dist-packages/ctypesgencore/parser/preprocessor.py", line 200, in parse
    token = self.lexer.token()
  File "/usr/lib/python2.7/dist-packages/ctypesgencore/parser/preprocessor.py", line 51, in token
    result = lex.Lexer.token(self)
  File "/usr/lib/python2.7/dist-packages/ctypesgencore/parser/lex.py", line 297, in token
    newtok = func(tok)
  File "/usr/lib/python2.7/dist-packages/ctypesgencore/parser/pplexer.py", line 218, in t_ANY_int
    g1 = str(long(g1,8))
ValueError: invalid literal for long() with base 8: '08420217248550443400745280086994171'
Makefile:47: recipe for target 'bifrost/libbifrost_generated.py' failed
make[1]: *** [bifrost/libbifrost_generated.py] Error 1
make[1]: Leaving directory '/packaging/kern/upstream_repos/bifrost/python'
Makefile:42: recipe for target 'python' failed
make: *** [python] Error 2
jaycedowell commented 6 years ago

This looks like a bad interaction between ctypesgen and gcc7, e.g., https://trac.osgeo.org/grass/ticket/3331

benbarsdell commented 6 years ago

Indeed, I can reproduce this on Ubuntu 18.04 with gcc 7.3.0. The issue is specifically described here: https://trac.osgeo.org/grass/ticket/3331#comment:17 And there are two patches for the parser attached here: https://trac.osgeo.org/grass/ticket/3331#comment:20 But I haven't yet worked out how/where to apply them, as ctypesgen seems to have its own copy of the parser.

jaycedowell commented 6 years ago

It looks like they (GRASS) include a version of ctypesgen in their distribution. Maybe the thing to do it for leda_telescope to fork ctypesgen, fix this bug, and then update the bifrost documentation to point to the new repository. I'm usually against such things but the ctypesgen version that we currently point to has not been updated since May 2015.

gijzelaerr commented 6 years ago

i've manually tried the two fixes in the patches mentioned in the comment, but the error remains the same.

gijzelaerr commented 6 years ago

I managed to get it to work with this patch:

https://github.com/kernsuite-debian/ctypesgen/blob/master/debian/patches/Fix-invalid-literal-for-long.path

You can use this patch to patch the ctypesgen found here:

https://github.com/davidjamesca/ctypesgen

The patch is included in our Ubuntu 18.04 package ctypesgen for KERN:

http://kernsuite.info/

for which i'm also making a bifrost package.