458 Star 2.5K Fork 566

OpenHarmony / docs

[编译报错]fatal error: 'vdpau/vdpau.h' file not found

Bug
Done
kabirz  Opened this issue

./build.py ipcamera_hi3516dv300
一直是这个错了:

In file included from libavcodec/vdpau.c:31:
libavcodec/vdpau.h:52:10: fatal error: 'vdpau/vdpau.h' file not found
#include <vdpau/vdpau.h>
^~~~~~~~~~~~~~~
1 error generated.
CC libavutil/bprint.o
make[1]: *** [ffbuild/common.mak:60: libavcodec/vdpau.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/kabirz/hm/vendor/hisi/hi35xx/middleware/source/third_party/ffmpeg/ffmpeg-y'
make: *** [Makefile:41: ffmpeg-y] Error 2
Traceback (most recent call last):
File "../../build/lite/build_ext_components.py", line 64, in
sys.exit(main())
File "../../build/lite/build_ext_components.py", line 58, in main

Attachments
total 5 participants

Comments (12)

kabirz 2020-09-12 18:16

我用的是archlinux, 进入到vendor/hisi/hi35xx/middleware/source/third_party/ffmpeg/ffmpeg-y

hm/vendor/hisi/hi35xx/middleware/source/third_party/ffmpeg/ffmpeg-y (7da453973f●)
$ make V=1
sed 's/MAJOR/58/' libavformat/libavformat.v | cat > libavformat/libavformat.ver
/home/kabirz/llvm/bin/../bin/clang -I. -I./ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DHAVE_AV_CONFIG_H -DBUILDING_avcodec -mfloat-abi=softfp -mfpu=neon-vfpv4 -fPIC -fstack-protector-all -s -ftrapv -mcpu=cortex-a7 -std=c11 -fomit-frame-pointer -fPIC -marm -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -Wno-unused-const-variable -Wno-char-subscripts -Oz -fno-math-errno -fno-signed-zeros -mstack-alignment=16 -Qunused-arguments -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -I/lib/cxxstl/gccinclude --target=arm-liteos --sysroot=../../../../../../../../prebuilts/lite/sysroot -Wno-deprecated-declarations -Wno-incompatible-pointer-types-discards-qualifiers -Wno-string-plus-int -Wno-absolute-value -Wno-format -Wno-invalid-source-encoding -Wno-missing-prototypes -MMD -MF libavcodec/vdpau.d -MT libavcodec/vdpau.o -c -o libavcodec/vdpau.o libavcodec/vdpau.c
In file included from libavcodec/vdpau.c:31:
libavcodec/vdpau.h:52:10: fatal error: 'vdpau/vdpau.h' file not found
#include <vdpau/vdpau.h>
^~~~~~~~~~~~~~~
1 error generated.
make: *** [ffbuild/common.mak:60: libavcodec/vdpau.o] Error 1

Xingwa 2020-09-12 22:28

vendor/hisi/hi35xx/middleware/source/third_party/ffmpeg 使用的是三方软件自身的automake,这里在configure的时候会自动根据环境打开一些配置,比如vdpau, 而这些依赖在编译harmonyos的时候是没有的。

我的临时建议是显示的关掉这个自动侦测的选项,参考修改在这里

https://gitee.com/openharmony/vendor_hisi_hi35xx_middleware_source_third_party_ffmpeg/commit/b48b9575ae01f3bd9b79a0d65f50d68668234285

最终的方案我会同步一个issue给ffmpeg的owner

Xingwa 2020-09-12 22:43

vendor/hisi/hi35xx/middleware/source/third_party/ffmpeg 使用的是三方软件自身的automake,这里在configure的时候会自动根据环境打开一些配置,比如vdpau, 而这些依赖在编译harmonyos的时候是没有的。

我的临时建议是显示的关掉这个自动侦测的选项,参考修改在这里

https://gitee.com/openharmony/vendor_hisi_hi35xx_middleware_source_third_party_ffmpeg/commit/b48b9575ae01f3bd9b79a0d65f50d68668234285

最终的方案我会同步一个issue给ffmpeg的owner

已经同步issue

#I1UX83:ffmpeg 在部分环境上编译失败

kabirz 2020-09-13 11:59

disable_decoder_config.sh这样改编译通过:

-- a/disable_decoder_config.sh
+++ b/disable_decoder_config.sh
@@ -47,6 +47,8 @@ configure_attr=" --prefix=./install \
     --enable-bsf=h264_mp4toannexb \
     --enable-bsf=hevc_mp4toannexb \
     --disable-pixelutils \
+    --disable-vdpau \
+    --disable-xlib \
     --enable-demuxer=wav \
     --disable-gpl \
     --disable-zlib \

这两个只在host安装不应该影响交叉编译吧, configure要指定host吧.

Xingwa 2020-09-13 13:08

@kabirz 非常好
是这个configure问题,我们会先请ffmpeg同学清理一下自动侦测的config,后续考虑移植到GN编译。

Dayananda V 2020-09-13 14:03

@Xingwa

Please make sure the below problem also will be resolved while GN compilation reconsideration period.

libavutil/log.cCC libavutil/md5.o
:49:10: fatal error: 'valgrind/valgrind.h' file not found
#include <valgrind/valgrind.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
ffbuild/common.mak:60: recipe for target 'libavutil/log.o' failed
make[1]: *** [libavutil/log.o] Error 1
make[1]: *** Waiting for unfinished jobs....
CC libavutil/mem.o
make[1]: Leaving directory '/media/default/3641821b-2ecd-4f0a-81c0-d52a5412c894/work/work_hos/work_hos_1_0/vendor/hisi/hi35xx/middleware/source/third_party/ffmpeg/ffmpeg-y'
Makefile:39: recipe for target 'ffmpeg-y' failed
make: *** [ffmpeg-y] Error 2
Traceback (most recent call last):
File "../../build/lite/build_ext_components.py", line 64, in
sys.exit(main())
File "../../build/lite/build_ext_components.py", line 58, in main
cmd_exec(args.command)
File "../../build/lite/build_ext_components.py", line 32, in cmd_exec
raise Exception("{} failed, return code is {}".format(cmd, ret_code))
Exception: ['./build.sh', '/media/default/3641821b-2ecd-4f0a-81c0-d52a5412c894/work/work_hos/work_hos_1_0/out/ipcamera_hi3516dv300', 'hi3516dv300', 'liteos_a', 'clang', '/home/default/llvm/bin/..'] failed, return code is 2

Note :
valgrind-3.13.0 version available in system but still issue is reported. Thanks in advance.

Xingwa 2020-09-13 14:37

@Dayananda V
Could you also try to add --disable-valgrind-backtrace in the disable_decoder_config.sh

Currently the confiure script detect some feautre from host but no avalivable on target platfrom. It is common issue.

Dayananda V 2020-09-14 01:05

@Xingwa

adding --disable-valgrind-backtrace in disable_decoder_config.sh doesn't help still same issue reproducing, any way am excluded valgrind dependency by commented and build success by following code change in libavutil/log.c


old code:

#if HAVE_VALGRIND_VALGRIND_H
#include <valgrind/valgrind.h>
/* this is the log level at which valgrind will output a full backtrace */
#define BACKTRACE_LOGLEVEL AV_LOG_ERROR
#endif

new code:

#if HAVE_VALGRIND_VALGRIND_H
//#include <valgrind/valgrind.h>
/* this is the log level at which valgrind will output a full backtrace */
//#define BACKTRACE_LOGLEVEL AV_LOG_ERROR
#endif

Xingwa 2020-09-14 10:30

I have assigned this issue to ffmpeg folks.

+1 1
Dayananda V 2020-09-14 12:39

@Dayananda V
Could you also try to add --disable-valgrind-backtrace in the disable_decoder_config.sh
Currently the confiure script detect some feautre from host but no avalivable on target platfrom. It is common issue.

@Xingwa

--disable-valgrind-backtrace this doesn't resolve my problem :-1:

Sign in to comment

Assignees
Labels
product-question
doc_code
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
1
https://gitee.com/openharmony/docs.git
git@gitee.com:openharmony/docs.git
openharmony
docs
docs

Search

103611 48b8ff67 1899542 103622 4d02230c 1899542