tar -zxvf protobuf-all-3.12.3.tar.gz # 更改安装路径 cd protobuf-3.12.3/ ./autogen.sh ./configure --prefix=/data2/zhaodali/software/protobuf make -j 12 make check make install
tar xvf cmake-3.17.1.tar.gz cd cmake-3.17.1 ./bootstrap --prefix=/data2/zhaodali/software/cmake3171 make -j 12 make install # 设置环境变量 vim ~/.bash_profile export PATH=/data2/zhaodali/software/cmake3171/bin:$PATH source ~/.bash_profile # 验证 cmake --version
然后这个时候,重新回到onnx-tensorrt/build,执行如下操作:
1 2 3 4 5
cd onnx-tensorrt/build rm -r * cmake .. -DTENSORRT_ROOT=/data2/zhaodali/software/TensorRT-7.0.0.11 -DGPU_ARCHS="61" -DCMAKE_PREFIX_PATH=/data2/zhaodali/software/protobuf make -j 12 make install
这个时候又报错了,提示:
1 2 3 4 5 6 7
CMake Error at cmake_install.cmake:47 (file): file INSTALL cannot copy file "/data2/zhaodali/software/onnx-tensorrt/build/onnx2trt" to "/usr/local/bin/onnx2trt": Success.
make: *** [install] Error 1
这是因为我们没有sudo权限的问题,所以执行如下操作:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
cd onnx-tensorrt/build rm -r * # -DCMAKE_INSTALL_PREFIX设置安装路径 # -DCMAKE_PREFIX_PATH可以设置库的路径 cmake .. -DTENSORRT_ROOT=/data2/zhaodali/software/TensorRT-7.0.0.11 -DGPU_ARCHS="61" -DCMAKE_PREFIX_PATH=/data2/zhaodali/software/protobuf -DCMAKE_INSTALL_PREFIX=/data2/zhaodali/software/onnx-trt make -j 12 make install