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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 \
gcc \
g++ \
cmake \
ninja-build \
git \
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 -j $(nproc) && \
ninja install && \
rm -rf /tmp/suitesparse

# Install sundials using klu from previous step
RUN git clone --single-branch --depth 1 --branch v7.3.0 https://github.com/LLNL/sundials.git /tmp/sundials && \
cd /tmp/sundials && \
mkdir -p build && cd build && \
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_KLU=ON \
-DKLU_ROOT=/usr/local/lib/cmake/KLU .. && \
ninja -j $(nproc) && \
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 @@ -399,3 +399,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.