中文简体 | 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_HOMEandPATHenvironment 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 --forceEdit 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-ConfigRun the following commands to install the required dependencies:
-
Install project dependencies (automatically installs and initializes the project):
npm install
-
Manually initialize the project (if needed):
npm run init
-
If the Antlr4 grammar definitions have changed, regenerate the parser:
npm run psrgen
-
For VSCode users, it is recommended to run the following command to fix Intellisense errors:
npm run fix:vsc
- libcamel: Camel core shared library
- tools/: Standalone tools linking libcamel
camel-cli: Main entry, producescamelexecutablecamel-cpp: Transpile.cmlto C++ and auto-compile, outputs totmp/format: Code formattercamel-formatcodegen: Code generation from ASTcamel-codegenprofiler: Profiling toolcamel-profiler
Build outputs are under build/tools/<tool>/<Config>/. The camel executable is copied to the project root.
-
Build the Release version (
conan installruns automatically whenbuild/is missing):npm run build
-
Build the Debug version (for breakpoint debugging):
npm run debug
-
Build RelWithDebInfo version (for profiling):
npm run profile
-
Clean build artifacts:
npm run clean
-
CMake options (FastVM JIT, computed goto, Python embedding modules) and the
CAMEL_SKIP_PYTHONenvironment variable: see Build options.