TheCodez / dynamic-occupancy-grid-map

Implementation of "A Random Finite Set Approach for Dynamic Occupancy Grid Maps with Real-Time Application"
MIT License
281 stars 39 forks source link

xargs: clang-tidy: No such file or directory #84

Open GeneralJing opened 2 years ago

TheCodez commented 2 years ago

Can you try installing clang-tidy using apt install clang-tidy?

TheCodez commented 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
GeneralJing commented 2 years ago

[ 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]

GeneralJing commented 2 years ago

after install clang-tidy, execute .sh file i got more errors.

TheCodez commented 2 years ago

To me it seems as if your compiler is not correctly set

GeneralJing commented 2 years ago

compiler? what's the correct set? can you give me some tips?

GeneralJing commented 2 years ago

i run the .sh file in docker container.

TheCodez commented 2 years ago

Is gcc and g++ installed?

GeneralJing commented 2 years ago

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.

TheCodez commented 2 years ago

My bad not gcc, is the CUDA toolkit installed?

GeneralJing commented 2 years ago

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?

TheCodez commented 2 years ago

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

GeneralJing commented 2 years ago

thank you, i will try that.

GeneralJing commented 2 years ago

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?

GeneralJing commented 2 years ago

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]

cbachhuber commented 2 years ago

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?

GeneralJing commented 2 years ago

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.

cbachhuber commented 2 years ago

Right, the last two steps are only static code analysis, nothing you need to run.

GeneralJing commented 2 years ago

can you provide a dockerfile that i can reproduce the env? or a docker image that i can docker pull from the docker hub?

TheCodez commented 2 years ago

I have never used Docker, so I can't relly help much with that.

cbachhuber commented 2 years ago

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.

GeneralJing commented 2 years ago

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.

GeneralJing commented 2 years ago

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> 0m<98>rYz:yx.&mZ<85>ӥxsn_, still the same question……
cbachhuber commented 2 years ago

I just tried to reproduce your problem on a pretty fresh Ubuntu 18.04 install, I can't. I did this:

sudo apt install libopencv-dev
sudo apt install libglfw3-dev libglew-dev libglm-dev
sudo apt install nvidia-cuda-toolkit
export PATH=/usr/local/cuda/bin:$PATH
cd dynamic-occupancy-grid-map/dogm
mkdir build
cd build
cmake ..
make -j

This builds successfully. What commands are you trying?

GeneralJing commented 2 years ago

the difference i think is the installation of cuda. i use the installation commands on the nvidia website. I'm not sure what's the difference between the two installation methods. because i cannot connect to my remote computer, i will try your method tomorrow. another question. i use the .local_pipeline_ubuntu.sh according to the readme file to compile the project. is it the same function as "cd build; cmake ..; make -j"?

cbachhuber commented 2 years ago

local_pipeline_ubuntu.sh does more than I did above: it also formats and lints code. Please just try the commands I wrote above, these are sufficient to build.

GeneralJing commented 2 years ago

use this command, i can build the project smoothly. but when i execute the build/demo/demo file, it occurs segmentation fault(core dumped). another question, how to use the local_pipeline_ubuntu.sh file? in the readme file, you just mentioned this file.

cbachhuber commented 2 years ago

What is the error message just before the segfault? I guess there's a version mismatch between the CUDA versions with which you compile and with which you run.

another question, how to use the local_pipeline_ubuntu.sh file? in the readme file, you just mentioned this file.

Just execute it with ./local_pipeline_ubuntu.sh. It's an executable shell script. But why would you want that, now that you can build?

GeneralJing commented 2 years ago

it occurs like this: root@832ede5b5bd8:/home/xxxDesktop/jzy/dynamic-occupancy-grid-map/dogm/build# ./demo/demo Segmentation fault (core dumped) No more information output。 How can I verify whether it is caused by different CUDA versions? drwxr-xr-x 2 root root 4.0K Sep 30 12:32 bin lrwxrwxrwx 1 root root 21 Dec 10 02:36 cuda -> /usr/local/cuda-11.2/ drwxr-xr-x 17 root root 4.0K Dec 10 02:37 cuda-11.2 drwxr-xr-x 2 root root 4.0K Sep 30 12:32 etc drwxr-xr-x 2 root root 4.0K Sep 30 12:32 games drwxr-xr-x 2 root root 4.0K Sep 30 12:32 include drwxr-xr-x 1 root root 4.0K Dec 10 03:02 lib lrwxrwxrwx 1 root root 9 Sep 30 12:32 man -> share/man drwxr-xr-x 2 root root 4.0K Sep 30 12:33 sbin drwxr-xr-x 1 root root 4.0K Dec 10 02:59 share drwxr-xr-x 2 root root 4.0K Sep 30 12:32 src

cbachhuber commented 2 years ago

To determine your installed cuda and nvcc version, what is the output of these commands?

nvcc --version
cat /usr/local/cuda/version.txt
ls -l /usr/local | grep cuda