Skip to content

Commit

Permalink
Disable example and packages builds by default
Browse files Browse the repository at this point in the history
  • Loading branch information
samcmill committed Sep 13, 2023
1 parent f7e3663 commit 54fff7e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docs/building_blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3252,6 +3252,12 @@ version 3.19 or later is required and must be installed separately.
__Parameters__


- __build_examples__: Boolean flag to specify whether the NVSHMEM
examples should be built. The default is False.

- __build_packages__: Boolean flag to specify whether the RPM and deb
packages should be built. The default is False.

- __cmake_opts__: List of additional options to pass to `cmake`. The
default value is an empty list.

Expand Down
16 changes: 16 additions & 0 deletions hpccm/building_blocks/nvshmem.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ class nvshmem(bb_base, hpccm.templates.downloader, hpccm.templates.envvars,
# Parameters
build_examples: Boolean flag to specify whether the NVSHMEM
examples should be built. The default is False.
build_packages: Boolean flag to specify whether the RPM and deb
packages should be built. The default is False.
cmake_opts: List of additional options to pass to `cmake`. The
default value is an empty list.
Expand Down Expand Up @@ -93,6 +99,8 @@ def __init__(self, **kwargs):

super(nvshmem, self).__init__(**kwargs)

self.__build_examples = kwargs.pop('build_examples', False)
self.__build_packages = kwargs.pop('build_packages', False)
self.__cmake_opts = kwargs.pop('cmake_opts', [])
self.__cuda = kwargs.pop('cuda', '/usr/local/cuda')
self.__gdrcopy = kwargs.pop('gdrcopy', None)
Expand Down Expand Up @@ -138,6 +146,14 @@ def __init__(self, **kwargs):
def __configure(self):
"""Setup build options based on user parameters"""

if self.__build_examples is False:
self.__cmake_opts.append('-DNVSHMEM_BUILD_EXAMPLES=OFF')

if self.__build_packages is False:
self.__cmake_opts.append('-DNVSHMEM_BUILD_PACKAGES=OFF')
self.__cmake_opts.append('-DNVSHMEM_BUILD_DEB_PACKAGES=OFF')
self.__cmake_opts.append('-DNVSHMEM_BUILD_RPM_PACKAGES=OFF')

if self.__cuda:
self.__cmake_opts.append('-DCUDA_HOME={}'.format(self.__cuda))

Expand Down
6 changes: 3 additions & 3 deletions test/test_nvshmem.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_defaults_ubuntu(self):
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://developer.download.nvidia.com/compute/redist/nvshmem/2.9.0/source/nvshmem_src_2.9.0-2.txz && \
mkdir -p /var/tmp && tar -x -f /var/tmp/nvshmem_src_2.9.0-2.txz -C /var/tmp -J && \
mkdir -p /var/tmp/nvshmem_src_2.9.0-2/build && cd /var/tmp/nvshmem_src_2.9.0-2/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nvshmem -DCUDA_HOME=/usr/local/cuda /var/tmp/nvshmem_src_2.9.0-2 && \
mkdir -p /var/tmp/nvshmem_src_2.9.0-2/build && cd /var/tmp/nvshmem_src_2.9.0-2/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nvshmem -DNVSHMEM_BUILD_EXAMPLES=OFF -DNVSHMEM_BUILD_PACKAGES=OFF -DNVSHMEM_BUILD_DEB_PACKAGES=OFF -DNVSHMEM_BUILD_RPM_PACKAGES=OFF -DCUDA_HOME=/usr/local/cuda /var/tmp/nvshmem_src_2.9.0-2 && \
cmake --build /var/tmp/nvshmem_src_2.9.0-2/build --target all -- -j$(nproc) && \
cmake --build /var/tmp/nvshmem_src_2.9.0-2/build --target install -- -j$(nproc) && \
rm -rf /var/tmp/nvshmem_src_2.9.0-2 /var/tmp/nvshmem_src_2.9.0-2.txz
Expand All @@ -68,7 +68,7 @@ def test_package_ubuntu(self):
rm -rf /var/lib/apt/lists/*
COPY nvshmem_src_2.9.0-2.tar.xz /var/tmp/nvshmem_src_2.9.0-2.tar.xz
RUN mkdir -p /var/tmp && tar -x -f /var/tmp/nvshmem_src_2.9.0-2.tar.xz -C /var/tmp -J && \
mkdir -p /var/tmp/nvshmem_src_2.9.0-2/build && cd /var/tmp/nvshmem_src_2.9.0-2/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nvshmem -DCUDA_HOME=/usr/local/cuda /var/tmp/nvshmem_src_2.9.0-2 && \
mkdir -p /var/tmp/nvshmem_src_2.9.0-2/build && cd /var/tmp/nvshmem_src_2.9.0-2/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nvshmem -DNVSHMEM_BUILD_EXAMPLES=OFF -DNVSHMEM_BUILD_PACKAGES=OFF -DNVSHMEM_BUILD_DEB_PACKAGES=OFF -DNVSHMEM_BUILD_RPM_PACKAGES=OFF -DCUDA_HOME=/usr/local/cuda /var/tmp/nvshmem_src_2.9.0-2 && \
cmake --build /var/tmp/nvshmem_src_2.9.0-2/build --target all -- -j$(nproc) && \
cmake --build /var/tmp/nvshmem_src_2.9.0-2/build --target install -- -j$(nproc) && \
rm -rf /var/tmp/nvshmem_src_2.9.0-2 /var/tmp/nvshmem_src_2.9.0-2.tar.xz
Expand All @@ -95,7 +95,7 @@ def test_cmake_options_centos(self):
rm -rf /var/cache/yum/*
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://developer.download.nvidia.com/compute/redist/nvshmem/2.9.0/source/nvshmem_src_2.9.0-2.txz && \
mkdir -p /var/tmp && tar -x -f /var/tmp/nvshmem_src_2.9.0-2.txz -C /var/tmp -J && \
mkdir -p /var/tmp/nvshmem_src_2.9.0-2/build && cd /var/tmp/nvshmem_src_2.9.0-2/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nvshmem -DNVSHMEM_USE_NCCL=1 -DNVSHMEM_UCX_SUPPORT=1 -DCUDA_HOME=/usr/local/cuda -DGDRCOPY_HOME=/usr/local/gdrcopy -DNVSHMEM_MPI_SUPPORT= 1 -DMPI_HOME=/usr/local/openmpi -DNVSHMEM_SHMEM_SUPPORT=1 -DSHMEM_HOME=/usr/local/openmpi /var/tmp/nvshmem_src_2.9.0-2 && \
mkdir -p /var/tmp/nvshmem_src_2.9.0-2/build && cd /var/tmp/nvshmem_src_2.9.0-2/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nvshmem -DNVSHMEM_USE_NCCL=1 -DNVSHMEM_UCX_SUPPORT=1 -DNVSHMEM_BUILD_EXAMPLES=OFF -DNVSHMEM_BUILD_PACKAGES=OFF -DNVSHMEM_BUILD_DEB_PACKAGES=OFF -DNVSHMEM_BUILD_RPM_PACKAGES=OFF -DCUDA_HOME=/usr/local/cuda -DGDRCOPY_HOME=/usr/local/gdrcopy -DNVSHMEM_MPI_SUPPORT= 1 -DMPI_HOME=/usr/local/openmpi -DNVSHMEM_SHMEM_SUPPORT=1 -DSHMEM_HOME=/usr/local/openmpi /var/tmp/nvshmem_src_2.9.0-2 && \
cmake --build /var/tmp/nvshmem_src_2.9.0-2/build --target all -- -j$(nproc) && \
cmake --build /var/tmp/nvshmem_src_2.9.0-2/build --target install -- -j$(nproc) && \
rm -rf /var/tmp/nvshmem_src_2.9.0-2 /var/tmp/nvshmem_src_2.9.0-2.txz
Expand Down

0 comments on commit 54fff7e

Please sign in to comment.