Manual Compilation MaiMBot-LPMM
TIP
If you can directly install quick_algo library, then please skip this step, directly use compiled package.
Get MaiMBot-LPMM
git clone https://github.com/MaiM-with-u/MaiMBot-LPMM.gitWindows(x86_64)
Environment Preparation
- First, download Microsoft MSVC build tools installation package at C++ Build Tools
- Open installation package, will automatically install Visual Studio Installer. After installation is complete, open Visual Studio Installer
- Select above "Individual components" tab, search and select following components:
- MSVC v143 - VS 2022 C++ x64/x86 build tools
- Windows 10/11 SDK (according to your computer environment selection)
- Cmake tools for Windows
- Click "Install" button, start installing these components
- Download MinGW that matches your computer environment at MinGW-w64 releases (note the name, need msvc version)
- Extract to any directory, add extracted directory to environment variables
MSVC Compilation
First install dependencies in root directory requirements.txt
pip install -i https://mirrors.aliyun.com/pypi/simple -r requirements.txt --upgradeThen enter lib/quick_algo/ directory, use administrator permissions to run python build_lib.py --cleanup --cythonize --install
cd lib/quick_algo
sudo python build_lib.py --cleanup --cythonize --installTIP
Before running please ensure enabled Sudo on windows. If not, use administrator to open terminal
Windows(Arm)
No data
Linux
Environment Preparation
- First install gcc/g++ compiler
Debian-based systems (like Ubuntu, Linux Mint, etc.)
# Update software package index
sudo apt update
# Run following command to install `gcc` and `g++`:
sudo apt install build-essentialRed Hat-based systems (like Fedora, CentOS, RHEL, etc.)
# Update software package index
sudo dnf check-update
# Install `gcc` and `g++`
sudo dnf install gcc gcc-c++
# If using `yum`, replace `dnf` with `yum`- Verify installation
After installation is complete, can verify if gcc and g++ are installed successfully through following commands:
gcc --version
g++ --version
# If installation is successful, will display `gcc` and `g++` version information.GCC Compilation
- Install dependencies
Enter LPMM root directory, install corresponding dependencies
pip install -i https://mirrors.aliyun.com/pypi/simple -r requirements.txt --upgrade- Compilation Enter
lib/quick_algo/directory, run commandpython build_lib.py --cleanup --cythonize --install
cd lib/quick_algo
python build_lib.py --cleanup --cythonize --installMacOS
Environment Preparation
- First install Clang compilation environment
Homebrew-based recommended method:
# Install Homebrew (if not yet installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install clang
brew install llvmOr directly use Xcode command line tools:
xcode-select --install- After installation is complete, can verify if clang is installed successfully through following command:
clang --versionClang Compilation
- Install dependencies Enter LPMM root directory, install corresponding dependencies
pip install -i https://mirrors.aliyun.com/pypi/simple -r requirements.txt --upgrade- Enter
lib/quick_algo/directory, run commandpython build_lib.py --cleanup --cythonize --install
cd lib/quick_algo
python build_lib.py --cleanup --cythonize --install