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

build fails #23

Open
sungbin opened this issue Aug 14, 2019 · 8 comments
Open

build fails #23

sungbin opened this issue Aug 14, 2019 · 8 comments

Comments

@sungbin
Copy link

sungbin commented Aug 14, 2019

In Mac OS(Mojave 10.14.5) and Linux(Ubuntu 18.04.2 LTS), cannot build.
I command $sh build.sh in src/main/

Error Message

Mac OS

rm -f *.pyc
make -C simple clean
rm -f .o lex.yy.cc pt_c.tab pt_c.y head.cc c_ptgen
make -C gcc clean
rm -f .o lex.yy.cc pt_c.tab pt_c.y head.cc gccptgen.a
make -C java clean
rm -f .o lex.yy.cc pt_j.tab pt_j.y head.cc javaptgen.a
make -C php5 clean
rm -f .o lex.yy.cc pt_zend_language_parser.tab pt_zend_language_parser.y head.cc phpptgen.a
make -C sol clean
rm -f .o lex.yy.cc pt_solidity. head.cc solidityptgen.a
make -C gcc
./mainc.py c.y
Traceback (most recent call last):
File "./mainc.py", line 43, in
import YaccParser,YaccLexer
File "../YaccParser.py", line 77
except antlr.RecognitionException, ex:
^
SyntaxError: invalid syntax
make[1]: *** [pt_c.y] Error 1
make: *** [TARGET] Error 2
Error: ptgen make failed. Exit.
Error: ptgen make failed. Deckard build fails.

Linux

rm -f *.pyc
make -C simple clean
make[1]: Entering directory '/home/imseongbin/Deckard/src/ptgen/simple'
rm -f .o lex.yy.cc pt_c.tab pt_c.y head.cc c_ptgen
make[1]: Leaving directory '/home/imseongbin/Deckard/src/ptgen/simple'
make -C gcc clean
make[1]: Entering directory '/home/imseongbin/Deckard/src/ptgen/gcc'
rm -f .o lex.yy.cc pt_c.tab pt_c.y head.cc gccptgen.a
make[1]: Leaving directory '/home/imseongbin/Deckard/src/ptgen/gcc'
make -C java clean
make[1]: Entering directory '/home/imseongbin/Deckard/src/ptgen/java'
rm -f .o lex.yy.cc pt_j.tab pt_j.y head.cc javaptgen.a
make[1]: Leaving directory '/home/imseongbin/Deckard/src/ptgen/java'
make -C php5 clean
make[1]: Entering directory '/home/imseongbin/Deckard/src/ptgen/php5'
rm -f .o lex.yy.cc pt_zend_language_parser.tab pt_zend_language_parser.y head.cc phpptgen.a
make[1]: Leaving directory '/home/imseongbin/Deckard/src/ptgen/php5'
make -C sol clean
make[1]: Entering directory '/home/imseongbin/Deckard/src/ptgen/sol'
rm -f .o lex.yy.cc pt_solidity. head.cc solidityptgen.a
make[1]: Leaving directory '/home/imseongbin/Deckard/src/ptgen/sol'
make -C gcc
make[1]: Entering directory '/home/imseongbin/Deckard/src/ptgen/gcc'
./mainc.py c.y
bison -d pt_c.y -o pt_c.tab.cc
make[1]: bison: Command not found
Makefile:59: recipe for target 'pt_c.tab.cc' failed
make[1]: *** [pt_c.tab.cc] Error 127
make[1]: Leaving directory '/home/imseongbin/Deckard/src/ptgen/gcc'
Makefile:35: recipe for target 'TARGET' failed
make: *** [TARGET] Error 2
Error: ptgen make failed. Exit.
Error: ptgen make failed. Deckard build fails.

plz, help me.

@zhengxiaohuaya
Copy link

@sungbin
hi,I also had this problem during installation. Do you have a solution?

@chenzimin
Copy link

Maybe this is related to #21?

@qw3ry
Copy link

qw3ry commented Feb 14, 2020

Looks like a python3 issue to me. If you have python2 still installed (its officially unsupported since Jan/20) you can edit the shebang in src/ptgen/*/main*.py from /usr/bin/env python to /usr/bin/env python2. This worked for me on Arch Linux.

@caicaifearless
Copy link

I met the same error on linux(Ubuntu 18.04.2 LTS) as your error on Mac. Did you solve your error on Mac?

@qw3ry
Copy link

qw3ry commented Mar 5, 2020

As I wrote, it works when you replace python with python2 in the first line of the python files in ptgen

@caicaifearless
Copy link

As I wrote, it works when you replace python with python2 in the first line of the python files in ptgen

Thanks.

@SavinduHerath
Copy link

C:\Deckard Source\Deckard\src\main>bash build.sh
rm -f *.pyc
make -C simple clean
make[1]: Entering directory '/mnt/c/Deckard Source/Deckard/src/ptgen/simple'
rm -f .o lex.yy.cc pt_c.tab pt_c.y head.cc c_ptgen
make[1]: Leaving directory '/mnt/c/Deckard Source/Deckard/src/ptgen/simple'
make -C gcc clean
make[1]: Entering directory '/mnt/c/Deckard Source/Deckard/src/ptgen/gcc'
rm -f .o lex.yy.cc pt_c.tab pt_c.y head.cc gccptgen.a
make[1]: Leaving directory '/mnt/c/Deckard Source/Deckard/src/ptgen/gcc'
make -C java clean
make[1]: Entering directory '/mnt/c/Deckard Source/Deckard/src/ptgen/java'
rm -f .o lex.yy.cc pt_j.tab pt_j.y head.cc javaptgen.a
make[1]: Leaving directory '/mnt/c/Deckard Source/Deckard/src/ptgen/java'
make -C php5 clean
make[1]: Entering directory '/mnt/c/Deckard Source/Deckard/src/ptgen/php5'
rm -f .o lex.yy.cc pt_zend_language_parser.tab pt_zend_language_parser.y head.cc phpptgen.a
make[1]: Leaving directory '/mnt/c/Deckard Source/Deckard/src/ptgen/php5'
make -C sol clean
make[1]: Entering directory '/mnt/c/Deckard Source/Deckard/src/ptgen/sol'
rm -f .o lex.yy.cc pt_solidity. head.cc solidityptgen.a
make[1]: Leaving directory '/mnt/c/Deckard Source/Deckard/src/ptgen/sol'
make -C gcc
make[1]: Entering directory '/mnt/c/Deckard Source/Deckard/src/ptgen/gcc'
./mainc.py c.y
bison -d pt_c.y -o pt_c.tab.cc
bison: pt_c.y: cannot open: No such file or directory
make[1]: *** [Makefile:59: pt_c.tab.cc] Error 1
make[1]: Leaving directory '/mnt/c/Deckard Source/Deckard/src/ptgen/gcc'
make: *** [Makefile:35: TARGET] Error 2
Error: ptgen make failed. Exit.
Error: ptgen make failed. Deckard build fails.

I get this error when building. Can anyone help me with this?

@wcy1997
Copy link

wcy1997 commented Sep 8, 2022

I have solved this problem.
This problem is mainly caused by the incompatibility of python2 and python3. The .py files in this project is written by python2, but it calls python3 in your computer during installation. An approach is to change these python2 files into python3 using 2to3.py.
2to3.py is a built-in tool of python. You can use it in Unix-like OS by:
2to3 -w xxx.py.
After transforming all python2 files into python3, it can be built successfully.

Another problem is assigning a value to True/False in several files(e.g /src/ptgrn/antlr.py). I just delete the relevent code fragment. I hope this will not cause other problems.

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

7 participants