Skip to content

Commit 7d4621e

Browse files
Add dev container (#86)
* Add dev container * Update contributing.md with container info * Reduce container size a bit Don't install "recommended" packages through `apt`. Also install `make` since it is recommended by `cmake`. --------- Co-authored-by: alexander-novo <alexander-novo@users.noreply.github.com>
1 parent 6b4f378 commit 7d4621e

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM ubuntu:24.04
2+
3+
RUN apt update -y && apt install -y --no-install-recommends\
4+
gcc \
5+
g++ \
6+
make \
7+
cmake \
8+
ninja-build \
9+
git \
10+
ca-certificates \
11+
libopenblas-dev \
12+
&& apt clean && rm -rf /var/lib/apt/lists/*
13+
14+
# Install SuiteSparse for klu
15+
RUN git clone --single-branch --depth 1 --branch v7.10.2 https://github.com/DrTimothyAldenDavis/SuiteSparse.git /tmp/suitesparse && \
16+
cd /tmp/suitesparse && \
17+
mkdir -p build && cd build && \
18+
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
19+
-DSUITESPARSE_ENABLE_PROJECTS="klu" .. && \
20+
ninja install && \
21+
rm -rf /tmp/suitesparse
22+
23+
# Install sundials using klu from previous step
24+
RUN git clone --single-branch --branch develop https://github.com/LLNL/sundials.git /tmp/sundials && \
25+
cd /tmp/sundials && \
26+
git checkout 07d21c2c5ae33211a9a2fafd8eac56de5582dce0 && \
27+
mkdir -p build && cd build && \
28+
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
29+
-DENABLE_KLU=ON .. && \
30+
ninja install && \
31+
rm -rf /tmp/sundials

.devcontainer/devcontainer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"build": {
3+
"dockerfile": "Dockerfile"
4+
},
5+
"customizations": {
6+
"vscode": {
7+
"extensions": [
8+
"ms-vscode.cpptools"
9+
]
10+
}
11+
}
12+
}

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,3 +457,7 @@ class Matrix // No, class is outside GridKit namespace
457457
{
458458
// matrix code
459459
};
460+
```
461+
462+
## Development Container
463+
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.

0 commit comments

Comments
 (0)