Error when build pytorch from source

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

[ 69%] Built target gloo
[ 76%] Building NVCC (Device) object gloo/CMakeFiles/gloo_cuda.dir/
[ 76%] Building NVCC (Device) object gloo/CMakeFiles/gloo_cuda.dir/nccl/
[ 80%] Building NVCC (Device) object gloo/CMakeFiles/gloo_cuda.dir/
/local_directory/pytorch/torch/lib/gloo/gloo/nccl/ 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 (message):
  Error generating file

gloo/CMakeFiles/gloo_cuda.dir/build.make:77: recipe for target 'gloo/CMakeFiles/gloo_cuda.dir/nccl/' failed
make[2]: *** [gloo/CMakeFiles/gloo_cuda.dir/nccl/] 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.