Skip to content

Commit

Permalink
AER-6669 - upgrade Lua to Lua 5.4.
Browse files Browse the repository at this point in the history
* Updates in mod-lua submodule for lua 5.4
* New submodule: lua
* Removed submodule: luajit
  • Loading branch information
kportertx authored Sep 15, 2023
1 parent ee8c5d4 commit 046eb24
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 92 deletions.
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
[submodule "modules/mod-lua"]
path = modules/mod-lua
url = https://github.com/aerospike/aerospike-mod-lua.git
ignore = dirty
[submodule "modules/jansson"]
path = modules/jansson
url = https://github.com/aerospike/jansson.git
ignore = dirty
[submodule "modules/luajit"]
path = modules/luajit
url = https://github.com/aerospike/luajit.git
[submodule "modules/telemetry"]
path = modules/telemetry
url = https://github.com/aerospike/aerospike-telemetry-agent.git
ignore = dirty
[submodule "modules/jemalloc"]
path = modules/jemalloc
url = https://github.com/aerospike/jemalloc.git
Expand All @@ -31,3 +30,7 @@
path = modules/libbacktrace
url = https://github.com/aerospike/libbacktrace.git
ignore = dirty
[submodule "modules/lua"]
path = modules/lua
url = https://github.com/aerospike/lua.git
ignore = dirty
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,16 @@ lib: aslibs
$(MAKE) -C as $@ STATIC_LIB=1 OS=$(OS)

.PHONY: aslibs
aslibs: targetdirs version $(JANSSON)/Makefile $(JEMALLOC)/Makefile $(LIBBACKTRACE)/Makefile $(LUAJIT)/src/luaconf.h s2lib
aslibs: targetdirs version $(JANSSON)/Makefile $(JEMALLOC)/Makefile $(LIBBACKTRACE)/Makefile s2lib
$(MAKE) -C $(JANSSON)
$(MAKE) -C $(JEMALLOC)
$(MAKE) -C $(LIBBACKTRACE)
ifeq ($(USE_LUAJIT),1)
$(MAKE) -C $(LUAJIT) Q= TARGET_SONAME=libluajit.so CCDEBUG=-g
endif
ifeq ($(ARCH), aarch64)
$(MAKE) -C $(TSO)
endif
$(MAKE) -C $(COMMON) CF=$(CF) EXT_CFLAGS="$(EXT_CFLAGS)" OS=$(UNAME)
$(MAKE) -C $(CF)
$(MAKE) -C $(MOD_LUA) CF=$(CF) COMMON=$(COMMON) EXT_CFLAGS="$(EXT_CFLAGS)" USE_LUAJIT=$(USE_LUAJIT) LUAJIT=$(LUAJIT) TARGET_SERVER=1 OS=$(UNAME)
$(MAKE) -C $(MOD_LUA) CF=$(CF) COMMON=$(COMMON) LUAMOD=$(LUAMOD) EXT_CFLAGS="$(EXT_CFLAGS)" TARGET_SERVER=1 OS=$(UNAME)

S2_FLAGS = -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=RelWithDebInfo

Expand Down Expand Up @@ -106,10 +103,7 @@ cleanmodules:
$(MAKE) -C $(LIBBACKTRACE) clean; \
$(MAKE) -C $(LIBBACKTRACE) distclean; \
fi
if [ -e "$(LUAJIT)/Makefile" ]; then \
$(MAKE) -C $(LUAJIT) clean; \
fi
$(MAKE) -C $(MOD_LUA) COMMON=$(COMMON) USE_LUAJIT=$(USE_LUAJIT) LUAJIT=$(LUAJIT) clean
$(MAKE) -C $(MOD_LUA) COMMON=$(COMMON) LUAMOD=$(LUAMOD) clean
$(RM) -rf $(ABSL)/build $(ABSL)/installation # ABSL default clean leaves files in build directory
$(RM) -rf $(S2)/build # S2 default clean leaves files in build directory

Expand All @@ -132,7 +126,6 @@ cleangit:
cd $(JANSSON); $(GIT_CLEAN)
cd $(JEMALLOC); $(GIT_CLEAN)
cd $(LIBBACKTRACE); $(GIT_CLEAN)
cd $(LUAJIT); $(GIT_CLEAN)
cd $(MOD_LUA); $(GIT_CLEAN)
cd $(S2); $(GIT_CLEAN)
$(GIT_CLEAN)
Expand Down
45 changes: 12 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ information. The full Telemetry data collection agent source code may be found
## Build Prerequisites

The Aerospike Database Server can be built and deployed on various
current 64-bit GNU/Linux platform versions, such as Centos 7, Red Hat Enterprise Linux 8/9, Amazon Linux 2023,
Debian 10 or later, and Ubuntu 20.04 or later.
current 64-bit GNU/Linux platform versions, such as Red Hat Enterprise Linux 8/9, Amazon Linux 2023,
Debian 11 or later, and Ubuntu 20.04 or later.

### Dependencies

Expand Down Expand Up @@ -54,43 +54,24 @@ the build environment, including:
The C++ compiler is required for the Aerospike geospatial indexing
feature and its dependency, Google's S2 Geometry Library (both written in C++.)

* The required CentOS 7 & Red Hat Enterprise Linux 8/9 package to install is: `gcc-c++`.
* The required Red Hat Enterprise Linux 8/9 package to install is: `gcc-c++`.

* The required Debian 10/11/12 and Ubuntu 20/22 package to install is: `g++`.
* The required Debian 11/12 and Ubuntu 20/22 package to install is: `g++`.

#### OpenSSL

OpenSSL 0.9.8b or later is required for cryptographic hash functions
(RIPEMD-160 & SHA-1) and pseudo-random number generation.

* The CentOS 7 & Red Hat Enterprise Linux 8/9 OpenSSL package to install: `openssl-devel`
* The Red Hat Enterprise Linux 8/9 OpenSSL package to install: `openssl-devel`

* The Debian 10/11/12 and Ubuntu 20/22 OpenSSL packages to install: `libssl-dev`.

#### Lua 5.1

The [Lua](http://www.lua.org) 5.1 language is required for User Defined
Function (UDF) support.

* By default, Aerospike builds with Lua 5.1 support provided by the
[LuaJIT](http://luajit.org) submodule.

* Alternatively, it is possible to build with standard Lua 5.1 provided
by the build environment. In that case:

* The CentOS 7 & Red Hat Enterprise Linux 8/9 Lua package to install is: `lua`, and also
`lua-devel` and `lua-static` on CentOS 7.

* The Debian 10/11/12 and Ubuntu 20/22 Lua packages to install are:
`lua5.1` and `liblua5.1-dev`.

* Build by passing the `USE_LUAJIT=0` option to `make`.
* The Debian 11/12 and Ubuntu 20/22 OpenSSL packages to install: `libssl-dev`.

#### Zlib

* The CentOS 7 & Red Hat Enterprise Linux 8/9 requires `zlib-devel`
* The Red Hat Enterprise Linux 8/9 requires `zlib-devel`

* The Debian 10/11/12 and Ubuntu 20/22 requiresi `zlib1g-dev`.
* The Debian 11/12 and Ubuntu 20/22 requiresi `zlib1g-dev`.

#### Python 3 or 2

Expand All @@ -111,8 +92,7 @@ The Aerospike Database Server build depends upon 8 submodules:
| common | The Aerospike Common Library |
| jansson | C library for encoding, decoding and manipulating JSON data |
| jemalloc | The JEMalloc Memory Allocator |
| lua-core | The Aerospike Core Lua Source Files |
| luajit | The LuaJIT (Just-In-Time Compiler for Lua) |
| lua | The Lua runtime |
| mod-lua | The Aerospike Lua Interface |
| s2geometry | The S2 Spherical Geometry Library |
| telemetry | The Aerospike Telemetry Agent (Community Edition only) |
Expand Down Expand Up @@ -193,12 +173,11 @@ deployment or software development.
The preferred method for running Aerospike in a production environment
is to build and install the Aerospike package appropriate for the target
Linux distribution (i.e., an `".rpm"`, `".deb"`, or `".tgz"` file), and
then to control the state of the Aerospike daemon, either via the SysV
daemon init script commands, e.g., `service aerospike start`, or else
via `systemctl` on `systemd`-based systems, e.g., `systemctl start aerospike`.
then to control the state of the Aerospike daemon via `systemctl` on
e.g., `systemctl start aerospike`.

Please refer to the full documentation on the Aerospike web site,
[`http://aerospike.com/docs/`](http://aerospike.com/docs/), for more
[`https://docs.aerospike.com/`](https://docs.aerospike.com/), for more
detailed information about configuring and running the Aerospike
Database Server, as well as about the Aerospike client API packages
for popular programming languages.
33 changes: 1 addition & 32 deletions as/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,6 @@ INCLUDES += -I$(JANSSON)/src
INCLUDES += -I$(MOD_LUA)/target/$(PLATFORM)/include
INCLUDES += -I$(S2)/src

ifeq ($(USE_LUAJIT),1)
INCLUDES += -I$(LUAJIT)/src
else
INCLUDE_LUA_5_1 = /usr/include/lua5.1
ifneq ($(wildcard $(INCLUDE_LUA_5_1)),)
INCLUDES += -I$(INCLUDE_LUA_5_1)
LUA_SUFFIX = 5.1
endif
endif

AS_LIBRARIES += $(LIBRARY_DIR)/libcf.a
AS_LIBRARIES += $(COMMON)/target/$(PLATFORM)/lib/libaerospike-common.a
AS_LIBRARIES += $(JEMALLOC)/lib/libjemalloc.a
Expand All @@ -258,28 +248,7 @@ ifeq ($(DOPROFILE),1)
LIBRARIES += -pg -fprofile-arcs -lgcov
endif

# Add either the LuaJIT or Lua library
ifeq ($(USE_LUAJIT),1)
ifeq ($(LD_LUAJIT),static)
AS_LIBRARIES += $(LUAJIT)/src/libluajit.a
else
LIBRARIES += -L$(LUAJIT)/src -lluajit
endif
else
ifeq ($(LD_LUA),static)
# Find and add the static Lua library.
AS_LIBRARIES += $(or \
$(wildcard /usr/local/lib/liblua.a), \
$(wildcard /usr/lib64/liblua$(LUA_SUFFIX).a), \
$(wildcard /usr/lib/x86_64-linux-gnu/liblua$(LUA_SUFFIX).a), \
$(wildcard /usr/lib/liblua.a), \
$(wildcard /usr/lib/powerpc64le-linux-gnu/liblua.a), \
$(wildcard /usr/lib/aarch64-linux-gnu/liblua5.1.a), \
$(error Cannot find "liblua.a"))
else
LIBRARIES += -llua$(LUA_SUFFIX)
endif
endif
AS_LIBRARIES += $(LUAMOD)/liblua.a

ifeq ($(LD_JANSSON),static)
AS_LIBRARIES += $(JANSSON)/src/.libs/libjansson.a
Expand Down
15 changes: 3 additions & 12 deletions make_in/Makefile.vars
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# prompt% make USE_JEM=0
#
# To link with the static or dynamic version of a library, add "LD_<LIBRARY>=(static|dynamic)",
# where <LIBRARY> is "CRYPTO", "LUA", "LUAJIT", "JANSSON" or "JEM", to the "make" command line.
# where <LIBRARY> is "CRYPTO", "JANSSON" or "JEM", to the "make" command line.
# E.g., to build with JEMalloc dynamically linked, use:
#
# prompt% make LD_JEM=dynamic
Expand All @@ -32,18 +32,9 @@ ARCH = $(shell uname -m)
# Get CC version
CC_VERSION = $(shell $(CC) -dumpfullversion -dumpversion)

# Use LuaJIT instead of Lua? [By default, yes.]
USE_LUAJIT ?= 1

# Default mode used for linking the Jansson JSON API Library:
LD_JANSSON = static

# Default mode used for linking the LuaJIT library:
LD_LUAJIT = static

# Default mode used for linking the Lua library:
LD_LUA = static

# Options to pass to Jansson's "configure" script.
JANSSON_CONFIG_OPT =

Expand Down Expand Up @@ -83,7 +74,7 @@ COMMON_PATH := $(realpath $(DEPTH)/modules/common)
JANSSON_PATH := $(realpath $(DEPTH)/modules/jansson)
JEMALLOC_PATH := $(realpath $(DEPTH)/modules/jemalloc)
LIBBACKTRACE_PATH := $(realpath $(DEPTH)/modules/libbacktrace)
LUAJIT_PATH := $(realpath $(DEPTH)/modules/luajit)
LUA_PATH := $(realpath $(DEPTH)/modules/lua)
MOD_LUA_PATH := $(realpath $(DEPTH)/modules/mod-lua)
S2_PATH := $(realpath $(DEPTH)/modules/s2geometry)
TSO_PATH := $(realpath $(DEPTH)/tso)
Expand All @@ -96,7 +87,7 @@ COMMON = $(COMMON_PATH)
JANSSON = $(JANSSON_PATH)
JEMALLOC = $(JEMALLOC_PATH)
LIBBACKTRACE = $(LIBBACKTRACE_PATH)
LUAJIT = $(LUAJIT_PATH)
LUAMOD = $(LUA_PATH)
MOD_LUA = $(MOD_LUA_PATH)
S2 = $(S2_PATH)
TSO = $(TSO_PATH)
Expand Down
1 change: 1 addition & 0 deletions modules/lua
Submodule lua added at 644318
1 change: 0 additions & 1 deletion modules/luajit
Submodule luajit deleted from 0e8c66

0 comments on commit 046eb24

Please sign in to comment.