Files
spark/dev/README.md
T
John Colvin ab78ae867a dev: Add docs for building/intellisense in VS Code
TODO: Add docs for building Spark on Windows
2023-04-10 11:55:13 -04:00

3.0 KiB

C++ Intellisense for Spark on Windows (VS Code)

Steps

  1. Install the C++ extension
  2. Install the CMake extension
  3. Copy c_cpp_properties.json from this folder to $workspaceFolder/.vscode/
  4. In the VS Code Command Palette, run CMake: Select Configure Preset, then select 'spark' from the dropdown

Notes

  • Intellisense won't work for generated files/types until you build libspark

C++ Intellisense for Sparkd on Linux (VS Code)

  1. Install the CMake extension
  2. Install the Clangd extension
  3. (Optional) Install the C++ extension (needed for debugging, but intellisense should work without it).
  4. If the C++ extension is installed, disable its intellisense in your workspace settings (Clangd intellisense is better)
    "C_Cpp.intelliSenseEngine": "disabled"
    
  5. In the VS Code Command Palette, run CMake: Select Configure Preset, then select the preset you wish to build from the dropdown
    • The Clang presets may work best with the Clangd extension
    • Intellisense won't work for generated files/types until you build libspark

Build Sparkd on Linux

Notes

Steps

  1. Set up the Python virtual environment
    • Run commands from the repo root dir unless otherwise noted
    1. Create the virtual environment
      python3 -m venv .venv
      
    2. Activate the virtual environment
      . .venv/bin/activate
      
    3. Verify python in the venv is first in the path
      • Expected: output shows the absolute path to .venv/bin/python
      which python
      
    4. Update pip
      • The venv module initializes virtual environments with its own version of pip, rather than the system's version. Even if the latter is up-to-date, the former may not be.
      python -m pip install --upgrade pip
      
    5. Install the packages listed requirements.txt
      pip install -r requirements.txt
      
  2. Build Sparkd
    • From the terminal
      tools/build_sparkd.sh
      
      • Run with --help to see available options
    • From VS Code
      1. Install the CMake extension
      2. In the VS Code Command Palette, run CMake: Select Configure Preset, then select the preset you wish to build from the dropdown
      3. Run CMake: Build in the command palette.