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

Error when compiling #4

Open
vetletm opened this issue Dec 7, 2020 · 8 comments
Open

Error when compiling #4

vetletm opened this issue Dec 7, 2020 · 8 comments

Comments

@vetletm
Copy link

vetletm commented Dec 7, 2020

When running sudo make (without sudo it fails due to permissions) after boot.sh and configure, it throws the following error:

p4rt/.libs/libp4rt.a(p4rt_libp4rt_la-p4rt.o): In function `p4rt_initialize_datapath':
/home/vetletm/P4-OvS/p4rt/p4rt.c:611: undefined reference to `PIGrpcServerPipelineConfigSet'
collect2: error: ld returned 1 exit status
Makefile:3841: recipe for target 'vswitchd/ovs-vswitchd' failed
make[2]: *** [vswitchd/ovs-vswitchd] Error 1
make[2]: Leaving directory '/home/vetletm/P4-OvS'
Makefile:5238: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/vetletm/P4-OvS'
Makefile:2887: recipe for target 'all' failed
make: *** [all] Error 2

The system is a fresh virtual machine in VirtualBox with Ubuntu 18.04.5 with linux kernel 4.15.0-126-generic.

P4, PI, gRPC, Protobuf were all installed using the installation script install-p4dev-v2.sh from jafingerhut/p4-guide as explained in its installation guide.

I get the same error with and without OpenVSwitch installed on the system.

@osinstom
Copy link
Owner

osinstom commented Dec 7, 2020

Hi! You need to install my fork of the PI library: https://github.com/osinstom/PI/tree/p4-ovs. I've added PIGrpcServerPipelineConfigSet there, which is required for P4-OvS.

@osinstom
Copy link
Owner

osinstom commented Dec 7, 2020

BTW, you should be able to run make without sudo

@vetletm
Copy link
Author

vetletm commented Dec 8, 2020

I started with a new, fresh machine and installed your fork of PI, still I get the same error.

gRPC is installed with version tags/v1.17.2, protobuf is at v3.6.1 as suggested in the PI documentation.

@osinstom
Copy link
Owner

@vetletm Did you use p4-ovs branch of my PI fork?

@vetletm
Copy link
Author

vetletm commented Dec 17, 2020

I've included what we had to do on a fresh Ubuntu 20.10 to make it build without any major issues:

apt-get update

sudo apt-get install -y automake cmake libjudy-dev libgmp-dev libpcap-dev libboost-all-dev libevent-dev libtool flex bison pkg-config g++ libssl-dev libnanomsg-dev libjudy-dev libreadline-dev valgrind libtool-bin libboost-dev libboost-system-dev libboost-thread-dev

sudo apt-get install -y python3-pip python3-dev
sudo pip3 install nnpy

# == Thrift ==
cd "$BASE_DIR"
git clone https://github.com/apache/thrift
cd thrift
git checkout v0.13.0
./bootstrap.sh
./configure --prefix=/usr
make
sudo make install

# == PI ==
sudo apt install -y libnanomsg-dev \
   libprotobuf-dev protobuf-compiler protobuf-compiler-grpc \
   libgrpc++-dev libgrpc-dev libgc-dev

cd "$BASE_DIR"
git clone https://github.com/osinstom/PI   # *NOT* upstream: https://github.com/p4lang/PI
cd PI
git checkout p4-ovs
git submodule update --init
./autogen.sh
./configure --prefix=/usr --with-proto --with-fe-cpp --with-cli --with-internal-rpc --with-gnu-ld
make
sudo make install

# == P4-OvS ==
cd "$BASE_DIR"
git clone https://github.com/simula/P4-OvS
cd P4-OvS
git remote add upstream https://github.com/osinstom/P4-OvS.git
git checkout dreibh/build-fix-16Dec2020
./boot.sh
./configure
make

Apparently there were some missing pieces in the automake for ovs-vswitchd, you can see exactly what here: simula@fab1487

@osinstom
Copy link
Owner

I'm happy that you succeeded to install P4-OVS! Would you mind to create PR with the above modifications to vswitchd/automake.mk ?

@vetletm
Copy link
Author

vetletm commented Jan 25, 2021

Hi, sorry for the late response.

I've been waiting for a response from the person who did the actual legwork, but since I've yet to hear anything I'll create a PR by the end of this week.

@fatihusta
Copy link

Hi,
First of all Thank you for your effort for this project.
I'm testing p4-ovs on my lab.
I'm using ubuntu20.04 vm in proxmox.

I saw the same problem above and fixed it like here.
After;
I compiled many dependencies. (that was so painful :) )
I started the ovs-vswitchd, but that waiting something,

2021-01-27T11:31:28Z|00001|vlog|INFO|opened log file /var/log/openvswitch/ovs-vswitchd.log
2021-01-27T11:31:28Z|00002|ovs_numa|INFO|Discovered 3 CPU cores on NUMA node 0
2021-01-27T11:31:28Z|00003|ovs_numa|INFO|Discovered 3 CPU cores on NUMA node 1
2021-01-27T11:31:28Z|00004|ovs_numa|INFO|Discovered 2 NUMA nodes and 6 CPU cores
2021-01-27T11:31:28Z|00005|reconnect|INFO|unix:/usr/local/var/run/openvswitch/db.sock: connecting...
2021-01-27T11:31:28Z|00006|reconnect|INFO|unix:/usr/local/var/run/openvswitch/db.sock: connected


CTRL + C


^CServer listening on 0.0.0.0:50051
2021-01-27T11:31:45Z|00007|bridge|INFO|Setting P4 support for bridge br0
2021-01-27T11:31:45Z|00001|fatal_signal(ipf_clean1)|WARN|terminating with signal 2 (Interrupt)


I restarted the OVS with strace. And I saw this trace line.

connect(16, {sa_family=AF_UNIX, sun_path="/tmp/pi_rpc.ipc"}, 110) = -1 ENOENT (No such file or directory)

How can I pass this step?

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

3 participants