This branch contains fixes for building LoliProfiler CLI on Linux platforms. The build system has been enhanced to support CLI-only builds without requiring GUI dependencies.
For CentOS/RHEL:
yum install -y qt5-qtbase-devel cmake gcc-c++ make zipFor Ubuntu/Debian:
apt-get install -y qtbase5-dev qt5-qmake cmake g++ make zipSimply run the build script:
./build_linux.shThis script will:
- Configure CMake with CLI-only build option (
-DBUILD_GUI=OFF) - Build the LoliProfilerCLI binary
- Deploy Qt dependencies automatically
- Copy Python analysis scripts
- Create a distribution package:
dist/LoliProfiler-linux-cli.zip
If you prefer to build manually:
# Create build directory
mkdir -p build/cmake
cd build/cmake
# Configure (CLI only)
cmake ../.. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/path/to/qt5 \
-DBUILD_GUI=OFF
# Build
make -j$(nproc) LoliProfilerCLI
# Install
make installAfter building, the distribution package will be in dist/ directory. Extract and run:
cd dist/LoliProfiler
./LoliProfilerCLI.sh --helpThe launcher script (LoliProfilerCLI.sh) automatically sets the correct library paths.
- Added
BUILD_GUIoption (default: ON for backward compatibility) - GUI application build is now conditional based on
BUILD_GUIflag - Linux builds can use
-DBUILD_GUI=OFFto build CLI only
- Complete rewrite based on
build.bat(Windows build script) - Auto-detects Qt5 installation
- Builds CLI-only by default
- Calls deployment script to copy dependencies
- Creates final ZIP distribution package
- New script equivalent to Windows
windeployqt - Automatically detects and copies Qt dependencies
- Creates launcher script with proper
LD_LIBRARY_PATH - Copies Qt plugins (platforms, xcbglintegrations)
Fixed Qt 5.15+ compatibility issues:
- Replaced deprecated
QString::SkipEmptyPartswithQt::SkipEmptyParts - Replaced deprecated
endlwithQt::endl - Added missing
#include <QPointF>in profilecomparator.cpp - Fixed unused parameter warnings in NO_GUI_MODE
LoliProfiler/
├── LoliProfilerCLI # Main CLI binary
├── LoliProfilerCLI.sh # Launcher script (use this to run)
├── qt.conf # Qt configuration
├── lib/ # Qt and other dependencies
├── plugins/ # Qt plugins
├── analyze_heap.py # MCP-based AI analysis script
├── markdown_to_html.py # Markdown to HTML converter
├── requirements.txt # Python dependencies
├── mcp_server/ # MCP heap explorer server
│ ├── __init__.py
│ ├── tree_model.py
│ └── heap_explorer_server.py
└── .mcp.json # MCP server configuration
The changes are designed to:
- ✅ Not affect Windows builds (BUILD_GUI defaults to ON)
- ✅ Not affect macOS builds (BUILD_GUI defaults to ON)
- ✅ Enable Linux CLI-only builds with minimal CMake changes
- ✅ Use platform-specific
#ifdefblocks where needed
./LoliProfilerCLI.sh --app com.example.app --out profile.loli --duration 60./LoliProfilerCLI.sh --compare baseline.loli comparison.loli./LoliProfilerCLI.sh --app com.example.app --attach --out profile.loliIf CMake cannot find Qt5, set the QT5Path environment variable:
export QT5Path=/usr/lib64/qt5 # or your Qt5 installation path
./build_linux.shUse the provided launcher script LoliProfilerCLI.sh instead of running the binary directly.
- GUI modules are NOT built on Linux by default (saves compilation time and dependencies)
- All platform-specific code is wrapped in
#ifdefblocks to ensure cross-platform compatibility - The deployment script mimics Windows
windeployqtbehavior for consistency