C++ Intellisense for Spark on Windows (VS Code)
Steps
- Install the C++ extension
- Install the CMake extension
- Copy
c_cpp_properties.jsonfrom this folder to$workspaceFolder/.vscode/ - 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)
- Install the CMake extension
- Install the Clangd extension
- (Optional) Install the C++ extension (needed for debugging, but intellisense should work without it).
- If the C++ extension is installed, disable its intellisense in
your workspace settings (Clangd intellisense is better)
"C_Cpp.intelliSenseEngine": "disabled" - 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
- Sparkd is built using CMakePresets
Steps
- Set up the Python virtual environment
- Run commands from the repo root dir unless otherwise noted
- Create the virtual environment
python3 -m venv .venv - Activate the virtual environment
. .venv/bin/activate - Verify
pythonin the venv is first in the path
- Expected: output shows the absolute path to
.venv/bin/python
which python - Expected: output shows the absolute path to
- 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 - Install the packages listed
requirements.txtpip install -r requirements.txt
- Build Sparkd
- From the terminal
tools/build_sparkd.sh- Run with
--helpto see available options
- Run with
- From VS Code
- Install the CMake extension
- In the VS Code Command Palette, run CMake: Select Configure Preset, then select the preset you wish to build from the dropdown
- Run CMake: Build in the command palette.
- From the terminal
Build Spark Api Server on Windows
Dependencies
- CMake (version >= 3.23)
- Python (version >= 3.9)
- Visual Studio (version)
- Dotnet (sdk version >= 7.0.0)
References
Notes
- Run commands from the repo root dir unless otherwise noted
- Set up the Python Virtual Environment
# Create the virtual environment python3 -m venv .venv # Activate the virtual environment .venv\bin\activate.bat # Update pip python -m pip install --upgrade pip # Install packages pip install -r requirements.txt - Build
- Run in python virtual environment
# Configure cmake --preset spark-api-server-windows # Build debug cmake --build --preset spark-api-server-windows-debug dotnet build Spark.Api.Server.sln --configuration Debug # Build release cmake --build --preset spark-api-server-windows-release dotnet build Spark.Api.Server.sln --configuration Release
Build Spark Api Server on Linux
Dependencies
- CMake (version >= 3.23)
- Ninja Build
- Python (version >= 3.9)
- Dotnet (sdk version >= 7.0.0)
References
Prerequisites
- Open repository in a VS Code Devcontainer, or create your own docker container in which to build
Notes
- Run commands from the repo root dir unless otherwise noted
- Set up the Python Virtual Environment
# Create the virtual environment python3 -m venv .venv # Activate the virtual environment . .venv/bin/activate # Update pip python -m pip install --upgrade pip # Install packages pip install -r requirements.txt - Build
- Run in python virtual environment
# Configure cmake --preset spark-api-server-linux # Build debug cmake --build --preset spark-api-server-linux-debug dotnet build Spark.Api.Server.sln --configuration Debug # Build release cmake --build --preset spark-api-server-linux-release dotnet build Spark.Api.Server.sln --configuration Release