Skip to content

Add dev container #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 30, 2025
31 changes: 31 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools"
]
}
}
}
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading