中文简体 | English
Camel is an AI programming language built with a modern C++ technology stack. Its frontend is implemented using Antlr4 (requires a Java runtime) and integrates Python and Node.js toolchains for cross-platform development. This guide is designed to help developers quickly set up the development environment for the Camel project.
The following table lists the required components and their version specifications for the Camel project:
Component | Minimum Version | Recommended Version | Verification Command |
---|---|---|---|
Python | 3.9 | 3.11 | python --version |
Node.js | 18 | 20 LTS | node -v |
Java | 11 | 21 | java -version |
Clang | 19 | 20 | clang --version |
CMake | 3.20 | 3.28 | cmake --version |
Conan | 2.10 | 2.12 | conan --version |
Ninja | 1.11 | 1.11 | ninja --version |
Ensure that the above components are properly installed and configured before proceeding with development.
The following steps outline the setup process for the development environment, covering Windows, macOS, and Linux platforms.
- Visit the Python official website to download and install the version suitable for your operating system.
- During installation, check the Add Python to PATH option.
- Open a terminal and run the following command to verify the installation:
python --version
- Visit the Node.js official website to download the latest or LTS version.
- After installation, verify it in the terminal:
node --version npm --version
- Download and install Java from the Oracle official website or AdoptOpenJDK.
- Configure the
JAVA_HOME
andPATH
environment variables. - Open a terminal and confirm the installation:
java -version
- Installation Methods:
- Windows: Download from the LLVM official download page or GitHub Releases.
- macOS: Install via Xcode command line tools:
Or use Homebrew:
xcode-select --install
brew install llvm
- Linux: Install via package manager, e.g.:
For newer versions, refer to the LLVM official documentation to add the official repository and install.
# Ubuntu/Debian: sudo apt update && sudo apt install clang
- Verify Installation:
clang --version
-
Installation Methods:
- Download the installer or archive from the CMake official download page.
- Alternatively, use a package manager:
# macOS: brew install cmake # Ubuntu/Debian: sudo apt install cmake
-
Verify Installation:
cmake --version
-
Installation:
- Ensure Python is installed, then use pip to install Conan:
pip install conan
- Ensure Python is installed, then use pip to install Conan:
-
Verify Installation:
conan --version
-
Installation Methods:
- Download the executable from the Ninja official GitHub.
- Or install via a package manager:
# macOS: brew install ninja # Ubuntu/Debian: sudo apt install ninja-build
- Alternatively, install via pip:
pip install ninja
-
Verify Installation:
ninja --version
conan profile detect --force
Edit the ~/.conan2/profiles/default
file with the following configuration:
[settings]
os=Windows
arch=x86_64
compiler=clang
compiler.version=19
compiler.cppstd=23
build_type=Release
[conf]
tools.build:jobs=20
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config
Run the following commands to install project dependencies:
-
Initialize dependencies (only needed once):
npm run init
-
Update Conan dependencies:
npm run install
-
If Antlr4 grammar definitions are updated, regenerate the parser:
npm run psrgen
-
Build the Release version:
npm run build
-
Build the Debug version (for breakpoint debugging):
npm run debug
-
Clean build artifacts:
npm run clean
Create a .vscode/settings.json
file:
{
"files.associations": {
".opencmlrc": "json"
},
"editor.tabSize": 4
}
Create a .vscode/launch.json
file:
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Debug (Windows)",
"cwd": "${workspaceFolder}",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Debug/camel.exe",
"symbolSearchPath": "${workspaceFolder}/build/Debug",
"args": ["inspect", "--cst", "D:\\Projects\\Camel\\test\\format\\format.cml"],
"console": "externalTerminal",
"logging": {
"moduleLoad": false,
"trace": true
},
}
]
}
Create a .vscode/c_cpp_properties.json
file:
{
"configurations": [
{
"includePath": [
"${workspaceFolder}/src",
"${workspaceFolder}/vendor",
"${workspaceFolder}/third_party"
],
"cppStandard": "c++23"
}
]
}