yocto opendds does not create the sdknative files - yocto

I am trying to build an application that communicates with dds with opendds. I am using the opendds layer on krikstone. The bitbake image is built with the opendds libraries but when I build the sdk it seems the layer nativesdk is not installed. When I run the cmake I get the error "Missing required dependencies OPENDDS_IDL;ACE_GPERF;TAO_IDL".
from the opendds.inc I see there is the nativesdk install. I added a junk line and expected that when i build the opendds or build the populate-sdk I will fail but it seems that the nativesdk is not run.
build is for imx8mm variscite som with command bitbake fsl-image-qt5 -v populate_sdk_ext
layer with the problem is meta-opendds (krikstone branch) building version 3.22
the layer has a bb file that requires an opendds.inc file which has the nativesdk install
Blockquote
do_install:append:class-nativesdk() {
dfdf -- my junk line to trigger failure
ln -sf ${bindir}/opendds_idl ${D}${datadir}/dds/bin/opendds_idl
ln -sf ${bindir}/ace_gperf ${D}${datadir}/ace/bin/ace_gperf
ln -sf ${bindir}/tao_idl ${D}${datadir}/ace/bin/tao_idl
}
Blockquote
** i added a junk line to trigger failure but it doesnt fail with building the sdk or image itself
why is the nativesdk command not run and why is the sdk without the opendds_idl executable
thanks

I was able at last to build the nativesdk files. I had to build them specifically as they are not build by default. i had to "bitbake nativesdk-opendds" manually.
my mistake was to believe that the nativesdk will be defaulted. my assumption is that if i am using the opendds that most probable that i will build subscribers/produces applications and will need the opendds_idl executable.
!!!! after testing the nativesdk-opendds it did not solve the problem !!!
!! in general after adding building the opendds layer i cannot build the Messanger example for lack of the opendds_idl and other two (tao,ace) executable

Related

How to generate C API for onnxruntime on Linux

I am trying to build onnxruntime from source on Linux. According to this instruction I have successfully built python wheels and shared libs. But I have not seen headers for C API.
There is a build option --build_csharp which seems to enable C#/C packages. I tried to add this option but got following errors.
CMake Warning at CMakeLists.txt:137 (message):
Language Csharp is not found in the system
I installed dotnet-sdk-3.1 but still got this error. Can I ask how to properly generate onnxruntime C API on Linux? Thanks!
Please try the following steps:
- Steps to build ONNX from source code:
1. git clone --recursive https://github.com/Microsoft/onnxruntime
2. Get the commit ID of the version you want to build (In case you want older version)
3. git checkout "your commitID"
4. Install the required version of Cmake on your system
6. Run: <path>\build.sh --config Release --build_shared_lib --parallel
7. A build folder will be created in the onnxruntime.
5. Get the onnxruntime.dll from the dir: \onnxruntime\build\Windows\Release\Release
6. Get the required headers (onnxruntime_c_api.h, onnxruntime_cxx_api.h, onnxruntime_cxx_inline.h)
from the dir: \onnxruntime\include\onnxruntime\core\session and put it in the unit location.

Build image for mips AND application (part of same image) for host

I can successfully build and run a MIPS image on my target device. I use a command such as:
bitbake <image-name>
I also want to be able to build an executable (and all its dependencies) that is part of the same image, to run on my x86_64 host. Using my image configuration of build above, I can execute a partial build of my image simply by giving the following command:
bitbake <name-of-executable>
Obviously, without any changes the executable (and all its dependencies) will be a MIPS-build.
What do I have to change to have the executable (and all its dependencies) be built to run on my developer machine, an x86_64?
You would need to build a -native version of your recipe.
Often, this is possible by adding the following line to your recipe, example.bb:
BBCLASSEXTEND = "native"
That would allow you to call bitbake example to still create the package for MIPS, while allowing you to call bitbake example-native to create a package / binary to be used within the bitbake environment. (I.e. it's built for x86_64 in your case).

Building Swift on CentOS

I am building Swift compiler from source on CentOS 6, and am running into a library issue. After fighting with the build script for a while I have got where running ./utils/build-script eventually gives:
+ /home/src/cmake-3.4.1-Linux-x86_64/bin/cmake --build /home/src/swift/build/Ninja-DebugAssert/cmark-linux-x86_64 -- all
ninja: no work to do.
llvm: using standard linker
+ cd /home/src/swift/build/Ninja-DebugAssert/llvm-linux-x86_64
+ /home/src/cmake-3.4.1-Linux-x86_64/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang -DCMAKE_CXX_COMPILER:PATH=clang++ '-DCMAKE_C_FLAGS= ' '-DCMAKE_CXX_FLAGS= ' -DCMAKE_BUILD_TYPE:STRING=Debug -DLLVM_ENABLE_ASSERTIONS:BOOL=TRUE -DLLVM_TOOL_SWIFT_BUILD:BOOL=NO '-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64' -DLLVM_INCLUDE_TESTS:BOOL=TRUE -LLVM_INCLUDE_DOCS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINTERNAL_INSTALL_PREFIX=local /home/src/swift/llvm
CMake Error at cmake/modules/CheckAtomic.cmake:36 (message):
Host compiler appears to require libatomic, but cannot find it.
Call Stack (most recent call first):
cmake/config-ix.cmake:296 (include)
CMakeLists.txt:403 (include)
-- Configuring incomplete, errors occurred!
See also "/home/src/swift/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeOutput.log".
See also "/home/src/swift/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeError.log".
./utils/build-script: command terminated with a non-zero exit status 1, aborting
(gcc-4.8.2 was what I compiled llvm with)
libatomic is there:
$ locate libatomic
/opt/gcc-4.8.2/lib64/libatomic.a
/opt/gcc-4.8.2/lib64/libatomic.la
/opt/gcc-4.8.2/lib64/libatomic.so
/opt/gcc-4.8.2/lib64/libatomic.so.1
/opt/gcc-4.8.2/lib64/libatomic.so.1.0.0
I just don't know how to tell the build system where to look. I have tried the usual CMAKE_LIBRARY_PATH (exporting on the command line - I am not sure if cmake works like the way LD_LIBRARY_PATH, LIBRARY_PATH work) but it can't seem to find it.
I also don't have root on the machine.
I had not tried building from source on CentOS 6 until I saw this question, but I have been able to build Swift 2.2 on CentOS 7.1 and Ubuntu 14.04, with partial success. A few things to think about:
You will need numerous dependencies required to build Swift, and unless
they happen to be already on the system, you will need root access to
install them.
Use -R flag with the build-script to create a release build.
Building in DebugAssert (the default) will require a lot of memory. In my case even 14 GB was not sufficient. A release build
can be done with about 6 GB.
As for your specific problem, it is related to Clang's dependency on GCC-related packages for headers and libraries. See, for example, Fedora 21 with clang, without gcc.
Even if you installed GCC 4.8.2 and adjusted the path to use gcc and g++ from 4.8.2, Clang may still be looking in the old GCC directories for headers and libraries. CMake first tries to compile a C++ test file that includes the header atomic, which does not exist in the old GCC. So, it then tries to link a C test program that uses the library libatomic, which again doesn't exist in the old GCC. You can see this by looking at llvm/cmake/modules/CheckAtomic.cmake mentioned by usr1234567. CMakeError.log and CMakeOutput.log can also provide valuable insight. BTW, when I was building Swift on CentOS 7.1, I didn't run into this problem because GCC 4.8.2 was used by Clang for headers and libraries and the atomic header was found, so the C++ file got compiled. However, had the libatomic check been done, it would have failed, because libatomic.so in the repository-provided 4.8.2 has INPUT ( <name of some non-existent file> ), so trying to link with libatomic errors out.
I'm sure there are various ways of dealing with this issue, but what solved the problem for me was setting the following environment variables, please adjust to your specific setup:
export CPLUS_INCLUDE_PATH=/opt/gcc-4.8.2/include/c++/4.8.2:/opt/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu
export LIBRARY_PATH=/opt/gcc-4.8.2/lib64:/opt/gcc-4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2
Also make sure that your 4.8.2 version of libstdc++.so is available to the dynamic linker at runtime. Since you don't have root, do
export LD_LIBRARY_PATH=/opt/gcc-4.8.2/lib64
If you had root, you could use ldconfig.
Before you start building Swift, you may want to try building, using Clang, a simple C program linking it with libatomic (the code doesn't actually have to use any symbols from the lib) and a simple C++ program that includes the <atomic> header. When compiling the C++ program, use the -std=c++11 compiler flag. If the C++ program compiles successfully, then it is not necessary for the libatomic linking test to be successful.
Interestingly, the CMakeOutput.log file still did not report finding GCC 4.8.2 as a candidate GCC installation, but the configuration/build worked well past the error.
Hopefully this helps. Please let us know if you run into something else.
CheckAtomic.cmake seems to be part of LLVM. I found a file at Github and it tries to find '__atomic_fetch_add_4' from libatomic
check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC)
This fails for you. Check CMakeFiles/CMakeError.log to get more details why this test failed. Or try this line in a new project.

Error while compiling tossim in tiny OS

When I try to compile TOSSIM in tiny OS v-2.0.2 , this is the error that it is giving me:
# make micaz sim
Makefile:2: /opt/tinyos-2.1.0/support/make/Makerules: No such file or directory
make: *** No rule to make target `/opt/tinyos-2.1.0/support/make/Makerules'. Stop.
How to remove this error?
Did you run a ./configure ? This is usually the config script used by make files, but sometimes people use strange build systems so I'd look around in the project's root directory for something else relating to configuring or installing. There should also be a text file called 'INSTALL' which helps.
The usual build commands are:
./configure
make
make install clean

How to exclude packages when populate_sdk in Yocto

I have a Yocto bitbake image recipe that can be built successfully.
However, the same image recipe fails when generating SDK with -c populate_sdk command.
The error seems to be caused by mixing 32-bit and 64-bit versions of libraries, which is fine when building images with only binaries, but the header files collide with each other when populating the SDK root fs:
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction check error:
file /usr/bin/curl-config from install of lib32-curl-dev-7.53.1-r0.cortexa7hf_neon_vfpv4 conflicts with file from package curl-dev-7.53.1-r0.aarch64
file /usr/include/nettle/version.h from install of lib32-nettle-dev-3.3-r0.cortexa7hf_neon_vfpv4 conflicts with file from package nettle-dev-3.3-r0.aarch64
file /usr/include/nettle/nettle-stdint.h from install of lib32-nettle-dev-3.3-r0.cortexa7hf_neon_vfpv4 conflicts with file from package nettle-dev-3.3-r0.aarch64
What is the best way to exclude 32-bit versions of libraries(recipes) when doing -c populate_sdk without excluding them entirely from the production image?
You can remove target packages from the toolchain by removing them from the TOOLCHAIN_TARGET_TASK variable and host packages by removing them from the TOOLCHAIN_HOST_TASK.
For example to remove the target package "curl-dev" from your sdk you have to add the following in your image recipe:
TOOLCHAIN_TARGET_TASK_remove = "curl-dev"
To remove the same host package from your sdk you have to add the following in your image recipe:
TOOLCHAIN_HOST_TASK_remove = "curl-dev"