1 # An algorithm library {#mainpage}
3 [![docs](https://github.com/tqfx/liba/actions/workflows/docs.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/docs.yml)
4 [![conan](https://github.com/tqfx/liba/actions/workflows/conan.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/conan.yml)
5 [![xmake](https://github.com/tqfx/liba/actions/workflows/xmake.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/xmake.yml)
6 [![meson](https://github.com/tqfx/liba/actions/workflows/meson.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/meson.yml)
7 [![wasm](https://github.com/tqfx/liba/actions/workflows/wasm.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/wasm.yml)
8 [![msvc](https://github.com/tqfx/liba/actions/workflows/msvc.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/msvc.yml)
9 [![linux](https://github.com/tqfx/liba/actions/workflows/linux.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/linux.yml)
10 [![macos](https://github.com/tqfx/liba/actions/workflows/macos.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/macos.yml)
11 [![mingw](https://github.com/tqfx/liba/actions/workflows/mingw.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/mingw.yml)
12 [![msys2](https://github.com/tqfx/liba/actions/workflows/msys2.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/msys2.yml)
13 [![freebsd](https://github.com/tqfx/liba/actions/workflows/freebsd.yml/badge.svg)](https://github.com/tqfx/liba/actions/workflows/freebsd.yml)
17 - [C/C++](https://tqfx.org/liba/)
18 - [Lua](https://tqfx.org/liba/lua/)
19 - [Java](https://tqfx.org/liba/java/)
20 - [Rust](https://tqfx.org/liba/rust/liba/)
24 - C/C++ compiler: [tcc](https://bellard.org/tcc) or [gnu](https://gcc.gnu.org) or [llvm](https://clang.llvm.org) or [msvc](https://visualstudio.microsoft.com/visual-cpp-build-tools) etc
28 - [lua](https://www.lua.org)
29 - [java](https://www.oracle.com/java)
30 - [rust](https://www.rust-lang.org)
31 - [emsdk](https://emscripten.org)
32 - [xmake](https://xmake.io)
33 - [cmake](https://cmake.org)
34 - [conan](https://conan.io)
35 - [vcpkg](https://vcpkg.io)
36 - [meson](https://mesonbuild.com)
37 - [python](https://www.python.org)
38 - [quickjs](https://github.com/bellard/quickjs)
62 meson install -C build
68 cmake -S . -B build -DLIBA_VCPKG=1
72 cp -r build/vcpkg/* $VCPKG_INSTALLATION_ROOT
76 cp -r -Force build/vcpkg/* $ENV:VCPKG_INSTALLATION_ROOT
94 python setup.py build_ext --inplace
104 add_requires("alib") -- static
105 add_requires("liba") -- shared
111 find_package(liba CONFIG REQUIRED)
112 target_link_libraries(<TARGET> PRIVATE alib) # static
113 target_link_libraries(<TARGET> PRIVATE liba) # shared
126 luarocks install liba # release
130 luarocks install liba --dev # latest
136 local liba = require("liba")
137 print("version", liba.VERSION)
146 public static void main(String[] args) {
147 System.out.println("version " + liba.VERSION);
157 cargo add liba # release
161 cargo add --git https://github.com/tqfx/liba.git # latest
170 "version {}.{}.{}+{}",
171 liba::version::major(),
172 liba::version::minor(),
173 liba::version::patch(),
174 liba::version::tweak()
183 pip install liba # release
187 pip install git+https://github.com/tqfx/liba.git # latest
194 print("version", liba.VERSION)
206 import liba from "@tqfx/liba";
207 console.log("version", liba.VERSION);
215 import * as liba from "liba.so";
216 console.log("version", liba.VERSION);
219 ## Copyright {#copyright}
221 Copyright (C) 2020-present tqfx, All rights reserved.
223 This Source Code Form is subject to the terms of the Mozilla Public
224 License, v. 2.0. If a copy of the MPL was not distributed with this
225 file, You can obtain one at <https://mozilla.org/MPL/2.0/>.