Error when compiling pytorch v1.3.0 from source

I tried to build pytorch v1.3.0 from source with CUDA10.1. But when I run python setup.py install, an error occurred:

[3121/3304] Linking CXX executable bin/utility_ops_test
FAILED: bin/utility_ops_test 
: && /usr/bin/c++ -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-mis$
ing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-fu$
ction -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-error=pedantic -Wno-error=redundant-decls -Wno-$
rror=old-style-cast -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -DHAVE_AVX_CPU_DEFINITION -DHAVE_AVX2_CPU_DEF$
NITION -O3 -rdynamic -Wl,-rpath -Wl,/usr/local/lib -Wl,--enable-new-dtags -pthread caffe2/CMakeFiles/utility_ops_test.dir/operators/utility_ops_test.cc.o $
o bin/utility_ops_test  -Wl,-rpath,/home/CORP.PKUSC.ORG/flyingpig/anaconda3/envs/pipeswitch/lib:/opt/intel/lib/intel64:/home/CORP.PKUSC.ORG/flyingpig/pyto$
ch/build/lib:/usr/local/cuda-10.1/lib64:  lib/libgtest_main.a  -Wl,--no-as-needed,/home/CORP.PKUSC.ORG/flyingpig/pytorch/build/lib/libtorch.so -Wl,--as-ne$
ded  lib/libprotobuf.a  /home/CORP.PKUSC.ORG/flyingpig/anaconda3/envs/pipeswitch/lib/libmkl_intel_lp64.so  /home/CORP.PKUSC.ORG/flyingpig/anaconda3/envs/p$
peswitch/lib/libmkl_gnu_thread.so  /home/CORP.PKUSC.ORG/flyingpig/anaconda3/envs/pipeswitch/lib/libmkl_core.so  -fopenmp  -lpthread  /usr/lib64/libm.so  /$
sr/lib64/libdl.so  /opt/intel/lib/intel64/libirc.so  lib/libmkldnn.a  lib/libc10_cuda.so  lib/libc10.so  /usr/local/cuda-10.1/lib64/libnvToolsExt.so  /usr$
local/cuda-10.1/lib64/libcudart.so  /usr/local/cuda-10.1/lib64/libcufft.so  /usr/local/cuda-10.1/lib64/libcurand.so  /usr/local/cuda-10.1/lib64/libcudnn.so
  /usr/lib64/libcublas.so  lib/libgtest.a  -lpthread && :
/home/CORP.PKUSC.ORG/flyingpig/pytorch/build/lib/libtorch.so:对‘cudaSetupArgument’未定义的引用
/home/CORP.PKUSC.ORG/flyingpig/pytorch/build/lib/libtorch.so:对‘cudaConfigureCall’未定义的引用
/home/CORP.PKUSC.ORG/flyingpig/pytorch/build/lib/libtorch.so:对‘cudaLaunch’未定义的引用
collect2: 错误:ld 返回 1

I tried to run python setup.py clean then rerun python setup.py install, but the error still occurred.