MacOS 安装 LuaJIT-2.1.0-beta1

MacOS 安装 LuaJIT-2.1.0-beta1

LuaJIT官网:http://luajit.org/download.html

下载安装:

➜ axel http://luajit.org/download/LuaJIT-2.1.0-beta1.tar.gz
➜ tar -xvf LuaJIT-2.1.0-beta1.tar.gz
➜ cd LuaJIT-2.1.0-beta1
➜ make
➜ sudo make install

如果在make是报下面的错误

ld: warning: -seg1addr not 16384 byte aligned, rounding up
LINK      luajit
Undefined symbols for architecture x86_64:
  "__Unwind_DeleteException", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_GetCFA", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_RaiseException", referenced from:
      _lj_err_throw in libluajit.a(lj_err.o)
  "__Unwind_SetGR", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
  "__Unwind_SetIP", referenced from:
      _lj_err_unwind_dwarf in libluajit.a(lj_err.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [luajit] Error 1
make: *** [default] Error 2

处理方法:设置一下环境变量

➜  export MACOSX_DEPLOYMENT_TARGET=10.14

然后重新make && make install

验证:

安装完之后会有一句提示,提示建立软连接

Note: the development releases deliberately do NOT install a symlink for luajit
You can do this now by running this command (with sudo):

  ln -sf luajit-2.1.0-beta1 /usr/local/bin/luajit

建立好软连接之后就可以在终端验证

➜ luajit -v
LuaJIT 2.1.0-beta1 -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/
posted @ 2021-06-22 15:36  Python-永远滴神  阅读(102)  评论(0编辑  收藏  举报