我试图使用TBB而不是OpenMP从源代码构建PyTorch,但每次都会出现以下错误:
/usr/bin/ld: <PATH>/pytorch/build/lib/libtorch_cpu.so: undefined reference to `omp_get_max_threads'
/usr/bin/ld: <PATH>/pytorch/build/lib/libtorch_cpu.so: undefined reference to `omp_get_num_threads'
/usr/bin/ld: <PATH>/pytorch/build/lib/libtorch_cpu.so: undefined reference to `GOMP_barrier'
/usr/bin/ld: <PATH>/pytorch/build/lib/libtorch_cpu.so: undefined reference to `GOMP_parallel'
/usr/bin/ld: <PATH>/pytorch/build/lib/libtorch_cpu.so: undefined reference to `omp_in_parallel'
/usr/bin/ld: <PATH>/pytorch/build/lib/libtorch_cpu.so: undefined reference to `omp_get_thread_num'
collect2: error: ld returned 1 exit status
make[2]: *** [caffe2/CMakeFiles/kernel_function_legacy_test.dir/build.make:109: bin/kernel_function_legacy_test] Error 1
您可以找到完整的日志文件HERE:
复制行为的步骤:
git clone https://github.com/pytorch/pytorch
cd pytorch
ATEN_THREADING=TBB BUILD_BINARY=1 USE_EIGEN_THREADPOOL=1 USE_CUDA=0 PARALLEL_BACKEND=NATIVE_TBB USE_OPENMP=0 USE_TBB=1 MKL_THREADING=TBB BLAS=MKL USE_MKLDNN=1 MKLDNN_THREADING=TBB BUILD_BINARY=1 python setup.py build --cmake 2>&1 | tee ~/output.txt
conda
,pip
,源代码):pip
似乎Caffe2 CMake文件存在问题。 您是否尝试过将CMake更新到最新版本。
在github上也可以找到类似的问题。通过升级cmake解决了问题
https://github.com/pytorch/pytorch/issues/8370
相关问题 更多 >
编程相关推荐