Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffi.h not found #4

Closed
diamond-lizard opened this issue Sep 28, 2020 · 2 comments
Closed

ffi.h not found #4

diamond-lizard opened this issue Sep 28, 2020 · 2 comments

Comments

@diamond-lizard
Copy link

Since I couldn't get luarocks install --local cffi-lua to work (see Issue 3), I tried:

luarocks unpack cffi-lua
cd cffi-lua/cffi-lua-0.1.1-1/cffi-lua
luarocks make --local cffi-lua-0.1.1-1.rockspec

and then get an error about ffi.h not being found (see full log below), despite me having libffi installed and ffi.h residing in /usr/lib64/libffi-3.2.1/include/ffi.h.

I'm this build on amd64 Gentoo Linux.

Here's the full build log:

%  luarocks make --local cffi-lua-0.1.1-1.rockspec
env \
        LUA="lua" CC="gcc" LD="gcc" \
        CFLAGS='-O2 -fPIC -I/usr/include -I/usr/include' \
        LDFLAGS='-L/usr/lib -lffi' \
        PREFIX="/home/me/.luarocks/lib/luarocks/rocks/cffi-lua/0.1.1-1" LIBDIR="/home/me/.luarocks/lib/luarocks/rocks/cffi-lua/0.1.1-1/lib" \
        ./luarocks/build.sh build

The Meson build system
Version: 0.50.1
Source dir: /home/me/test/lua/cffi-lua/cffi-lua-0.1.1-1/cffi-lua
Build dir: /home/me/test/lua/cffi-lua/cffi-lua-0.1.1-1/cffi-lua/build
Build type: native build
Project name: cffi-lua
Project version: 0.1.1
Appending CXXFLAGS from environment: '-O2 -fPIC -I/usr/include -I/usr/include'
Appending LDFLAGS from environment: '-L/usr/lib -lffi'
Native C++ compiler: g++ (gcc 8.2.0 "g++ (Gentoo 8.2.0-r6 p1.7) 8.2.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Compiler for C++ supports arguments -Wshadow: YES
Compiler for C++ supports arguments -Wold-style-cast: YES
Compiler for C++ supports arguments -fvisibility=hidden: YES
Checking for size of "void *" : 8
Has header "endian.h" : YES
Library dl found: YES
Has header "ffi.h" with dependency not-found: NO
Has header "ffi/ffi.h" with dependency not-found: NO

meson.build:109:8: ERROR: Problem encountered: libffi header file not found

A full log can be found at /home/me/test/lua/cffi-lua/cffi-lua-0.1.1-1/cffi-lua/build/meson-logs/meson-log.txt

Error: Build error: Failed building.
@q66
Copy link
Owner

q66 commented Sep 28, 2020

how exactly is the system supposed to know the location of the libffi headers if they're in a non-standard path? install your libffi properly, so that headers reside in /usr/include, or specify the incdir manually, or don't use luarocks

@diamond-lizard
Copy link
Author

diamond-lizard commented Sep 28, 2020

This is where portage, the Gentoo package manager installed the headers.

So it looks like there is an incompatibility between the luarocks cffi-package and Gentoo.

Per your recommendation, I will try installing cffi-lua from outside of luarocks.

Thank you for your help.

@q66 q66 closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants