| name | taosgen-build |
| description | Assist users with building, compiling, and installing taosgen from source code. Use this skill when users need help with cmake configuration, conan dependency management, compilation errors, platform-specific build issues, or setting up the development environment for taosgen. Trigger for phrases like "build taosgen", "compile taosgen", "cmake error", "conan install failed", "how to install taosgen", "build from source", or when users encounter build-related issues on Linux, macOS, or Windows. |
taosgen Build Assistant
Help users build, compile, and install taosgen from source code.
Overview
taosgen is a C++17 project that uses:
- CMake (≥3.19) for build configuration
- Conan (≥2.19) for dependency management
- CTest for testing
Supported platforms:
- Linux (x64, ARM64)
- macOS (x64, ARM64)
Prerequisites
Before building taosgen, ensure the following are installed:
Required Tools
| Tool | Minimum Version | Installation |
|---|
| CMake | 3.19+ | cmake.org |
| Conan | 2.19+ | conan.io |
| C++ Compiler | C++17 support | gcc/g++ or clang |
Platform-Specific Requirements
Linux (Ubuntu/Debian):
sudo apt-get update
sudo apt-get install -y cmake build-essential python3 python3-pip
pip3 install conan>=2.19
macOS:
xcode-select --install
brew install cmake conan
Standard Build Process
Quick Build (Linux/macOS)
git clone https://github.com/taosdata/taosgen.git
cd taosgen
mkdir build && cd build
conan install .. --build=missing --output-folder=./conan --settings=build_type=Release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
ctest
macOS Special Case
If the compiler doesn't automatically select the SDK:
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_SYSROOT=$(xcrun --show-sdk-path) \
-DCMAKE_TOOLCHAIN_FILE=./conan/conan_toolchain.cmake
Build Options
Build Types
| Type | Use Case | Command |
|---|
| Release | Production builds | -DCMAKE_BUILD_TYPE=Release |
| Debug | Development/debugging | -DCMAKE_BUILD_TYPE=Debug |
Conan Profile Configuration
Conan profiles determine how dependencies are built:
conan profile detect --force
conan profile show
conan profile list
Common CMake Options
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON
Troubleshooting
Issue: "Conan command not found"
Solution:
pip3 install --user "conan>=2.19"
export PATH="$HOME/.local/bin:$PATH"
Issue: "CMake version too old"
Solution:
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update
sudo apt-get install cmake
brew install cmake
Issue: "C++17 standard not supported"
Solution:
Check compiler version and upgrade if necessary:
gcc --version
clang --version
sudo apt-get install gcc-10 g++-10
export CC=gcc-10 CXX=g++-10
Issue: "Conan dependency resolution fails"
Solution:
conan remove "*" -c
conan install .. --build=missing --output-folder=./conan
conan install .. --build="*" --output-folder=./conan
Issue: "macOS SDK not found"
Solution:
xcode-select --install
sudo xcode-select --reset
cmake .. -DCMAKE_OSX_SYSROOT=$(xcrun --show-sdk-path)
Testing
Run All Tests
cd build
ctest
Run with Verbose Output
ctest -V
Run Specific Test
ctest -R <test_name>
Parallel Testing
ctest -j$(nproc)
ctest -j$(sysctl -n hw.ncpu)
Installation
After successful build:
cd build
sudo cmake --install .
Or specify custom prefix:
cmake --install . --prefix /path/to/install
IDE Integration
VSCode
Install extensions:
- C/C++ Extension Pack
- CMake Tools
Configure CMake Tools to use the conan toolchain:
{
"cmake.configureArgs": [
"-DCMAKE_TOOLCHAIN_FILE=${workspaceFolder}/build/conan/conan_toolchain.cmake"
]
}
CLion
- Open project root directory
- CMake should auto-detect the build configuration
- If not, manually specify:
- Build directory:
build
- CMake options:
-DCMAKE_TOOLCHAIN_FILE=./conan/conan_toolchain.cmake
Workflow for Build Issues
When user reports a build issue:
- Identify platform: Linux/macOS? Architecture?
- Check prerequisites: CMake version? Conan version? Compiler?
- Review error message: Is it conan, cmake, or compile-time?
- Suggest solutions: Use the troubleshooting guide above
- Verify fix: Ask user to try the recommended solution
Example User Interactions
"How do I build taosgen?"
- Provide the Quick Build steps for their platform
"Conan install failed with missing packages"
- Suggest
conan install .. --build="*" to build from source
"I'm on macOS and cmake can't find the SDK"
- Provide macOS-specific SDK path solution
"Build succeeded but tests fail"
- Check if TDengine is running (required for integration tests)
- Suggest using
TSGEN_ENABLE_TEST=OFF if just testing the build
References