diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..b5408c2f0 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,31 @@ +FROM ubuntu:24.04 + +RUN apt update -y && apt install -y --no-install-recommends\ + gcc \ + g++ \ + make \ + cmake \ + ninja-build \ + git \ + ca-certificates \ + libopenblas-dev \ + && apt clean && rm -rf /var/lib/apt/lists/* + +# Install SuiteSparse for klu +RUN git clone --single-branch --depth 1 --branch v7.10.2 https://github.com/DrTimothyAldenDavis/SuiteSparse.git /tmp/suitesparse && \ + cd /tmp/suitesparse && \ + mkdir -p build && cd build && \ + cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DSUITESPARSE_ENABLE_PROJECTS="klu" .. && \ + ninja install && \ + rm -rf /tmp/suitesparse + +# Install sundials using klu from previous step +RUN git clone --single-branch --branch develop https://github.com/LLNL/sundials.git /tmp/sundials && \ + cd /tmp/sundials && \ + git checkout 07d21c2c5ae33211a9a2fafd8eac56de5582dce0 && \ + mkdir -p build && cd build && \ + cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DENABLE_KLU=ON .. && \ + ninja install && \ + rm -rf /tmp/sundials diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..fa5dc63f0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools" + ] + } + } +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6643d5f6..30e684379 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -457,3 +457,7 @@ class Matrix // No, class is outside GridKit namespace { // matrix code }; +``` + +## Development Container +A development container is available for all developers using VS Code to develop. This will automatically install all pre-requisite software you need to develop in GridKit. Any developer who wishes to use this setup can follow [this tutorial](https://code.visualstudio.com/docs/devcontainers/tutorial) and simply use the option "Reopen Folder in Container" rather than "New Dev Container...", which will automatically build the included container.