Error when build pytorch from source

I want to upgrade to v0.2 from source with python setup.py install --user, but I got some error,

[ 69%] Built target gloo
[ 76%] Building NVCC (Device) object gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda.cu.o
[ 76%] Building NVCC (Device) object gloo/CMakeFiles/gloo_cuda.dir/nccl/gloo_cuda_generated_nccl.cu.o
[ 80%] Building NVCC (Device) object gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda_private.cu.o
/local_directory/pytorch/torch/lib/gloo/gloo/nccl/nccl.cu(36): error: argument of type "const int *" is incompatible with parameter of type "int *"

1 error detected in the compilation of "/tmp/tmpxft_0000360c_00000000-17_nccl.compute_61.cpp1.ii".
CMake Error at gloo_cuda_generated_nccl.cu.o.cmake:263 (message):
  Error generating file
  /local_directory/pytorch/torch/lib/build/gloo/gloo/CMakeFiles/gloo_cuda.dir/nccl/./gloo_cuda_generated_nccl.cu.o


gloo/CMakeFiles/gloo_cuda.dir/build.make:77: recipe for target 'gloo/CMakeFiles/gloo_cuda.dir/nccl/gloo_cuda_generated_nccl.cu.o' failed
make[2]: *** [gloo/CMakeFiles/gloo_cuda.dir/nccl/gloo_cuda_generated_nccl.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:138: recipe for target 'gloo/CMakeFiles/gloo_cuda.dir/all' failed
make[1]: *** [gloo/CMakeFiles/gloo_cuda.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Does any one have any idea about this? Thanks a lot.