google / google/CFU-Playground

LiteX / Verilator simulation doesn't work in Conda env; missing json_c/json.h, event2.listener.h

Open
#552 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Verilog
Stars
565
Forks
160
PR merge metrics
No merged PRs in 30d

Description

To reproduce in a fresh clone of the repo:
```
make env
make enter
cd proj/proj_template_v
make PLATFORM=sim load
```
Errors seen:
```
/home/tcal/tcal-x/CFU-Playground/env/conda/envs/cfu-common/bin/x86_64-conda_cos6-linux-gnu-cc -c -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/tcal/tcal-x/CFU-Playground/env/conda/envs/cfu-common/include -ggdb -Wall -O0 -DTRACE_FST -o /home/tcal/tcal-x/CFU-Playground/soc/build/sim.proj_template_v/gateware/obj_dir/parse.o /home/tcal/tcal-x/CFU-Playground/third_party/python/litex/litex/build/sim/core/parse.c
/home/tcal/tcal-x/CFU-Playground/third_party/python/litex/litex/build/sim/core/parse.c:6:10: fatal error: json-c/json.h: No such file or directory
#include
^~~~~~~~~~~~~~~
compilation terminated.
```
and
```
/home/tcal/tcal-x/CFU-Playground/env/conda/envs/cfu-common/bin/x86_64-conda_cos6-linux-gnu-cc -c -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/tcal/tcal-x/CFU-Playground/env/conda/envs/cfu-common/include -ggdb -Wall -O0 -DTRACE_FST -Wall -O3 -ggdb -fPIC -Werror -I/home/tcal/tcal-x/CFU-Playground/third_party/python/pythondata-misc-tapcfg/pythondata_misc_tapcfg/data/src/include -I/home/tcal/tcal-x/CFU-Playground/third_party/python/litex/litex/build/sim/core/modules/xgmii_ethernet/../.. -o xgmii_ethernet.o /home/tcal/tcal-x/CFU-Playground/third_party/python/litex/litex/build/sim/core/modules/xgmii_ethernet/xgmii_ethernet.c
/home/tcal/tcal-x/CFU-Playground/third_party/python/litex/litex/build/sim/core/modules/xgmii_ethernet/xgmii_ethernet.c:8:10: fatal error: event2/listener.h: No such file or directory
#include
^~~~~~~~~~~~~~~~~~~
compilation terminated.
```

The x86_64 gcc compiler that comes with Conda / python 3.7 is v7.3.0. Looking at its include/ directories at `env/conda/envs/cfu-common/x86_64-conda_cos6-linux-gnu/include/c++/7.3.0/`, those header files are indeed missing.

How would I go about adding libraries to the GCC that comes from Conda? I can't find a Conda package for either `*json_c*` or `*event2*`.

The local non-Conda build *does* work; for comparison, here's one of the compilation steps:
```
cc -c -Wall -O3 -ggdb -fPIC -Werror -I/home/tcal/tcal-x/CFU-Playground/third_party/python/pythondata-misc-tapcfg/pythondata_misc_tapcfg/data/src/include -I/home/tcal/tcal-x/CFU-Playground/third_party/python/litex/litex/build/sim/core/modules/xgmii_ethernet/../.. -o xgmii_ethernet.o /home/tcal/tcal-x/CFU-Playground/third_party/python/litex/litex/build/sim/core/modules/xgmii_ethernet/xgmii_ethernet.c

% cc --version
cc (Debian 11.2.0-16) 11.2.0
```

@PiotrZierhoffer , any ideas?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.