amirstan_plugin icon indicating copy to clipboard operation
amirstan_plugin copied to clipboard

hi, error: identifier "nullptr" is undefined

Open semchan opened this issue 4 years ago • 6 comments

hi, I follow your suggestion to build this firstly, but I got the below errors, would you please help me? maybe the gcc version or something is not correct. thanks a lot.

[ 1%] Building NVCC (Device) object src/amir_cuda_util/CMakeFiles/amir_cuda_util.dir/amir_cuda_util_generated_memcpyPermute.cu.o [ 3%] Building NVCC (Device) object src/amir_cuda_util/CMakeFiles/amir_cuda_util.dir/amir_cuda_util_generated_tensorMeanVar.cu.o [ 4%] Building NVCC (Device) object src/amir_cuda_util/CMakeFiles/amir_cuda_util.dir/amir_cuda_util_generated_repeatDims.cu.o /media/sem/DATA/quantization/amirstan_plugin/include/amir_cuda_util/cuda_util.h(42): error: identifier "nullptr" is undefined

/media/sem/DATA/quantization/amirstan_plugin/include/amir_cuda_util/cuda_util.h(45): error: identifier "nullptr" is undefined

semchan avatar Aug 04 '20 01:08 semchan

Hi, My gcc version is 7.5.0, try update gcc.

grimoire avatar Aug 04 '20 02:08 grimoire

hi, I follow your suggestion to build this firstly, but I got the below errors, would you please help me? maybe the gcc version or something is not correct. thanks a lot.

[ 1%] Building NVCC (Device) object src/amir_cuda_util/CMakeFiles/amir_cuda_util.dir/amir_cuda_util_generated_memcpyPermute.cu.o [ 3%] Building NVCC (Device) object src/amir_cuda_util/CMakeFiles/amir_cuda_util.dir/amir_cuda_util_generated_tensorMeanVar.cu.o [ 4%] Building NVCC (Device) object src/amir_cuda_util/CMakeFiles/amir_cuda_util.dir/amir_cuda_util_generated_repeatDims.cu.o /media/sem/DATA/quantization/amirstan_plugin/include/amir_cuda_util/cuda_util.h(42): error: identifier "nullptr" is undefined

/media/sem/DATA/quantization/amirstan_plugin/include/amir_cuda_util/cuda_util.h(45): error: identifier "nullptr" is undefined

updating gcc version to v7 via command as follow, and then issue will be resolved:

add-apt-repository ppa:jonathonf/gcc-7.1
sudo apt-get update
sudo apt-get install gcc-7 g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7

cefengxu avatar Aug 06 '20 03:08 cefengxu

I add the following line to the CMakeLists.txt on CentOS with gcc 7.5.0

set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11 -D__CORRECT_ISO_CPP11_MATH_H_PROTO")

https://github.com/Theano/Theano/issues/4588#issuecomment-223985745

Check your cmake version,the default version is 2.8, and update to a higher one, such as 3.14.4

svmsunny avatar Dec 09 '20 07:12 svmsunny

@svmsunny thanks for the advice. I will update cmake version later.

grimoire avatar Dec 09 '20 12:12 grimoire

It is bad style to change the compiler version on the system. Use cmake flags instead:

cmake -DTENSORRT_DIR=<trt_dir> -DCMAKE_CXX_COMPILER=/usr/bin/g++-8 -DCMAKE_C_COMPILER=gcc-8  ..

@grimoire I propose to indicate in the readme that the version of the compiler gcc-9 is not supported, which comes with the kernel - 5.4.0-58, and it is necessary to install an additional version of gcc-8

Maxfashko avatar Dec 25 '20 08:12 Maxfashko

@Maxfashko Thanks for the advice. I am not so familiar with linux kernel. Did that means there will be an ABI error when compile the project with gcc-9 ? Will it be fixed when nvidia provide a build of TensorRT for ubuntu20.04 ?

grimoire avatar Dec 25 '20 10:12 grimoire