OpenFPGA icon indicating copy to clipboard operation
OpenFPGA copied to clipboard

CMake missing libffi-dev in Ubuntu 20.04

Open lukefahr opened this issue 5 years ago • 1 comments

Problem

frontends/ast/dpicall.cc:25:10: fatal error: ffi.h: No such file or directory
   25 | #include <ffi.h>
      |          ^~~~~~~
compilation terminated.

Steps

git clone https://github.com/LNIS-Projects/OpenFPGA.git
cd OpenFPGA
mkdir build; cd build
cmake .. 
make  

Solution

I think your Cmake is missing a required package, at least for newer version of Ubuntu. I solved the issue with:

sudo apt-get install libffi-dev

Envionment

$ lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal

lukefahr avatar Oct 02 '20 13:10 lukefahr

Hi, Thanks for trying OpenFPGA. I believe this is a valid bug. The 'lib-ffi' package is required by yosys but the current CMake script for yosys is simply a wrapper for yosys makefile. I will improve the CMake script in a pull request.

tangxifan avatar Oct 02 '20 16:10 tangxifan

Addressed in the current master already.

https://github.com/lnis-uofu/OpenFPGA/blob/85532dd12918d97179ddc732c8e15902523a5bcd/.github/workflows/install_dependencies_build.sh#L19

Close this issue.

tangxifan avatar Sep 06 '22 16:09 tangxifan