curl -s https://gist.githubusercontent.com/tueda/aa0f10331289e4a294eb6fa242f1a5ee/raw/setup.sh | bash -s -- 20.04 mpich
Last active
October 12, 2024 06:29
-
-
Save tueda/aa0f10331289e4a294eb6fa242f1a5ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"name": "FORM", | |
"build": { | |
"dockerfile": "Dockerfile" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/devcontainers/base:ubuntu-20.04 | |
RUN apt-get update && apt-get install -y automake build-essential git libgmp-dev libmpfr-dev libmpich-dev ruby zlib1g-dev | |
RUN apt-get install -y file valgrind | |
RUN git -C /tmp clone --depth 1 -b v2.47.0 https://github.com/git/git.git \ | |
&& make -C /tmp/git/contrib/diff-highlight/ \ | |
&& cp /tmp/git/contrib/diff-highlight/diff-highlight /usr/local/bin \ | |
&& rm -rf /tmp/git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
if [ ! -d form ]; then | |
git clone https://github.com/vermaseren/form.git | |
git -C form remote add tueda https://github.com/tueda/form.git | |
git -C form remote add jodavies https://github.com/jodavies/form.git | |
git -C form fetch --all | |
fi | |
mkdir -p .devcontainer | |
curl -o .devcontainer/devcontainer.json https://gist.githubusercontent.com/tueda/aa0f10331289e4a294eb6fa242f1a5ee/raw/devcontainer.json | |
curl -o .devcontainer/Dockerfile https://gist.githubusercontent.com/tueda/aa0f10331289e4a294eb6fa242f1a5ee/raw/Dockerfile | |
for arg in "$@"; do | |
case $arg in | |
20.04|22.04|24.04) | |
sed -i "s|^FROM mcr.microsoft.com/devcontainers/base:ubuntu-.*|FROM mcr.microsoft.com/devcontainers/base:ubuntu-$arg|" .devcontainer/Dockerfile | |
;; | |
openmpi|mpich) | |
sed -i \ | |
-e '/^RUN apt-get update && apt-get install -y/ s/libopenmpi-dev\|libmpich-dev/ /g' \ | |
-e "/^RUN apt-get update && apt-get install -y/ s/$/ lib$arg-dev/" \ | |
-e '/^RUN apt-get update && apt-get install -y/ s/ */ /g' \ | |
.devcontainer/Dockerfile | |
;; | |
*) | |
echo "unknown option: $arg">&1 | |
;; | |
esac | |
shift | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment