diff --git a/docker/Dockerfile b/docker/Dockerfile index cbd89c8..8b2756c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -108,6 +108,9 @@ RUN /pmemkv-nodejs.sh COPY pmemkv-ruby.sh / RUN /pmemkv-ruby.sh +COPY install-hwloc.sh / +RUN /install-hwloc.sh + COPY memkind.sh / RUN /memkind.sh @@ -117,4 +120,4 @@ RUN /librpma.sh COPY tz.sh / RUN /tz.sh -RUN rm /pmdk.sh /valgrind.sh /pmemobj-cpp.sh /pmemkv.sh /setup-maven-settings.sh /pmemkv-java.sh /pmemkv-python.sh /pmemkv-nodejs.sh /pmemkv-ruby.sh /memkind.sh /librpma.sh /tz.sh +RUN rm /pmdk.sh /valgrind.sh /pmemobj-cpp.sh /pmemkv.sh /setup-maven-settings.sh /pmemkv-java.sh /pmemkv-python.sh /pmemkv-nodejs.sh /pmemkv-ruby.sh /install-hwloc.sh /memkind.sh /librpma.sh /tz.sh diff --git a/docker/install-hwloc.sh b/docker/install-hwloc.sh new file mode 100755 index 0000000..811f928 --- /dev/null +++ b/docker/install-hwloc.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# SPDX-License-Identifier: BSD-2-Clause +# Copyright (C) 2020 - 2022 Intel Corporation. + +# installs hwloc library + +set -e + +HWLOC_LIBRARY_VERSION=v2.3 +HWLOC_VERSION="${HWLOC_LIBRARY_VERSION:1}".0 +HWLOC_TAR_GZ=hwloc-"${HWLOC_VERSION}".tar.gz + +HWLOC_TARBALL_URL=https://download.open-mpi.org/release/hwloc/"$HWLOC_LIBRARY_VERSION"/"$HWLOC_TAR_GZ" + +HWLOC_LOCAL_DIR="$HOME"/hwloc/"$HWLOC_LIBRARY_VERSION" +HWLOC_LOCAL_TAR_GZ="$HWLOC_LOCAL_DIR"/"$HWLOC_TAR_GZ" + +# create hwloc directory in home directory +mkdir -p "$HWLOC_LOCAL_DIR" + +# download and untar hwloc library to hwloc directory +curl -L "$HWLOC_TARBALL_URL" -o "$HWLOC_LOCAL_TAR_GZ" +tar -xzf "$HWLOC_LOCAL_TAR_GZ" -C "$HWLOC_LOCAL_DIR" --strip-components=1 + +# go to hwloc directory, build and install library +cd "$HWLOC_LOCAL_DIR" +./configure --prefix=/usr +make -j "$(nproc)" +sudo make -j "$(nproc)" install