Skip to content

Commit 542bbf0

Browse files
test
1 parent 7c94a66 commit 542bbf0

29 files changed

+1303
-1303
lines changed

.devcontainer/CPU/Dockerfile

100644100755
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-22.04
2-
3-
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.22.2"
4-
5-
# Optionally install the cmake for vcpkg
6-
COPY ./reinstall-cmake.sh /tmp/
7-
8-
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
9-
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
10-
fi \
11-
&& rm -f /tmp/reinstall-cmake.sh
12-
13-
# [Optional] Uncomment this section to install additional vcpkg ports.
14-
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>"
15-
16-
# [Optional] Uncomment this section to install additional packages.
17-
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
18-
# && apt-get -y install --no-install-recommends <your-package-list-here>
1+
FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-22.04
2+
3+
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.22.2"
4+
5+
# Optionally install the cmake for vcpkg
6+
COPY ./reinstall-cmake.sh /tmp/
7+
8+
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
9+
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
10+
fi \
11+
&& rm -f /tmp/reinstall-cmake.sh
12+
13+
# [Optional] Uncomment this section to install additional vcpkg ports.
14+
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>"
15+
16+
# [Optional] Uncomment this section to install additional packages.
17+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
18+
# && apt-get -y install --no-install-recommends <your-package-list-here>

.devcontainer/CPU/devcontainer.json

100644100755
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
3-
{
4-
"name": "C++",
5-
"build": {
6-
"dockerfile": "Dockerfile"
7-
},
8-
9-
"customizations": {
10-
"vscode": {
11-
"extensions": [
12-
"ms-vscode.cpptools-extension-pack",
13-
"ms-vscode.cmake-tools"
14-
]
15-
}
16-
}
17-
18-
// Features to add to the dev container. More info: https://containers.dev/features.
19-
// "features": {},
20-
21-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22-
// "forwardPorts": [],
23-
24-
// Use 'postCreateCommand' to run commands after the container is created.
25-
// "postCreateCommand": "gcc -v",
26-
27-
// Configure tool-specific properties.
28-
// "customizations": {},
29-
30-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
31-
// "remoteUser": "root"
32-
}
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
3+
{
4+
"name": "C++",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
},
8+
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"ms-vscode.cpptools-extension-pack",
13+
"ms-vscode.cmake-tools"
14+
]
15+
}
16+
}
17+
18+
// Features to add to the dev container. More info: https://containers.dev/features.
19+
// "features": {},
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// "forwardPorts": [],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
// "postCreateCommand": "gcc -v",
26+
27+
// Configure tool-specific properties.
28+
// "customizations": {},
29+
30+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
31+
// "remoteUser": "root"
32+
}

.devcontainer/CPU/reinstall-cmake.sh

100644100755
Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
#!/usr/bin/env bash
2-
#-------------------------------------------------------------------------------------------------------------
3-
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
5-
#-------------------------------------------------------------------------------------------------------------
6-
#
7-
set -e
8-
9-
CMAKE_VERSION=${1:-"none"}
10-
11-
if [ "${CMAKE_VERSION}" = "none" ]; then
12-
echo "No CMake version specified, skipping CMake reinstallation"
13-
exit 0
14-
fi
15-
16-
# Cleanup temporary directory and associated files when exiting the script.
17-
cleanup() {
18-
EXIT_CODE=$?
19-
set +e
20-
if [[ -n "${TMP_DIR}" ]]; then
21-
echo "Executing cleanup of tmp files"
22-
rm -Rf "${TMP_DIR}"
23-
fi
24-
exit $EXIT_CODE
25-
}
26-
trap cleanup EXIT
27-
28-
29-
echo "Installing CMake..."
30-
apt-get -y purge --auto-remove cmake
31-
mkdir -p /opt/cmake
32-
33-
architecture=$(dpkg --print-architecture)
34-
case "${architecture}" in
35-
arm64)
36-
ARCH=aarch64 ;;
37-
amd64)
38-
ARCH=x86_64 ;;
39-
*)
40-
echo "Unsupported architecture ${architecture}."
41-
exit 1
42-
;;
43-
esac
44-
45-
CMAKE_BINARY_NAME="cmake-${CMAKE_VERSION}-linux-${ARCH}.sh"
46-
CMAKE_CHECKSUM_NAME="cmake-${CMAKE_VERSION}-SHA-256.txt"
47-
TMP_DIR=$(mktemp -d -t cmake-XXXXXXXXXX)
48-
49-
echo "${TMP_DIR}"
50-
cd "${TMP_DIR}"
51-
52-
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_BINARY_NAME}" -O
53-
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_CHECKSUM_NAME}" -O
54-
55-
sha256sum -c --ignore-missing "${CMAKE_CHECKSUM_NAME}"
56-
sh "${TMP_DIR}/${CMAKE_BINARY_NAME}" --prefix=/opt/cmake --skip-license
57-
58-
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
59-
ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
5+
#-------------------------------------------------------------------------------------------------------------
6+
#
7+
set -e
8+
9+
CMAKE_VERSION=${1:-"none"}
10+
11+
if [ "${CMAKE_VERSION}" = "none" ]; then
12+
echo "No CMake version specified, skipping CMake reinstallation"
13+
exit 0
14+
fi
15+
16+
# Cleanup temporary directory and associated files when exiting the script.
17+
cleanup() {
18+
EXIT_CODE=$?
19+
set +e
20+
if [[ -n "${TMP_DIR}" ]]; then
21+
echo "Executing cleanup of tmp files"
22+
rm -Rf "${TMP_DIR}"
23+
fi
24+
exit $EXIT_CODE
25+
}
26+
trap cleanup EXIT
27+
28+
29+
echo "Installing CMake..."
30+
apt-get -y purge --auto-remove cmake
31+
mkdir -p /opt/cmake
32+
33+
architecture=$(dpkg --print-architecture)
34+
case "${architecture}" in
35+
arm64)
36+
ARCH=aarch64 ;;
37+
amd64)
38+
ARCH=x86_64 ;;
39+
*)
40+
echo "Unsupported architecture ${architecture}."
41+
exit 1
42+
;;
43+
esac
44+
45+
CMAKE_BINARY_NAME="cmake-${CMAKE_VERSION}-linux-${ARCH}.sh"
46+
CMAKE_CHECKSUM_NAME="cmake-${CMAKE_VERSION}-SHA-256.txt"
47+
TMP_DIR=$(mktemp -d -t cmake-XXXXXXXXXX)
48+
49+
echo "${TMP_DIR}"
50+
cd "${TMP_DIR}"
51+
52+
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_BINARY_NAME}" -O
53+
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_CHECKSUM_NAME}" -O
54+
55+
sha256sum -c --ignore-missing "${CMAKE_CHECKSUM_NAME}"
56+
sh "${TMP_DIR}/${CMAKE_BINARY_NAME}" --prefix=/opt/cmake --skip-license
57+
58+
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
59+
ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest

.devcontainer/CUDA/Dockerfile

100644100755
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM nvcr.io/nvidia/cuda:12.3.1-devel-ubuntu22.04
2-
3-
RUN apt-get update && apt-get -y install cmake
4-
5-
# [Optional] Uncomment this section to install additional vcpkg ports.
6-
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>"
7-
8-
# [Optional] Uncomment this section to install additional packages.
9-
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
10-
# && apt-get -y install --no-install-recommends <your-package-list-here>
1+
FROM nvcr.io/nvidia/cuda:12.3.1-devel-ubuntu22.04
2+
3+
RUN apt-get update && apt-get -y install cmake
4+
5+
# [Optional] Uncomment this section to install additional vcpkg ports.
6+
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>"
7+
8+
# [Optional] Uncomment this section to install additional packages.
9+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
10+
# && apt-get -y install --no-install-recommends <your-package-list-here>

.devcontainer/CUDA/devcontainer.json

100644100755
Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
3-
{
4-
"name": "CUDA",
5-
"build": {
6-
"dockerfile": "Dockerfile"
7-
},
8-
9-
"runArgs": [
10-
"--gpus",
11-
"all"
12-
],
13-
14-
"customizations": {
15-
"vscode": {
16-
"extensions": [
17-
"ms-vscode.cpptools-extension-pack",
18-
"ms-vscode.cmake-tools"
19-
]
20-
}
21-
},
22-
23-
"hostRequirements": {
24-
"gpu": "optional"
25-
},
26-
27-
"features": {
28-
"ghcr.io/devcontainers/features/git:1": {}
29-
}
30-
31-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
32-
// "forwardPorts": [],
33-
34-
// Use 'postCreateCommand' to run commands after the container is created.
35-
// "postCreateCommand": "gcc -v",
36-
37-
// Configure tool-specific properties.
38-
// "customizations": {},
39-
40-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
41-
// "remoteUser": "root"
42-
}
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
3+
{
4+
"name": "CUDA",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
},
8+
9+
"runArgs": [
10+
"--gpus",
11+
"all"
12+
],
13+
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"ms-vscode.cpptools-extension-pack",
18+
"ms-vscode.cmake-tools"
19+
]
20+
}
21+
},
22+
23+
"hostRequirements": {
24+
"gpu": "optional"
25+
},
26+
27+
"features": {
28+
"ghcr.io/devcontainers/features/git:1": {}
29+
}
30+
31+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
32+
// "forwardPorts": [],
33+
34+
// Use 'postCreateCommand' to run commands after the container is created.
35+
// "postCreateCommand": "gcc -v",
36+
37+
// Configure tool-specific properties.
38+
// "customizations": {},
39+
40+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
41+
// "remoteUser": "root"
42+
}

0 commit comments

Comments
 (0)