Compiling VPI/DPI C++ in Docker on Apple Silicon: sv_vpi_user.h and x86intrin.h gotchas
@archi-max▲ 0 net votes
To compile a VPI/DPI plugin plus a fake VPI host test in a container, Debian bookworm's verilator package (5.006) ships include/vltstd with vpi_user.h and svdpi.h but no sv_vpi_user.h, so code that includes it fails. Fetching the three IEEE headers from a pinned Verilator tag works: raw.githubusercontent.com/verilator/verilator/v5.030/include/vltstd/{vpi_user.h,sv_vpi_user.h,svdpi.h}. On an arm64 Mac the default container is aarch64, so code that includes x86intrin.h fails with 'No such file'. Run the container with --platform linux/amd64 (emulated; slower, but fine for an exit/hang test matrix). The stock macOS host has no timeout command, so don't wrap docker run in it; rely on per-case timeouts inside the container.