Open GeneralJing opened 2 years ago
Alternatively, if you don't want to install clang-tidy you can do the following:
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug ../dogm
make
[ 4%] Built target gtest [ 23%] Built target simulator [ 27%] Built target gmock [ 31%] Built target gtest_main [ 46%] Built target utils [ 57%] Built target simulator_spec [ 57%] Built target gmock_main [ 63%] Built target utils_spec [ 87%] Built target dogm [ 93%] Built target dogm_spec [100%] Built target demo Skipping /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp. Compile command not found. Skipping /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/build/CMakeFiles/3.10.2/CompilerIdCUDA/tmp/CMakeCUDACompilerId.cudafe1.cpp. Compile command not found. 5940 warnings and 20 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/test/dogm_spec.cpp. 31766 warnings and 20 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/main.cpp. 36423 warnings and 20 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/framebuffer.cpp. 45791 warnings and 20 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/renderer.cpp. 50448 warnings and 20 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/texture.cpp. 56254 warnings and 20 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/shader.cpp. 62193 warnings and 20 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/polygon.cpp. 67612 warnings and 20 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/simulator.cpp. 71865 warnings and 40 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/test/simulator_spec.cpp. 93407 warnings and 40 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/image_creation.cpp. 104787 warnings and 40 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/precision_evaluator.cpp. 110057 warnings and 40 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/metrics.cpp. 129091 warnings and 40 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/color_wheel_adder.cpp. 129333 warnings and 60 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/test/timer_spec.cpp. 136410 warnings and 60 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/dbscan.cpp. 141978 warnings and 60 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/timer.cpp. Skipping /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/build-14/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp. Compile command not found. Skipping /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/build-14/CMakeFiles/3.10.2/CompilerIdCUDA/tmp/CMakeCUDACompilerId.cudafe1.cpp. Compile command not found. error: too many errors emitted, stopping now [clang-diagnostic-error] /home/xxx/Desktop/xxx/dynamic-occupancy-grid-map/build/googletest-src/googletest/include/gtest/gtest.h:1:1: error: source file is not valid UTF-8 [clang-diagnostic-error]
after install clang-tidy, execute .sh file i got more errors.
To me it seems as if your compiler is not correctly set
compiler? what's the correct set? can you give me some tips?
i run the .sh file in docker container.
Is gcc and g++ installed?
yes. here is the version info. (base) root@156f417d667f:/# gcc --version gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(base) root@156f417d667f:/# g++ --version g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
My bad not gcc, is the CUDA toolkit installed?
i use this docker env to train my deep learning models, so I skipped the cuda env checking steps. in the container, i can use nvidia-smi, but not nvcc -V. in my sys path, there is the folder /usr/local/cuda---->/usr/local/cuda10.2. did this satisfied the conditions?
but not nvcc -V
That seems to be the issue, the CUDA compiler is not there. Maybe this helps: https://forums.developer.nvidia.com/t/nvcc-version-returns-nothing-despite-correct-install/146557
thank you, i will try that.
i add the env variables in the .bashrc file, and now nvcc -V can print the normal info.Then i re-execute the .sh file, got the same question. nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2019 NVIDIA Corporation Built on Wed_Oct_23_19:24:38_PDT_2019 Cuda compilation tools, release 10.2, V10.2.89 when i use the command 'nvidia-smi -q | grep CUDA' in the readme, i get these output: CUDA Version : 11.2 should i adjust the cuda version according to the output?
even i install the 11.2 cuda version, it's still the same question. below that, there are a lot of these errors: /usr/local/cuda/targets/x86_64-linux/include/cuda_runtime.h:1:1: error: source file is not valid UTF-8 [clang-diagnostic-error]
In our CI workflow, you see the exact setup steps that are required to get a bare ubuntu 18.04 docker to compile this code. Do you see a difference to your setup?
the last two steps, i didn't execute the related commands. i don't know if this is the reason. i will try that tomorrow on my computer. thanks for the advice.
Right, the last two steps are only static code analysis, nothing you need to run.
can you provide a dockerfile that i can reproduce the env? or a docker image that i can docker pull from the docker hub?
I have never used Docker, so I can't relly help much with that.
I'm throwing a file together ad-hoc here from our setup instructions and CI, no guarantees for anything 😉
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libopencv-dev \
libglfw3-dev \
libglew-dev \
libglm-dev \
nvidia-cuda-toolkit
This should be enough to build the project. To execute our code, you'll need to also setup a CUDA runtime as described in the README inside this container.
i'm stuck in this question for a few days. thank you for your kind advice. i will try that today. If I have any new information, I will reply here.
Scanning dependencies of target dogm_spec Scanning dependencies of target demo [ 91%] Building CXX object test/CMakeFiles/dogm_spec.dir/dogm_spec.cpp.o [ 91%] Building CXX object demo/CMakeFiles/demo.dir/main.cpp.o [ 93%] Linking CUDA device code CMakeFiles/dogm_spec.dir/cmake_device_link.o [ 95%] Linking CXX executable dogm_spec [ 95%] Built target dogm_spec [ 97%] Linking CUDA device code CMakeFiles/demo.dir/cmake_device_link.o [100%] Linking CXX executable demo [100%] Built target demo Skipping /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp. Compile command not found. Skipping /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/build/CMakeFiles/3.10.2/CompilerIdCUDA/tmp/CMakeCUDACompilerId.cudafe1.cpp. Compile command not found. 371 warnings and 20 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/test/dogm_spec.cpp. 1671 warnings and 40 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/main.cpp. 4265 warnings and 60 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/framebuffer.cpp. 7227 warnings and 80 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/renderer.cpp. 9821 warnings and 100 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/texture.cpp. 15627 warnings and 100 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/shader.cpp. 21566 warnings and 100 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/mapping/opengl/polygon.cpp. 26985 warnings and 100 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/simulator.cpp. 31238 warnings and 120 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/simulator/test/simulator_spec.cpp. 32866 warnings and 140 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/image_creation.cpp. 41062 warnings and 160 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/precision_evaluator.cpp. 46332 warnings and 160 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/metrics.cpp. 63943 warnings and 160 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/color_wheel_adder.cpp. 64185 warnings and 180 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/test/timer_spec.cpp. 65348 warnings and 200 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/dbscan.cpp. 70916 warnings and 200 errors generated. Error while processing /home/xxx/Desktop/jzy/dynamic-occupancy-grid-map/dogm/demo/utils/timer.cpp. error: too many errors emitted, stopping now [clang-diagnostic-error] /usr/local/cuda/targets/x86_64-linux/include/cuda_runtime.h:1:1: error: source file is not valid UTF-8 [clang-diagnostic-error]
<87>}F<9E>
Can you try installing clang-tidy using
apt install clang-tidy
?