Okay so I have a band-aid fix that works for my current set up. It’s ugly but it works. I would not consider this a solution. I still want to know what went wrong with cmake.
After running cmake, I edit CMakeFiles/run_pytorch.dir/build.make and comment out the following lines:
run_pytorch: /usr/lib64/libcuda.so

and
run_pytorch: /usr/local/cuda/lib64/libculibos.a

I have no idea why these lines are included. After this, I edit CMakeFiles/run_pytorch.dir/build.make (which I found by grep-ing for “libculibos”) and remove both /cm/shared/sw/pkg/devel/cudnn/v7.0-cuda-9.0/lib64
and  /usr/local/cuda/lib64/libculibos.a from the line (it is trying to build a directory?), to leave:
/cm/shared/sw/pkg/devel/gcc/8.2.0/bin/c++    -rdynamic CMakeFiles/run_pytorch.dir/run_pytorch_1d.cpp.o  -o run_pytorch -Wl,-rpath,/mnt/ceph/users/mcranmer/Downloads/libtorch/lib -Wl,-Bstatic -lculibos -Wl,-Bdynamic /mnt/ceph/users/mcranmer/Downloads/libtorch/lib/libtorch.so -lcuda -lnvrtc -lnvToolsExt -Wl,-Bstatic -lcudart_static -Wl,-Bdynamic -lpthread -ldl -lrt -Wl,--no-as-needed,/mnt/ceph/users/mcranmer/Downloads/libtorch/lib/libcaffe2.so -Wl,--as-needed -Wl,--no-as-needed,/mnt/ceph/users/mcranmer/Downloads/libtorch/lib/libcaffe2_gpu.so -Wl,--as-needed -Wl,-Bstatic -lcudart_static -Wl,-Bdynamic -ldl -lrt /mnt/ceph/users/mcranmer/Downloads/libtorch/lib/libcaffe2.so /mnt/ceph/users/mcranmer/Downloads/libtorch/lib/libc10.so -lpthread -lcufft /cm/shared/sw/pkg/devel/cuda/9.0.176/lib64/libcurand.so -lcublas -Wl,-Bstatic -lcublas_device -Wl,-Bdynamic 

Running “make” works, and I can execute the pytorch executable without problems. Note that I am not using CUDA so linking problems with CUDA libraries won’t show up for me.
Does anybody know what I am doing wrong, and why I have to manually edit the cmake output?