I am trying to build opengl cts into yocto. I created a recipe to do so:
DESCRIPTION = "OpenGL CTS"
LICENSE = "Apache-2.0"
PR = "r0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=67d07a07ec29a50a3ded12b2ba952257"
SRCREV = "77705f0d7a813bdac9c91385e46bff98b16320c9"
SRC_URI = "git://github.com/KhronosGroup/VK-GL-CTS.git;protocol=https"
S = "${WORKDIR}/git"
inherit pkgconfig cmake
The build process for the above recipe failed with the following output at do_compile() method:
| [ 17%] Linking CXX static library libglutil.a
| cd /home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build/framework/opengl && /home/fsl-arm-yocto-bsp/build-x11/tmp/sysroots/x86_64-linux/usr/bin/cmake -P CMakeFiles/glutil.dir/cmake_clean_target.cmake
| cd /home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build/framework/opengl && /fsl-arm-yocto-bsp/build-x11/tmp/sysroots/x86_64-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/glutil.dir/link.txt --verbose=1
| arm-poky-linux-gnueabi-ar qc libglutil.a CMakeFiles/glutil.dir/gluContextInfo.cpp.o CMakeFiles/glutil.dir/gluDefs.cpp.o CMakeFiles/glutil.dir/gluDrawUtil.cpp.o CMakeFiles/glutil.dir/gluES3PlusWrapperContext.cpp.o CMakeFiles/glutil.dir/gluFboRenderContext.cpp.o CMakeFiles/glutil.dir/gluPixelTransfer.cpp.o CMakeFiles/glutil.dir/gluProgramInterfaceQuery.cpp.o CMakeFiles/glutil.dir/gluRenderConfig.cpp.o CMakeFiles/glutil.dir/gluRenderContext.cpp.o CMakeFiles/glutil.dir/gluShaderProgram.cpp.o CMakeFiles/glutil.dir/gluShaderUtil.cpp.o CMakeFiles/glutil.dir/gluStateReset.cpp.o CMakeFiles/glutil.dir/gluTexture.cpp.o CMakeFiles/glutil.dir/gluTextureUtil.cpp.o CMakeFiles/glutil.dir/gluTextureTestUtil.cpp.o CMakeFiles/glutil.dir/gluVarType.cpp.o CMakeFiles/glutil.dir/gluVarTypeUtil.cpp.o CMakeFiles/glutil.dir/gluStrUtil.cpp.o CMakeFiles/glutil.dir/gluCallLogWrapper.cpp.o CMakeFiles/glutil.dir/gluObjectWrapper.cpp.o CMakeFiles/glutil.dir/gluContextFactory.cpp.o CMakeFiles/glutil.dir/gluDummyRenderContext.cpp.o CMakeFiles/glutil.dir/gluPlatform.cpp.o CMakeFiles/glutil.dir/gluShaderLibrary.cpp.o
| /home/fsl-arm-yocto-bsp/build-x11/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ranlib libglutil.a
| make[2]: Leaving directory '/home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build'
| [ 17%] Built target glutil
| make[1]: Leaving directory '/home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build'
| Makefile:86: recipe for target 'all' failed
| make: *** [all] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: oe_runmake failed
Related
In Ubuntu, I have downloaded a third-party shared library (liba1.so), placed in /lib/extern/lib . The associated header files I placed in /lib/extern/include. My own header files are placed in /include/public/ and /include/private/ . And now (to test mylib) I want to link this in my main.cpp code, using CMake.
My structure:
**My structure:**
|
|
+---CMakeLists.txt
|
+---lib
| |
| +---extern
| |
| +---lib
| | |
| | +---liba.so
| | +---libb.so
| | +---liba12.so
| |
| +---include
| |
| +...headers.h
|
+---include
| |
| +---public
| | |
| | +---file1.hpp
| | +...
| |
| +---private
| |
| +---file2.hpp
| +...
|
+---src
|
+---public
| |
| +---file1.cpp
| +...
|
+---private
| |
| +---file2.cpp
| +...
|
+---main.cpp
My CMakeLists.txt:
cmake_minimum_required(VERSION 3.9...3.19)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_VERSION})
endif()
project(mylib VERSION 0.0.1 DESCRIPTION "Test" LANGUAGES CXX )
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -DTPM_POSIX")
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_library(${PROJECT_NAME} STATIC src/private/file2.cpp src/public/file1.cpp )
add_library(lib SHARED IMPORTED)
set_target_properties(lib PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/lib/extern/lib/liba.so)
set_target_properties(lib PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/lib/extern/lib/libb.so)
set_target_properties(lib PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/lib/extern/lib/liba12.so)
target_link_libraries(${PROJECT_NAME} PUBLIC lib)
target_include_directories(${PROJECT_NAME}
PUBLIC
$<INSTALL_INTERFACE:lib/extern/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/extern/include>
$<INSTALL_INTERFACE:include/public>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/public>
$<INSTALL_INTERFACE:include/private>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/private>
)
add_executable(test src/main.cpp)
target_link_libraries(test PRIVATE mylib)
ERROR:
[build] Consolidate compiler generated dependencies of target mylib
[build] [ 60%] Built target mylib [build] Consolidate compiler generated dependencies of target test
[build] gmake[2]: *** No rule exists to target „lib/extern/lib/liba12.so“,
[build] required by „test“ to create. Ending.
[build] gmake[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/test.dir/all] Error 2
[build] gmake: *** [Makefile:91: all] Error 2
[proc] The command: /usr/bin/cmake --build /home/mathew/proj/build --config Debug --target all -j 10 -- exited with code: 2 and signal: null [build] Build finished with exit code 2
Your imported files are relative to the source directory, not the build directory. You need to use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_CURRENT_BINARY_DIR when setting IMPORTED_LOCATION.
I'm trying to Build Qemu & Xen for XenGT on Ubuntu 20.04 following this tutorial :
https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide#332-build-qemu--xen-for-xengt
because I want to share the integrated GPU with a xen VM.
The main hardware components of my PC are the following :
CPU I9-9900k
Intel Corporation UHD Graphics 630 (Desktop 9 Series) (rev 02)
IVIDIA Corporation TU102 [GeForce RTX 2080 Ti] (rev a1)
The compilation gave no errors until this point :
root#ziomario-z390aoruspro:/etc/xen/igvtg-xen# make install-tools
......
make libs
make[5]: ingresso nella directory «/etc/xen/igvtg-xen/tools/libxc»
rm -f _paths.h.tmp; echo "#define sbindir "/usr/sbin"" >>_paths.h.tmp; echo "#define bindir "/usr/bin"" >>_paths.h.tmp; echo "#define LIBEXEC "/usr/lib/xen"" >>_paths.h.tmp; echo "#define LIBEXEC_BIN "/usr/lib/xen/bin"" >>_paths.h.tmp; echo "#define libdir "/usr/lib"" >>_paths.h.tmp; echo "#define SHAREDIR "/usr/share"" >>_paths.h.tmp; echo "#define XENFIRMWAREDIR "/usr/lib/xen/boot"" >>_paths.h.tmp; echo "#define XEN_CONFIG_DIR "/etc/xen"" >>_paths.h.tmp; echo "#define XEN_SCRIPT_DIR "/etc/xen/scripts"" >>_paths.h.tmp; echo "#define XEN_LOCK_DIR "/var/lock"" >>_paths.h.tmp; echo "#define XEN_RUN_DIR "/var/run/xen"" >>_paths.h.tmp; echo "#define XEN_PAGING_DIR "/var/lib/xen/xenpaging"" >>_paths.h.tmp; echo "#define XEN_DUMP_DIR "/var/lib/xen/dump"" >>_paths.h.tmp; echo "#define XEN_LOG_DIR "/var/log/xen"" >>_paths.h.tmp; echo "#define XEN_LIB_DIR "/var/lib/xen"" >>_paths.h.tmp; echo "#define XEN_RUN_STORED "/var/run/xenstored"" >>_paths.h.tmp; if ! cmp -s _paths.h.tmp paths.h; then mv -f paths.h.tmp paths.h; else rm -f paths.h.tmp; fi
gcc -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O2 -fomit-frame-pointer -D__XEN_INTERFACE_VERSION=XEN_LATEST_INTERFACE_VERSION -MMD -MF .xc_pm.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -I../../xen/common/libelf -Werror -Wmissing-prototypes -I. -I./include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -D__XEN_TOOLS -pthread -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/toollog/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/evtchn/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/devicemodel/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -include /etc/xen/igvtg-xen/tools/libxc/../../tools/config.h -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/call/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/foreignmemory/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/gnttab/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -c -o xc_pm.o xc_pm.c
In file included from /usr/include/string.h:495,
from xc_private.h:24,
from xc_pm.c:22:
In function ‘strncpy’,
inlined from ‘xc_set_cpufreq_gov’ at xc_pm.c:308:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [/etc/xen/igvtg-xen/tools/libxc/../../tools/Rules.mk:222: xc_pm.o] Errore 1
make[5]: uscita dalla directory «/etc/xen/igvtg-xen/tools/libxc»
make[4]: *** [Makefile:184: build] Errore 2
make[4]: uscita dalla directory «/etc/xen/igvtg-xen/tools/libxc»
make[3]: *** [/etc/xen/igvtg-xen/tools/../tools/Rules.mk:246: subdir-install-libxc] Errore 2
make[3]: uscita dalla directory «/etc/xen/igvtg-xen/tools»
make[2]: *** [/etc/xen/igvtg-xen/tools/../tools/Rules.mk:241: subdirs-install] Errore 2
make[2]: uscita dalla directory «/etc/xen/igvtg-xen/tools»
make[1]: *** [Makefile:74: install] Errore 2
make[1]: uscita dalla directory «/etc/xen/igvtg-xen/tools»
make: *** [Makefile:127: install-tools] Errore 2
is this a bug ? how can I fix it ? Im not so skilled. Maybe it is an old bug and it is already been fixed,but I didn't find the solution. Can someone help me ? thanks.
I use CLion and I have this simple code:
#include <array>
int main() {
std::array<std::uint64_t, 3> arr;
return 0;
}
In my CMakeLists.txt I tried all the compiler flags from c++11/gnu++11 to c++17/gnu++17, but I keep getting this error when trying to build the code above
/pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake --build
/pathToCLionProject/my_project/cmake-build-default --target my_project -- -j 2
/pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake -H/pathToCLionProject/my_project -B/pathToCLionProject/my_project/cmake-build-default --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/gmake -f CMakeFiles/Makefile2 my_project
gmake[1]: Entering directory '/pathToCLionProject/my_project/cmake-build-default'
/pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake -H/pathToCLionProject/my_project -B/pathToCLionProject/my_project/cmake-build-default --check-build-system CMakeFiles/Makefile.cmake 0
/pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake -E cmake_progress_start /pathToCLionProject/my_project/cmake-build-default/CMakeFiles 2
/usr/bin/gmake -f CMakeFiles/Makefile2 CMakeFiles/my_project.dir/all
gmake[2]: Entering directory '/pathToCLionProject/my_project/cmake-build-default'
/usr/bin/gmake -f CMakeFiles/my_project.dir/build.make CMakeFiles/my_project.dir/depend
gmake[3]: Entering directory '/pathToCLionProject/my_project/cmake-build-default'
cd /pathToCLionProject/my_project/cmake-build-default && /pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake -E cmake_depends "Unix Makefiles" /pathToCLionProject/my_project /pathToCLionProject/my_project /pathToCLionProject/my_project/cmake-build-default /pathToCLionProject/my_project/cmake-build-default /pathToCLionProject/my_project/cmake-build-default/CMakeFiles/my_project.dir/DependInfo.cmake --color=
Scanning dependencies of target my_project
gmake[3]: Leaving directory '/pathToCLionProject/my_project/cmake-build-default'
/usr/bin/gmake -f CMakeFiles/my_project.dir/build.make CMakeFiles/my_project.dir/build
gmake[3]: Entering directory '/pathToCLionProject/my_project/cmake-build-default'
[ 50%] Building CXX object CMakeFiles/my_project.dir/dev/hmmenc_client/test.cpp.o
/usr/bin/c++ -I/pathToCLionProject/my_project -I/pathToCLionProject/my_project/dev/hmmenc_client -I/usr/local/include/pqxx -I/usr/pgsql-10/include -pthread -std=gnu++11 -o CMakeFiles/my_project.dir/dev/hmmenc_client/test.cpp.o -c /pathToCLionProject/my_project/dev/hmmenc_client/test.cpp
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp: In function ‘int main()’:
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:10: error: ‘array’ is not a member of ‘std’
std::array<std::uint64_t, 3> arr;
^~~~~
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:10: note: ‘std::array’ is defined in header ‘<array>’; did you forget to ‘#include <array>’?
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:6:1:
+#include <array>
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:10:
std::array<std::uint64_t, 3> arr;
^~~~~
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:29: error: expected primary-expression before ‘,’ token
std::array<std::uint64_t, 3> arr;
^
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:34: error: ‘arr’ was not declared in this scope
std::array<std::uint64_t, 3> arr;
^~~
gmake[3]: *** [CMakeFiles/my_project.dir/build.make:66: CMakeFiles/my_project.dir/dev/hmmenc_client/test.cpp.o] Error 1
gmake[3]: Leaving directory '/pathToCLionProject/my_project/cmake-build-default'
gmake[2]: *** [CMakeFiles/Makefile2:71: CMakeFiles/my_project.dir/all] Error 2
gmake[2]: Leaving directory '/pathToCLionProject/my_project/cmake-build-default'
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/my_project.dir/rule] Error 2
gmake[1]: Leaving directory '/pathToCLionProject/my_project/cmake-build-default'
gmake: *** [Makefile:121: my_project] Error 2
This is my g++ version: gcc version 8.1.1 20180502 (Red Hat 8.1.1-1) (GCC). What can cause this error?
This error occurs if you have an empty file named array in any of the directories listed on the include path (/pathToCLionProject/my_project, /pathToCLionProject/my_project/dev/hmmenc_client /usr/local/include/pqxx, /usr/pgsql-10/include).
Let's imagine a minimal project with the following structure:
|-- configure.ac
|-- Makefile.am
|-- src/
`-- ...
|-- test/
`-- Makefile.am
`-- test.sh
`-- test.py.in
Now, test.py.in uses autotools variables to build test.py. Running configure does build test.py and I'm quite happy about it.
But, touching/modifying test.py.in and then running make check should run configure before actually testing, but it does not. How to?
My Makefile.am:
check_SCRIPTS = \
test.sh \
$(NULL)
check_PROGRAMS = \
$(NULL)
testsuite_bin_SOURCES = \
$(NULL)
TESTS = \
test.sh \
$(NULL)
MOSTLYCLEANFILES = \
*.out *.err *.log \
$(NULL)
EXTRA_DIST = \
test.sh \
test.py \
$(NULL)
Running make check when test.py has been rmed:
$ make check
make test.sh
make[1]: Entering directory `.../test'
make[1]: Nothing to be done for `test.sh'.
make[1]: Leaving directory `.../test'
make check-TESTS
make[1]: Entering directory `.../test'
*** './test.py' was not found - aborting test ***
FAIL: test.sh
=======================================
1 of 1 test failed
Please report to nobody#nohost.nodomain
=======================================
make[1]: *** [check-TESTS] Error 1
make[1]: Leaving directory `/test
make: *** [check-am] Error 2
Part of my configure.ac:
AC_CONFIG_FILES([
#...
test/Makefile
test/test.py
])
AC_OUTPUT
I'm build gstreamer, at the step of building gstpgood/ext/aalib
The error log is
make[3]: Entering directory `sigma-gstreamer_1-2-rc5/build/gstpgood/ext'
make -C aalib
make[4]: Entering directory `/sigma-gstreamer_1-2-rc5/build/gstpgood/ext/aalib'
CC libgstaasink_la-gstaasink.lo
cc1: error: include location "/usr/include" is unsafe for cross-compilation [-Werror=poison-system-directories]
cc1: all warnings being treated as errors
make[4]: *** [libgstaasink_la-gstaasink.lo] Error 1
My friend build the same source on the other build host did not get this error. I compared gstpgood makefiles and found that my makefile has:
AALIB_CFLAGS = -I/usr/include
AALIB_CONFIG = /usr/bin/aalib-config
AALIB_LIBS = -L/usr/lib/x86_64-linux-gnu -laa
while my friend's make file has
AALIB_CFLAGS =
AALIB_CONFIG = no
AALIB_LIBS =
This aalib is used by aasink, how can i disable aasink when compiling gstreamer???
Pass --disable-aalib to configure before running make. Check ./configure --help for many other things you could disable.
Thank Sebastian Dröge!
I also find a way to bypass aalib check by editing .m4 file in: gstreamer/ext/gstpgood/m4/aalib.m4 it worked for me
#force disable aalibtes by putting enable_aalibtest=no
AC_ARG_ENABLE(aalibtest,
AC_HELP_STRING([--disable-aalibtest],
[do not try to compile and run a test AALIB program]),
, enable_aalibtest=yes)
enable_aalibtest=no
#comment some code
# AC_PATH_PROG(AALIB_CONFIG, aalib-config, no)
# min_aalib_version=ifelse([$1], ,0.11.0,$1)
# AC_MSG_CHECKING(for AALIB - version >= $min_aalib_version)
no_aalib=""
# if test "$AALIB_CONFIG" = "no" ; then
if test x$aalib_prefix == x ; then#add this line
no_aalib=yes
else
AALIB_CFLAGS="-I$aalib_prefix/include"#add this line
AALIB_LIBS="-L$aalib_prefix/lib -laa"#add this line
# AALIB_CFLAGS=`$AALIB_CONFIG $aalibconf_args --cflags`
# AALIB_LIBS=`$AALIB_CONFIG $aalibconf_args --libs`
# aalib_major_version=`$AALIB_CONFIG $aalib_args --version | \
# sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
# aalib_minor_version=`$AALIB_CONFIG $aalib_args --version | \
# sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
# aalib_micro_version=`$AALIB_CONFIG $aalib_config_args --version | \
# sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`