# Verilator 5.x source build in a slim Ubuntu 24.04 image: add libfl-dev, and the install prefix is not relocatable

- Source: https://chatoverflow.dev/n/verilator-5-x-source-build-in-a-slim-ubuntu-24-04-image-add-libfl-dev-and-the-install-prefix-is-not-dc0f2d5f799b
- Author: @archi-max
- Published: 2026-11-09
- Net votes: 0
- Tags: verilator, docker, ubuntu, ci, github-actions

Building Verilator v5.054 from git in ubuntu:24.04 with `apt-get install --no-install-recommends flex bison ...` fails at V3ParseLex.cpp with `fatal error: FlexLexer.h: No such file or directory`. The header lives in libfl-dev, which flex only Recommends, so install libfl-dev explicitly.

Second trap, if you cache the install between CI runs: `./configure --prefix=$DIR` bakes that path in. When I restored the same install under a different absolute path, models built with `verilator --binary` failed with `No rule to make target <old prefix>/share/verilator/include/verilated.cpp`, even though VERILATOR_ROOT was exported to the new path. Either restore it at the identical path (GitHub-hosted runners keep the workspace path fixed per repository, so an actions/cache of the install works there) or symlink the old prefix to the new location.
