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

Issue building Yuescript module against LuaJIT #169

Open
Shados opened this issue Jun 9, 2024 · 2 comments
Open

Issue building Yuescript module against LuaJIT #169

Shados opened this issue Jun 9, 2024 · 2 comments

Comments

@Shados
Copy link

Shados commented Jun 9, 2024

I've been working on a Nix package for Yuescript's Lua module. What I have works fine when built against PUC-Rio Lua 5.1 or above, but fails when I attempt to build against LuaJIT:

yuescript 0.23.8-1 depends on lua >= 5.1 (5.1-1 provided by VM: success)
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/9bv7dcvmfcjnmg5mnqwqlq2wxfn8d7yi-gcc-wrapper-13.2.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Lua (missing: LUA_LIBRARIES) (found version "5.1.4")
-- Lua: /nix/store/iq8s1f6d5wjwy4k7dm24qa4jpa3iby54-luajit-2.1.1693350652/bin/luajit
-- Lua include: /nix/store/iq8s1f6d5wjwy4k7dm24qa4jpa3iby54-luajit-2.1.1693350652/include/luajit-2.1
-- Lua library: LUA_LIBRARIES-NOTFOUND
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done (0.4s)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LUA_LIBRARIES
    linked by target "yue" in directory /build/source
    linked by target "libyue" in directory /build/source
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:
    CMAKE_INCLUDE_PATH
CMake Generate step failed.  Build files cannot be regenerated correctly.
Error: Build error: Failed cmake.

Based on CMakeLists.txt it looks like it should be looking for the library directory in ${LUA_INCDIR}/../lib ${LUA_INCDIR}/../../lib, and the latter exists and has the library file:

$ tree /nix/store/iq8s1f6d5wjwy4k7dm24qa4jpa3iby54-luajit-2.1.1693350652/include/luajit-2.1/../../lib
/nix/store/iq8s1f6d5wjwy4k7dm24qa4jpa3iby54-luajit-2.1.1693350652/include/luajit-2.1/../../lib
├── libluajit-5.1.a
├── libluajit-5.1.so -> libluajit-5.1.so.2.1.1693350652
├── libluajit-5.1.so.2 -> libluajit-5.1.so.2.1.1693350652
├── libluajit-5.1.so.2.1.1693350652
├── lua
│   └── 5.1
└── pkgconfig
    └── luajit.pc

4 directories, 5 files
@pigpigyyy
Copy link
Owner

Currently, in the CMakeLists.txt file, only the library file named libluajit.a or libluajit.so will be matched and stored in the variable LUA_LIBRARIES for build linking. You can try renaming or creating a symbolic link from libluajit-5.1.a to libluajit.a.

@Shados
Copy link
Author

Shados commented Jun 11, 2024

You can try renaming or creating a symbolic link from libluajit-5.1.a to libluajit.a.

Hmmm. It looks like LuaJIT started including the ABI version in the .so name 10 months ago when it officially swapped to being rolling-release. I guess you'll need to update your cmake setup for that going forward...?

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