COVESA/dlt-daemon

Not able to compile the dlt-daemon for QNX system

Closed this issue · 9 comments

rakeshg3@L-13033:~/CovesaLogAggDlt/qnx710/dlt-daemon/build$ make
[ 1%] Building C object src/lib/CMakeFiles/dlt.dir/dlt_user.c.o
cc: no target specified
src/lib/CMakeFiles/dlt.dir/build.make:75: recipe for target 'src/lib/CMakeFiles/dlt.dir/dlt_user.c.o' failed
make[2]: *** [src/lib/CMakeFiles/dlt.dir/dlt_user.c.o] Error 1
CMakeFiles/Makefile2:340: recipe for target 'src/lib/CMakeFiles/dlt.dir/all' failed
make[1]: *** [src/lib/CMakeFiles/dlt.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

Hi, I'm facing this error while trying to build the covesa dlt for QNX, Please help me in that
CMakeLists.txt
find the Cmake list let me know if any changes required

Hello @rakeshg3738,
thanks for your interest in DLT topic on QNX.
DLT is investigating this case and will answer you soon.
Thank you so much

Hello @rakeshg3738 ,

Could you please try to comment out following lines:
#set(CMAKE_C_COMPILER "/home/rakeshg3/CovesaLogAggDlt/qnx710/host/linux/x86_64/usr/bin/qcc")
#set(CMAKE_CXX_COMPILER "/home/rakeshg3/CovesaLogAggDlt/qnx710/host/linux/x86_64/usr/bin/q++")

And compile with commands:
mkdir build
cd build
cmake -Blibdlt -H.. -DCMAKE_SYSTEM_NAME=QNX -DCMAKE_C_COMPILER=${QNX_HOST}/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc -DCMAKE_INSTALL_PREFIX=/usr -DWITH_DLT_QNX_SYSTEM=ON -DWITH_DLT_SYSTEM=OFF -DCMAKE_CXX_STANDARD=14
cmake --build libdlt

Regards,

Hi @lvklevankhanh l have doubt, do i need to build this inside the QNX SDP or Outside the QNX SDP ( i.e on Linux ) I tried both but getting this error

cmake -Blibdlt -H.. -DCMAKE_SYSTEM_NAME=QNX -DCMAKE_C_COMPILER=${QNX_HOST}/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc -DCMAKE_INSTALL_PREFIX=/usr -DWITH_DLT_QNX_SYSTEM=ON -DWITH_DLT_SYSTEM=OFF -DCMAKE_CXX_STANDARD=14
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 9.4.0
CMake Error at CMakeLists.txt:17 (project):
The CMAKE_C_COMPILER:

/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!

Any further info need to be provided please let me know, Thanks for your support

Hello @rakeshg3738
You do not need to put the src into qnx-sdp, I could reproduce your issue and I think you have not source the build environment I guess?
In qnx-sdp there is a script to setup environment, could you kindly check and run the script before going on with dlt?
The script will let you set your compiler to cross compiler ntoaarch64 for qnx binary compilation.
Regards
DLT team

Thanks @minminlittleshrimp @lvklevankhanh , i have run the script and cloud able to build till 98 %, after that i'm getting the error

[ 94%] Built target dlt-example-user-common-api
[ 96%] Building C object src/dlt-qnx-system/CMakeFiles/dlt-qnx-system.dir/dlt-qnx-system.c.o
[ 98%] Building CXX object src/dlt-qnx-system/CMakeFiles/dlt-qnx-system.dir/dlt-qnx-slogger2-adapter.cpp.o
cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files
src/dlt-qnx-system/CMakeFiles/dlt-qnx-system.dir/build.make:89: recipe for target 'src/dlt-qnx-system/CMakeFiles/dlt-qnx-system.dir/dlt-qnx-slogger2-adapter.cpp.o' failed
make[2]: *** [src/dlt-qnx-system/CMakeFiles/dlt-qnx-system.dir/dlt-qnx-slogger2-adapter.cpp.o] Error 1
CMakeFiles/Makefile2:666: recipe for target 'src/dlt-qnx-system/CMakeFiles/dlt-qnx-system.dir/all' failed
make[1]: *** [src/dlt-qnx-system/CMakeFiles/dlt-qnx-system.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

did i miss something here..?, Please let me know, Thanks for the help

Hello @rakeshg3738 ,
Please try with suggestion at link https://www.cnblogs.com/sciapex/p/15015744.html

cmake -Blibdlt -H${dlt_source} -DCMAKE_TOOLCHAIN_FILE=../qnx.cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_DLT_QNX_SYSTEM=ON ...
cmake --build libdlt

touch qnx.cmake

This is required. target system name

SET(CMAKE_SYSTEM_NAME QNX)

specify the cross compiler

SET(CMAKE_C_COMPILER $ENV{QNX_HOST}/usr/bin/aarch64-unknown-nto-qnx7.0.0-gcc-5.4.0)
SET(CMAKE_CXX_COMPILER $ENV{QNX_HOST}/usr/bin/aarch64-unknown-nto-qnx7.0.0-g++-5.4.0)
set(CMAKE_C_COMPILER_TARGET gcc_ntoaarch64le)
set(CMAKE_CXX_COMPILER_TARGET gcc_ntoaarch64le)
...
Regards,

Hello @rakeshg3738
How is it going with your QNX build?
Do our support help you solve the issue?

Hello all, can someone tell me how to compile dlt-daemon on QNX?

rakeshg3@L-13033:~/CovesaLogAggDlt/qnx710/dlt-daemon/build$ make [ 1%] Building C object src/lib/CMakeFiles/dlt.dir/dlt_user.c.o cc: no target specified src/lib/CMakeFiles/dlt.dir/build.make:75: recipe for target 'src/lib/CMakeFiles/dlt.dir/dlt_user.c.o' failed make[2]: *** [src/lib/CMakeFiles/dlt.dir/dlt_user.c.o] Error 1 CMakeFiles/Makefile2:340: recipe for target 'src/lib/CMakeFiles/dlt.dir/all' failed make[1]: *** [src/lib/CMakeFiles/dlt.dir/all] Error 2 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2

Hi, I'm facing this error while trying to build the covesa dlt for QNX, Please help me in that CMakeLists.txt find the Cmake list let me know if any changes required

Can you share example CPP code to use DLT Logging inside a function called from main function in compiled in QNX environment. ??