Cannot find CUB include files when building from source

I’m trying to build pytorch on Arch Linux with OpenBLAS. I’m encountering errors about NVCC not being able to find the CUB include files:

[3861/5000] Building NVCC (Device) object caffe2/CMakeFiles/torch_cuda.dir/operators/torch_cuda_generated_affine_channel_op.cu.o
FAILED: caffe2/CMakeFiles/torch_cuda.dir/operators/torch_cuda_generated_affine_channel_op.cu.o 
cd /home/richard/workspace/third_party/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/operators && /usr/bin/cmake -E make_directory /home/richard/workspace/third_party/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/operators/. && /usr/bin/cmake -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=/home/richard/workspace/third_party/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/operators/./torch_cuda_generated_affine_channel_op.cu.o -D generated_cubin_file:STRING=/home/richard/workspace/third_party/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/operators/./torch_cuda_generated_affine_channel_op.cu.o.cubin.txt -P /home/richard/workspace/third_party/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/operators/torch_cuda_generated_affine_channel_op.cu.o.Release.cmake
/home/richard/workspace/third_party/pytorch/caffe2/operators/affine_channel_op.cu:3:10: fatal error: cub/block/block_reduce.cuh: No such file or directory
 #include <cub/block/block_reduce.cuh>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMake Error at torch_cuda_generated_affine_channel_op.cu.o.Release.cmake:221 (message):
  Error generating
  /home/richard/workspace/third_party/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/operators/./torch_cuda_generated_affine_channel_op.cu.o

And more errors of this sort from the build/caffe2/CMakeFiles/torch_cuda.dir/operators directory. This occurs both on master and on 1.6.0. I can see the needed file is present at third_party/cub/cub/block/block_reduce.cuh. My build command is:

CUDA_HOME=/opt/cuda-10.1 CC=/usr/bin/gcc-8 CXX=$(which c++-8)  CMAKE_PREFIX_PATH=~/.local/lib/python3.8 BLAS=OpenBLAS python setup.py build