|
2 | 2 | HPCCM development container for the C++ HPC tutorial |
3 | 3 | https://github.com/NVIDIA/hpc-container-maker/ |
4 | 4 | """ |
| 5 | +import platform |
5 | 6 | nvhpc_ver = '22.11' |
6 | 7 | cuda_ver = '11.8' |
7 | 8 | gcc_ver = '12' |
|
10 | 11 | Stage0 += baseimage(image = f'nvcr.io/nvidia/nvhpc:{nvhpc_ver}-devel-cuda{cuda_ver}-ubuntu22.04') |
11 | 12 | #Stage0 += baseimage(image = f'nvcr.io/nvidia/nvhpc:{nvhpc_ver}-devel-cuda_multi-ubuntu22.04') |
12 | 13 |
|
| 14 | +arch = 'x86_64' |
| 15 | +if platform.machine() == 'aarch64': |
| 16 | + arch = 'aarch64' |
| 17 | + |
13 | 18 | Stage0 += packages(ospackages=[ |
14 | 19 | 'libtbb-dev', # Required for GCC C++ parallel STL |
15 | | - 'python3', 'python3-pip', 'python-is-python3', 'python3-setuptools', |
| 20 | + 'python3', 'python3-pip', 'python-is-python3', 'python3-setuptools', 'python3-dev', |
16 | 21 | 'nginx', 'zip', 'make', 'build-essential', 'curl', |
17 | 22 | 'git', 'bc', 'debianutils', 'libnuma1', 'openssh-client', 'wget', 'numactl', |
18 | 23 | # editors |
19 | | - 'emacs', 'vim', |
| 24 | +# 'emacs', 'vim', |
20 | 25 | ]) |
21 | 26 |
|
22 | 27 | # Install GNU and LLVM toolchains and CMake |
|
28 | 33 | 'set -ex', # Exit on first error and debug output |
29 | 34 |
|
30 | 35 | # Configure the HPC SDK toolchain to pick the latest GCC |
31 | | - f'cd /opt/nvidia/hpc_sdk/Linux_x86_64/{nvhpc_ver}/compilers/bin/', |
| 36 | + f'cd /opt/nvidia/hpc_sdk/Linux_{arch}/{nvhpc_ver}/compilers/bin/', |
32 | 37 | 'makelocalrc -d . -x .', |
33 | 38 |
|
34 | 39 | # Install required python packages for the notebooks |
35 | 40 | 'pip install --upgrade pip', |
36 | | - 'pip install numpy matplotlib conan gdown jupyterlab ipywidgets', |
| 41 | + 'pip install numpy matplotlib gdown jupyterlab ipywidgets pandas seaborn', |
37 | 42 |
|
38 | | - # Install latest versions of range-v3 and NVIDIA std::execution |
| 43 | + # Install latest versions of range-v3, NVIDIA std::execution, and NVTX3 |
39 | 44 | 'mkdir -p /var/tmp', |
40 | 45 | 'cd /var/tmp', |
41 | | - 'git clone https://github.com/ericniebler/range-v3.git', |
| 46 | + 'git clone --depth=1 https://github.com/ericniebler/range-v3.git', |
42 | 47 | 'cp -r range-v3/include/* /usr/include/', |
43 | 48 | 'rm -rf range-v3', |
44 | | - 'git clone https://github.com/nvidia/stdexec.git', |
| 49 | + 'git clone --depth=1 https://github.com/nvidia/stdexec.git', |
45 | 50 | 'cp -r stdexec/include/* /usr/include/', |
46 | 51 | 'rm -rf stdexec', |
| 52 | + 'git clone --depth=1 --branch=release-v3 https://github.com/NVIDIA/NVTX.git', |
| 53 | + 'cp -r NVTX/c/include/nvtx3 /usr/include/nvtx3', |
| 54 | + 'rm -rf NVTX', |
47 | 55 | 'cd -', |
48 | | -]) |
49 | 56 |
|
50 | | -# libc++abi : make sure clang with -stdlib=libc++ can find it |
51 | | -Stage0 += shell(commands=[ |
| 57 | + # libc++abi: make sure clang with -stdlib=libc++ can find it |
52 | 58 | f'ln -sf /usr/lib/llvm-{llvm_ver}/lib/libc++abi.so.1 /usr/lib/llvm-{llvm_ver}/lib/libc++abi.so', |
| 59 | + |
| 60 | + # Install HPC SDK mdspan systemwide: |
| 61 | + f'ln -sf /opt/nvidia/hpc_sdk/Linux_{arch}/{nvhpc_ver}/compilers/include/experimental/mdspan /usr/include/mdspan', |
| 62 | + f'ln -sf /opt/nvidia/hpc_sdk/Linux_{arch}/{nvhpc_ver}/compilers/include/experimental/__p0009_bits /usr/include/__p0009_bits', |
| 63 | + |
| 64 | + # Put the labs include directory in the systemwide path: |
| 65 | + f'ln -sf /src/include /usr/include/labs', |
53 | 66 | ]) |
| 67 | + |
| 68 | + |
54 | 69 | Stage0 += environment(variables={ |
55 | 70 | 'LD_LIBRARY_PATH': f'/usr/lib/llvm-{llvm_ver}/lib:$LD_LIBRARY_PATH', |
56 | 71 | 'LIBRARY_PATH': f'/usr/lib/llvm-{llvm_ver}/lib:$LIBRARY_PATH', |
|
68 | 83 | # Workaround hwloc binding: |
69 | 84 | 'OMPI_MCA_hwloc_base_binding_policy': 'none', |
70 | 85 | }) |
71 | | -Stage0 += copy(src='labs/', dest='/labs/') |
| 86 | +#Stage0 += copy(src='labs/', dest='/labs/') |
72 | 87 | Stage0 += copy(src='include/cartesian_product.hpp', dest='/usr/include/cartesian_product.hpp') |
73 | 88 |
|
74 | 89 | # Install Intel's OneAPI toolchain |
|
0 commit comments