p4lang / behavioral-model

The reference P4 software switch
Apache License 2.0
532 stars 327 forks source link

Debian package simple_switch_grpc: undefined symbol #1184

Closed fruffy-bfn closed 1 year ago

fruffy-bfn commented 1 year ago

Trying to run simple_switch_grpc on my Ubuntu20.04 system after installing with sudo apt install p4lang-bmv2 fails with

❯ simple_switch_grpc                                                                
simple_switch_grpc: symbol lookup error: simple_switch_grpc: undefined symbol: _ZTVN10bm_runtime8standard28InvalidToeplitzHashOperationE

It seems like a dynamically linked symbol is missing. What is the best way to fix this? @rst0git do you know?

rst0git commented 1 year ago

Hi Fabian, I've tested bmv2 inside an Ubuntu 20.04 container, but I'm not able to replicate this problem.

podman run -it ubuntu:20.04 bash

apt-get update
apt-get install curl gpg -y
source /etc/os-release
echo "deb http://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${VERSION_ID}/ /" | tee /etc/apt/sources.list.d/home:p4lang.list
curl -fsSL "https://download.opensuse.org/repositories/home:p4lang/xUbuntu_${VERSION_ID}/Release.key" | gpg --dearmor | tee /etc/apt/trusted.gpg.d/home_p4lang.gpg > /dev/null
apt update
apt-get install p4lang-bmv2

simple_switch_grpc --help

Could you try to uninstall and install the package again as follows?

apt-get purge p4lang-bmv2 p4lang-pi
apt-get autoremove
apt-get upgrade  
apt-get install p4lang-bmv2
fruffy-bfn commented 1 year ago

Ah, turns out I had an old version of PI floating around in /usr/local. I removed it and now things are working. Thanks for taking the time to look into this!