Paddle Linux本地编译出错:Cmake将警告当作错误处理

ppcbkaq5  于 5个月前  发布在  Linux
关注(0)|答案(6)|浏览(116)

问题描述 Issue Description

Linux本地编译出错,CMakeError.log显示问题是,在编译一段C文件的测试代码,使用了C++的编译选项导致警告,而cmake将警告当作错误处理导致编译中断。我尝试在cmakelist.txt中屏蔽该指令但是没有用。

我参考的构建文档

Performing C SOURCE FILE Test C_COMPILER_SUPPORT_FLAG__Wnon_virtual_dtor failed with the following output:
Change Dir: /home/lyq/Data/projects/PaddleTasks/Paddle/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_2fe10/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_2fe10.dir/build.make CMakeFiles/cmTC_2fe10.dir/build
gmake[1]: Entering directory '/home/lyq/Data/projects/PaddleTasks/Paddle/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2fe10.dir/src.c.o
/usr/bin/cc -DC_COMPILER_SUPPORT_FLAG__Wnon_virtual_dtor  -fPIC -fno-omit-frame-pointer -Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-error=array-bounds -Wno-error=ignored-attributes -Wno-error=int-in-bool-context -Wimplicit-fallthrough=0 -Wno-ignored-qualifiers -Wno-ignored-attributes -Wno-parentheses    -Wnon-virtual-dtor -o CMakeFiles/cmTC_2fe10.dir/src.c.o -c /home/lyq/Data/projects/PaddleTasks/Paddle/build/CMakeFiles/CMakeTmp/src.c
cc1: error: command line option '-Wnon-virtual-dtor' is valid for C++/ObjC++ but not for C [-Werror]
cc1: all warnings being treated as errors
gmake[1]: *** [CMakeFiles/cmTC_2fe10.dir/build.make:78: CMakeFiles/cmTC_2fe10.dir/src.c.o] Error 1
gmake[1]: Leaving directory '/home/lyq/Data/projects/PaddleTasks/Paddle/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_2fe10/fast] Error 2

Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test C_COMPILER_SUPPORT_FLAG__Wdelete_non_virtual_dtor failed with the following output:
Change Dir: /home/lyq/Data/projects/PaddleTasks/Paddle/build/CMakeFiles/CMakeTmp

注意到 #issue54008 报告相同的问题,但是并没有解决此问题就关闭了。

另外一个和编译无关的小问题,脚本 summary_env.py 无法检测出cuDNN的信息,但是我在安装好的环境里通过 paddle.utils.run_check() 里可以查询到

版本&环境信息 Version & Environment Information

Paddle version: N/A
Paddle With CUDA: N/A

OS: ubuntu 22.04
GCC version: (GCC) 8.2.0
Clang version: N/A
CMake version: version 3.22.1
Libc version: glibc 2.35
Python version: 3.8.17

CUDA version: 11.7.99
Build cuda_11.7.r11.7/compiler.31442593_0
cuDNN version: N/A
Nvidia driver version: 525.125.06
Nvidia driver List:
GPU 0: NVIDIA GeForce RTX 3080 Laptop GPU

gzszwxb4

gzszwxb41#

方便提供一下您使用的编译指令么?

i86rm4rw

i86rm4rw2#

time cmake .. -DPYTHON_EXECUTABLE:FILEPATH=/home/lyq/anaconda3/envs/pad-dev/bin/python3.8 -DPYTHON_INCLUDE_DIR:PATH=/home/lyq/anaconda3/envs/pad-dev/include/python3.8 -DPYTHON_LIBRARY:FILEPATH=/home/lyq/anaconda3/envs/pad-dev/lib/libpython3.so -DWITH_GPU=ON

dsf9zpds

dsf9zpds3#

我联系下编译的相关同学来看下这个问题~

2w2cym1i

2w2cym1i4#

您好,我遇到了相同的问题,请问您解决了吗?

a2mppw5e

a2mppw5e5#

我遇到了一样的问题,请问有解决么?

2ul0zpep

2ul0zpep6#

这个问题有后续解决吗,我是ubuntu22,有关系吗

相关问题