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

"make -j4" failed in the dir p4c/build #628

Closed
chenxiang2019 opened this issue May 13, 2017 · 2 comments
Closed

"make -j4" failed in the dir p4c/build #628

chenxiang2019 opened this issue May 13, 2017 · 2 comments

Comments

@chenxiang2019
Copy link

Hello,

I'm tring p4c in these days. But when I follow the instructions that used to install p4c, I got stuck with one error so that I cannot find a suitable way to resolve it.

My System Settings

  • Ubuntu 14.04, 64bit

  • gcc version:

gcc (Ubuntu 4.9.4-2ubuntu1~14.04.1) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

My Steps

1.Update gcc to the version 4.9.4

2.Install the necessary dependencies, including protobuf.

3.follow the instructions of README:

./bootstrap.sh
cd build
make -j4
make check -j4

Error Log:

flex  -t ../tools/ir-generator/ir-generator-lex.l > tools/ir-generator/ir-generator-lex.c
  YACC     frontends/parsers/p4/p4parser.cpp
  YACC     frontends/parsers/v1/v1parser.cpp
/usr/local/bin/protoc /home/wasdns/p4c/build/../control-plane/PI/proto/p4/config/p4info.proto --cpp_out control-plane -I/home/wasdns/p4c/build/../control-plane/PI/proto
  YACC     tools/ir-generator/ir-generator.cpp
/home/wasdns/p4c/build/../tools/ir-generator/ir-generator.ypp: warning: 4 shift/reduce conflicts [-Wconflicts-sr]
(CDPATH="${ZSH_VERSION+.}:" && cd .. && /bin/bash /home/wasdns/p4c/missing autoheader)
updating tools/ir-generator/ir-generator.output
updating tools/ir-generator/ir-generator.hpp
  CXX      tools/ir-generator/ir-generator.o
rm -f stamp-h1
touch ../config.h.in
  CXX      unified-sources-irgenerator-0.o
updating frontends/parsers/v1/stack.hh
updating frontends/parsers/p4/stack.hh
updating frontends/parsers/p4/p4parser.output
updating frontends/parsers/v1/v1parser.output
updating frontends/parsers/p4/p4parser.hpp
  CXX      unified-sources-libp4ctoolkit_a-0.o
updating frontends/parsers/v1/v1parser.hpp
  CXX      unified-sources-libp4ctoolkit_a-1.o
cd . && /bin/bash ./config.status config.h
  AR       libp4ctoolkit.a
config.status: creating config.h
config.status: config.h is unchanged
  CXXLD    irgenerator
./irgenerator -t ir/gen-tree-macro.h -i ir/ir-generated.cpp ../ir/base.def ../ir/type.def ../ir/expression.def ../ir/ir.def ../ir/v1.def ../frontends/p4-14/ir-v1.def ../backends/bmv2/bmv2.def >ir/ir-generated.h || ( rm ir/ir-generated.h && false )
make  all-am
make[1]: Entering directory `/home/wasdns/p4c/build'
  LEX      frontends/parsers/v1/v1lexer.cc
  CXX      frontends/parsers/v1/v1parser.lo
  LEX      frontends/parsers/p4/p4lexer.cc
  CXX      unified-sources-p4c_bm2_ss-0.o
  CXX      unified-sources-p4c_bm2_ss-1.o
make[2]: Entering directory `/home/wasdns/p4c/build'
 /bin/mkdir -p '/home/wasdns/p4c/build/p4c_src'
 /usr/bin/install -c -m 644 ../tools/driver/p4c_src/main.py ../tools/driver/p4c_src/util.py ../tools/driver/p4c_src/config.py ../tools/driver/p4c_src/__init__.py ../tools/driver/p4c_src/p4c.bmv2.cfg ../tools/driver/p4c_src/p4c.ebpf.cfg '/home/wasdns/p4c/build/p4c_src'
Byte-compiling python modules...
main.pyutil.pyconfig.py__init__.py
Byte-compiling python modules (optimized versions) ...
main.pyutil.pyconfig.py__init__.py
 /bin/mkdir -p '/home/wasdns/p4c/build/p4include'
 /usr/bin/install -c -m 644 ../backends/ebpf/p4include/ebpf_model.p4 ../p4include/core.p4 ../p4include/p4d2model.p4 ../p4include/psa.p4 ../p4include/v1model.p4 '/home/wasdns/p4c/build/p4include'
make  install-data-hook
make[3]: Entering directory `/home/wasdns/p4c/build'
make[3]: Leaving directory `/home/wasdns/p4c/build'
make[2]: Leaving directory `/home/wasdns/p4c/build'
  CXX      setup.lo
  CXX      unified-sources-common_frontend-0.lo
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
make[1]: *** [unified-sources-p4c_bm2_ss-0.o] Error 4
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/wasdns/p4c/build'
make: *** [all] Error 2

Could you give me some advice on it? It seems to be some steps that I used to install p4c are wrong or missed. Thank you!

Best regards,
Chen.

@antoninbas
Copy link
Member

You don't have enough memory to compile with -j4, which is why the compiler process is killed. The unified build means that each compilation unit is quite large. Try compiling with -j2. If that fails, try without parallel make.

@chenxiang2019
Copy link
Author

@antoninbas

Thank you very much! It works fine with the command make -j2.

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

2 participants