Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Support for GCC 10.
Browse files Browse the repository at this point in the history
Bug 3024369
  • Loading branch information
griwes committed Jul 31, 2020
1 parent 656c3eb commit 6458f50
Show file tree
Hide file tree
Showing 38 changed files with 473 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .upstream-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Dockerfile for libcudacxx_base:host_x86_64_fedora_32__target_x86_64_fedora_32__gcc_10_cxx_11

FROM fedora:32

MAINTAINER Bryce Adelstein Lelbach <blelbach@nvidia.com>

ARG LIBCUDACXX_SKIP_BASE_TESTS_BUILD
ARG LIBCUDACXX_COMPUTE_ARCHS

###############################################################################
# BUILD: The following is invoked when the image is built.

SHELL ["/usr/bin/env", "bash", "-c"]

RUN yum -y updateinfo\
&& yum -y install which findutils make gcc-c++ libstdc++-static llvm-devel clang python python-pip cmake\
&& pip install lit\
&& mkdir -p /sw/gpgpu/libcudacxx/build\
&& mkdir -p /sw/gpgpu/libcudacxx/libcxx/build

# For debugging.
#RUN yum -y install gdb strace vim

# We use ADD here because it invalidates the cache for subsequent steps, which
# is what we want, as we need to rebuild if the sources have changed.

# Copy NVCC and the CUDA runtime from the source tree.
ADD bin /sw/gpgpu/bin

# Copy the core CUDA headers from the source tree.
ADD cuda/import/*.h* /sw/gpgpu/cuda/import/
ADD cuda/common/*.h* /sw/gpgpu/cuda/common/
ADD cuda/tools/ /sw/gpgpu/cuda/tools/
ADD opencl/import/cl_rel/CL/*.h* /sw/gpgpu/opencl/import/cl_rel/CL/

# Copy libcu++ sources from the source tree.
ADD libcudacxx /sw/gpgpu/libcudacxx

# List out everything in /sw before the build.
RUN echo "Contents of /sw:" && cd /sw/ && find

# Build libc++ and configure libc++ tests.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx/libcxx/build\
&& cmake ..\
-DLIBCXX_INCLUDE_TESTS=ON\
-DLIBCXX_INCLUDE_BENCHMARKS=OFF\
-DLIBCXX_CXX_ABI=libsupc++\
-DLIBCXX_TEST_STANDARD_VER=c++11\
-DLIBCXX_ABI_UNSTABLE=ON\
-DLLVM_CONFIG_PATH=$(which llvm-config)\
-DCMAKE_C_COMPILER=gcc\
-DCMAKE_CXX_COMPILER=g++\
&& make -j\
2>&1 | tee /sw/gpgpu/libcudacxx/build/cmake_libcxx.log

# Configure libcu++ tests.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx/build\
&& cmake ..\
-DLIBCXX_TEST_STANDARD_VER=c++11\
-DLLVM_CONFIG_PATH=$(which llvm-config)\
-DCMAKE_CXX_COMPILER=/sw/gpgpu/bin/x86_64_Linux_release/nvcc\
-DLIBCXX_NVCC_HOST_COMPILER=g++\
2>&1 | tee /sw/gpgpu/libcudacxx/build/cmake_libcudacxx.log

# Build tests if requested.
# NOTE: libc++ tests are disabled until we can setup libc++abi.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx\
&& LIBCUDACXX_COMPUTE_ARCHS=$LIBCUDACXX_COMPUTE_ARCHS\
LIBCUDACXX_SKIP_BASE_TESTS_BUILD=$LIBCUDACXX_SKIP_BASE_TESTS_BUILD\
/sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash\
--skip-tests-runs\
--skip-libcxx-tests\
2>&1 | tee /sw/gpgpu/libcudacxx/build/build_lit_all.log

# Build tests for sm6x if requested.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx\
&& LIBCUDACXX_COMPUTE_ARCHS="60 61 62"\
LIBCUDACXX_SKIP_BASE_TESTS_BUILD=$LIBCUDACXX_SKIP_BASE_TESTS_BUILD\
/sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash\
--skip-tests-runs\
--skip-libcxx-tests\
2>&1 | tee /sw/gpgpu/libcudacxx/build/build_lit_sm6x.log

# Build tests for sm7x if requested.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx\
&& LIBCUDACXX_COMPUTE_ARCHS="70 72 75"\
LIBCUDACXX_SKIP_BASE_TESTS_BUILD=$LIBCUDACXX_SKIP_BASE_TESTS_BUILD\
/sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash\
--skip-tests-runs\
--skip-libcxx-tests\
2>&1 | tee /sw/gpgpu/libcudacxx/build/build_lit_sm7x.log

# Build tests for sm8x if requested.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx\
&& LIBCUDACXX_COMPUTE_ARCHS="80"\
LIBCUDACXX_SKIP_BASE_TESTS_BUILD=$LIBCUDACXX_SKIP_BASE_TESTS_BUILD\
/sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash\
--skip-tests-runs\
--skip-libcxx-tests\
2>&1 | tee /sw/gpgpu/libcudacxx/build/build_lit_sm8x.log

# Package the logs up, because `docker container cp` doesn't support wildcards,
# and I want to limit the number of places we have to make changes when we ship
# new architectures.
RUN cd /sw/gpgpu/libcudacxx/build && tar -cvf logs.tar *.log

WORKDIR /sw/gpgpu/libcudacxx

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Dockerfile for libcudacxx:host_x86_64_fedora_32__target_x86_64_fedora_32__gcc_10_cxx_11

FROM libcudacxx_base:host_x86_64_fedora_32__target_x86_64_fedora_32__gcc_10_cxx_11

MAINTAINER Bryce Adelstein Lelbach <blelbach@nvidia.com>

###############################################################################
# BUILD: The following is invoked when the CUDA driver is attached.

# We use ADD here because it invalidates the cache for subsequent steps, which
# is what we want, as we need to rebuild if the sources have changed.

ADD nvidia-modprobe /usr/bin/
# Restore setuid.
RUN chmod +s /usr/bin/nvidia-modprobe

ADD libcuda.so* /usr/lib64/
ADD libnvidia-ptxjitcompiler.so* /usr/lib64/

###############################################################################
# CMD: The following is invoked when the image is run.

RUN useradd -ms /bin/bash libcudacxx && chown -R libcudacxx:libcudacxx /sw
USER libcudacxx

WORKDIR /sw/gpgpu/libcudacxx

CMD /sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash --skip-libcxx-tests

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/bash

HOST_ARCH=x86_64
HOST_OS_KIND=fedora
HOST_OS_VERSION=32
TARGET_ARCH=x86_64
TARGET_OS_KIND=fedora
TARGET_OS_VERSION=32
COMPILER_KIND=gcc
COMPILER_VERSION=10
COMPILER_CXX_DIALECT=11
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Dockerfile for libcudacxx_base:host_x86_64_fedora_32__target_x86_64_fedora_32__gcc_10_cxx_14

FROM fedora:32

MAINTAINER Bryce Adelstein Lelbach <blelbach@nvidia.com>

ARG LIBCUDACXX_SKIP_BASE_TESTS_BUILD
ARG LIBCUDACXX_COMPUTE_ARCHS

###############################################################################
# BUILD: The following is invoked when the image is built.

SHELL ["/usr/bin/env", "bash", "-c"]

RUN yum -y updateinfo\
&& yum -y install which findutils make gcc-c++ libstdc++-static llvm-devel clang python python-pip cmake\
&& pip install lit\
&& mkdir -p /sw/gpgpu/libcudacxx/build\
&& mkdir -p /sw/gpgpu/libcudacxx/libcxx/build

# For debugging.
#RUN yum -y install gdb strace vim

# We use ADD here because it invalidates the cache for subsequent steps, which
# is what we want, as we need to rebuild if the sources have changed.

# Copy NVCC and the CUDA runtime from the source tree.
ADD bin /sw/gpgpu/bin

# Copy the core CUDA headers from the source tree.
ADD cuda/import/*.h* /sw/gpgpu/cuda/import/
ADD cuda/common/*.h* /sw/gpgpu/cuda/common/
ADD cuda/tools/ /sw/gpgpu/cuda/tools/
ADD opencl/import/cl_rel/CL/*.h* /sw/gpgpu/opencl/import/cl_rel/CL/

# Copy libcu++ sources from the source tree.
ADD libcudacxx /sw/gpgpu/libcudacxx

# List out everything in /sw before the build.
RUN echo "Contents of /sw:" && cd /sw/ && find

# Build libc++ and configure libc++ tests.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx/libcxx/build\
&& cmake ..\
-DLIBCXX_INCLUDE_TESTS=ON\
-DLIBCXX_INCLUDE_BENCHMARKS=OFF\
-DLIBCXX_CXX_ABI=libsupc++\
-DLIBCXX_TEST_STANDARD_VER=c++11\
-DLIBCXX_ABI_UNSTABLE=ON\
-DLLVM_CONFIG_PATH=$(which llvm-config)\
-DCMAKE_C_COMPILER=gcc\
-DCMAKE_CXX_COMPILER=g++\
&& make -j\
2>&1 | tee /sw/gpgpu/libcudacxx/build/cmake_libcxx.log

# Configure libcu++ tests.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx/build\
&& cmake ..\
-DLIBCXX_TEST_STANDARD_VER=c++11\
-DLLVM_CONFIG_PATH=$(which llvm-config)\
-DCMAKE_CXX_COMPILER=/sw/gpgpu/bin/x86_64_Linux_release/nvcc\
-DLIBCXX_NVCC_HOST_COMPILER=g++\
2>&1 | tee /sw/gpgpu/libcudacxx/build/cmake_libcudacxx.log

# Build tests if requested.
# NOTE: libc++ tests are disabled until we can setup libc++abi.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx\
&& LIBCUDACXX_COMPUTE_ARCHS=$LIBCUDACXX_COMPUTE_ARCHS\
LIBCUDACXX_SKIP_BASE_TESTS_BUILD=$LIBCUDACXX_SKIP_BASE_TESTS_BUILD\
/sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash\
--skip-tests-runs\
--skip-libcxx-tests\
2>&1 | tee /sw/gpgpu/libcudacxx/build/build_lit_all.log

# Build tests for sm6x if requested.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx\
&& LIBCUDACXX_COMPUTE_ARCHS="60 61 62"\
LIBCUDACXX_SKIP_BASE_TESTS_BUILD=$LIBCUDACXX_SKIP_BASE_TESTS_BUILD\
/sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash\
--skip-tests-runs\
--skip-libcxx-tests\
2>&1 | tee /sw/gpgpu/libcudacxx/build/build_lit_sm6x.log

# Build tests for sm7x if requested.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx\
&& LIBCUDACXX_COMPUTE_ARCHS="70 72 75"\
LIBCUDACXX_SKIP_BASE_TESTS_BUILD=$LIBCUDACXX_SKIP_BASE_TESTS_BUILD\
/sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash\
--skip-tests-runs\
--skip-libcxx-tests\
2>&1 | tee /sw/gpgpu/libcudacxx/build/build_lit_sm7x.log

# Build tests for sm8x if requested.
RUN set -o pipefail; cd /sw/gpgpu/libcudacxx\
&& LIBCUDACXX_COMPUTE_ARCHS="80"\
LIBCUDACXX_SKIP_BASE_TESTS_BUILD=$LIBCUDACXX_SKIP_BASE_TESTS_BUILD\
/sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash\
--skip-tests-runs\
--skip-libcxx-tests\
2>&1 | tee /sw/gpgpu/libcudacxx/build/build_lit_sm8x.log

# Package the logs up, because `docker container cp` doesn't support wildcards,
# and I want to limit the number of places we have to make changes when we ship
# new architectures.
RUN cd /sw/gpgpu/libcudacxx/build && tar -cvf logs.tar *.log

WORKDIR /sw/gpgpu/libcudacxx

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Dockerfile for libcudacxx:host_x86_64_fedora_32__target_x86_64_fedora_32__gcc_10_cxx_14

FROM libcudacxx_base:host_x86_64_fedora_32__target_x86_64_fedora_32__gcc_10_cxx_14

MAINTAINER Bryce Adelstein Lelbach <blelbach@nvidia.com>

###############################################################################
# BUILD: The following is invoked when the CUDA driver is attached.

# We use ADD here because it invalidates the cache for subsequent steps, which
# is what we want, as we need to rebuild if the sources have changed.

ADD nvidia-modprobe /usr/bin/
# Restore setuid.
RUN chmod +s /usr/bin/nvidia-modprobe

ADD libcuda.so* /usr/lib64/
ADD libnvidia-ptxjitcompiler.so* /usr/lib64/

###############################################################################
# CMD: The following is invoked when the image is run.

RUN useradd -ms /bin/bash libcudacxx && chown -R libcudacxx:libcudacxx /sw
USER libcudacxx

WORKDIR /sw/gpgpu/libcudacxx

CMD /sw/gpgpu/libcudacxx/utils/nvidia/linux/perform_tests.bash --skip-libcxx-tests

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/bash

HOST_ARCH=x86_64
HOST_OS_KIND=fedora
HOST_OS_VERSION=32
TARGET_ARCH=x86_64
TARGET_OS_KIND=fedora
TARGET_OS_VERSION=32
COMPILER_KIND=gcc
COMPILER_VERSION=10
COMPILER_CXX_DIALECT=14
Loading

0 comments on commit 6458f50

Please sign in to comment.