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

question: how to compile lua-rapidjson with specified Lua/Luajit version. #39

Closed
membphis opened this issue Jul 5, 2019 · 10 comments
Closed

Comments

@membphis
Copy link
Contributor

membphis commented Jul 5, 2019

I want to compile the lua-rapidjson with specified Luajit, for example:

$ ls /usr/local/openresty/luajit/include/luajit-2.1
lauxlib.h lua.h     lua.hpp   luaconf.h luajit.h  lualib.h

$ ls /usr/local/openresty/luajit/lib
libluajit-5.1.2.1.0.dylib libluajit-5.1.2.dylib     libluajit-5.1.a           libluajit-5.1.dylib       lua                       pkgconfig

How can I implement this? One more thing, I'm working on MAC OSX.

@membphis
Copy link
Contributor Author

membphis commented Jul 6, 2019

I created an related issue to luarocks right now:

#39

@xpol
Copy link
Owner

xpol commented Jul 6, 2019

I have update docs here

Hav it a try~

@membphis
Copy link
Contributor Author

membphis commented Jul 6, 2019

It seems that the option LUA_DIR did not take effect.

$ cmake -H. -Bbuild -G 'Unix Makefiles' -DLUA_DIR=/usr/local/openresty/luajit
-- The C compiler identification is AppleClang 11.0.0.11000020
-- The CXX compiler identification is AppleClang 11.0.0.11000020
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/local/bin/git (found version "2.17.0")
-- LUA_RAPIDJSON_VERSION: v0.5.1-22-g7c4c6f4-dirty
-- Found Lua: /usr/local/lib/liblua5.1.dylib (found version "5.1.5")
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    LUA_DIR

$ fgrep -r "include" ./build/*.txt
./build/CMakeCache.txt:LUA_INCLUDE_DIR:PATH=/usr/local/include/lua5.1
./build/CMakeCache.txt:FIND_PACKAGE_MESSAGE_DETAILS_Lua:INTERNAL=[/usr/local/lib/liblua5.1.dylib][/usr/local/include/lua5.1][v5.1.5()]

@xpol
Copy link
Owner

xpol commented Jul 6, 2019 via email

@membphis
Copy link
Contributor Author

membphis commented Jul 6, 2019

failed again , here is the log:

$ cmake ../ -DLUA_DIR=/usr/local/openresty/luajit
-- The C compiler identification is AppleClang 11.0.0.11000020
-- The CXX compiler identification is AppleClang 11.0.0.11000020
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/local/bin/git (found version "2.17.0")
-- LUA_RAPIDJSON_VERSION: v0.5.1-22-g7c4c6f4-dirty
-- Found Lua: /usr/local/lib/liblua5.1.dylib (found version "5.1.5")
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    LUA_DIR


-- Build files have been written to: /Users/rain/Downloads/lua-rapidjson/build

@xpol
Copy link
Owner

xpol commented Jul 7, 2019

I mean LUA_DIR=/usr/local/openresty/luajit cmake -H. -Bbuild -G 'Unix Makefiles'

@membphis
Copy link
Contributor Author

membphis commented Jul 7, 2019

it works fine for me: luarocks install --lua-dir=/usr/local/openresty/luajit rapidjson

and it works fine too: LUA_DIR=/usr/local/openresty/luajit cmake -H. -Bbuild -G 'Unix Makefiles'

thx for your help. @xpol

@membphis membphis closed this as completed Jul 7, 2019
@membphis
Copy link
Contributor Author

membphis commented Jul 7, 2019

we should update the readme doc.

@xpol
Copy link
Owner

xpol commented Jul 8, 2019

@membphis
Copy link
Contributor Author

membphis commented Jul 8, 2019

many thx for your great job.

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