dynamic-occupancy-grid-map icon indicating copy to clipboard operation
dynamic-occupancy-grid-map copied to clipboard

xargs: clang-tidy: No such file or directory

Open GeneralJing opened this issue 2 years ago • 30 comments

GeneralJing avatar Dec 02 '21 08:12 GeneralJing

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

TheCodez avatar Dec 02 '21 09:12 TheCodez

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

TheCodez avatar Dec 02 '21 09:12 TheCodez

[ 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 avatar Dec 02 '21 09:12 GeneralJing

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

GeneralJing avatar Dec 02 '21 09:12 GeneralJing

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

TheCodez avatar Dec 02 '21 10:12 TheCodez

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

GeneralJing avatar Dec 02 '21 10:12 GeneralJing

i run the .sh file in docker container.

GeneralJing avatar Dec 02 '21 10:12 GeneralJing

Is gcc and g++ installed?

TheCodez avatar Dec 02 '21 10:12 TheCodez

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.

GeneralJing avatar Dec 02 '21 10:12 GeneralJing

My bad not gcc, is the CUDA toolkit installed?

TheCodez avatar Dec 02 '21 10:12 TheCodez

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?

GeneralJing avatar Dec 02 '21 10:12 GeneralJing

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

TheCodez avatar Dec 02 '21 10:12 TheCodez

thank you, i will try that.

GeneralJing avatar Dec 02 '21 10:12 GeneralJing

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 avatar Dec 03 '21 02:12 GeneralJing

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]

GeneralJing avatar Dec 03 '21 06:12 GeneralJing

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?

cbachhuber avatar Dec 05 '21 10:12 cbachhuber

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.

GeneralJing avatar Dec 05 '21 13:12 GeneralJing

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

cbachhuber avatar Dec 05 '21 19:12 cbachhuber

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

GeneralJing avatar Dec 06 '21 02:12 GeneralJing

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

TheCodez avatar Dec 06 '21 18:12 TheCodez

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.

cbachhuber avatar Dec 09 '21 20:12 cbachhuber

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 avatar Dec 10 '21 01:12 GeneralJing

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>}<U+001C>F<9E><U+0005> <U+0000><BC><B1><B0>0<U+0014>m<C2><F2><98>r<B7>Y<U+0000><U+0000><U+0000><U+0000><FE><FF><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>z<U+0000>:yx.<U+0001>&m<EC><U+0016><U+0006>Z<E0><E2><85>ӥ<U+0005>x<U+0001>sn_<B9><U+001F>,

still the same question……

GeneralJing avatar Dec 10 '21 05:12 GeneralJing

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?

cbachhuber avatar Dec 10 '21 20:12 cbachhuber

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"?

GeneralJing avatar Dec 12 '21 11:12 GeneralJing

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.

cbachhuber avatar Dec 12 '21 18:12 cbachhuber

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.

GeneralJing avatar Dec 13 '21 03:12 GeneralJing

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?

cbachhuber avatar Dec 14 '21 17:12 cbachhuber

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

GeneralJing avatar Dec 15 '21 02:12 GeneralJing

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

cbachhuber avatar Dec 27 '21 10:12 cbachhuber