Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GeneralJing opened this issue Dec 2, 2021 · 30 comments
Open

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

GeneralJing opened this issue Dec 2, 2021 · 30 comments

Comments

@GeneralJing
Copy link

No description provided.

@TheCodez
Copy link
Owner

TheCodez commented Dec 2, 2021

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

@TheCodez
Copy link
Owner

TheCodez commented Dec 2, 2021

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
Copy link
Author

GeneralJing commented Dec 2, 2021

[ 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
Copy link
Author

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

@TheCodez
Copy link
Owner

TheCodez commented Dec 2, 2021

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

@GeneralJing
Copy link
Author

GeneralJing commented Dec 2, 2021

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

@GeneralJing
Copy link
Author

i run the .sh file in docker container.

@TheCodez
Copy link
Owner

TheCodez commented Dec 2, 2021

Is gcc and g++ installed?

@GeneralJing
Copy link
Author

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
Copy link
Owner

TheCodez commented Dec 2, 2021

My bad not gcc, is the CUDA toolkit installed?

@GeneralJing
Copy link
Author

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
Copy link
Owner

TheCodez commented Dec 2, 2021

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
Copy link
Author

thank you, i will try that.

@GeneralJing
Copy link
Author

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
Copy link
Author

GeneralJing commented Dec 3, 2021

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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

@GeneralJing
Copy link
Author

GeneralJing commented Dec 6, 2021

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
Copy link
Owner

TheCodez commented Dec 6, 2021

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

@cbachhuber
Copy link
Contributor

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
Copy link
Author

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
Copy link
Author

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>0<U+0014>m<98>rY<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><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<U+0016><U+0006>Z<85>ӥ<U+0005>x<U+0001>sn_<U+001F>,

still the same question……

@cbachhuber
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

GeneralJing commented Dec 15, 2021

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants