How to install debug libraries (like lib*d) into packages in yocto - embedded-linux

Now I am writing my master theis which is related to embedded system using yocto.
I have an ua-SDK(source code included). I need to install the ua package into sato-image, which runs on a Raspberrypi.
First of all, I write a recipe "opcua" like this:
SUMMARY = "this is a recipe for building opc-ua sdk package"
LICENSE = "MIT & RCL & OpenSSL & LGPL-3.0 & Apache-2.0"
LIC_FILES_CHKSUM = "file:///home/yocto/workspace/poky/rpiHouseHello/tmp/work/armv6-vfp-poky-linux-gnueabi/ua-new/1.0-r0/license-destdir/ua-new/generic_Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10
SRC_URI = "file:///home/yocto/workspace/poky/rpiHouseHello/downloads/uasdkcppclient-src-linux32-x86-gcc4.5.1-v1.4.2-275.tar.gz"
S = "${WORKDIR}/sdk/src"
DEPENDS += "libxml2 openssl"
inherit cmake
INSANE_SKIP_ua-new += "dev-deps"
The opcua package is installed successfully after $bitbake opcua. Then I try to add the generated opcua package into sato-image by writing another recipesato-with-ua like this
DESCRIPTION = ""
IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-openssh hwcodecs dbg-pkgs tools-debug debug-tweaks"
LICENSE = "MIT"
inherit core-image
IMAGE_INSTALL += " ua ua-dbg ua-staticdev ua-dev"
it was also installed successfully. After that I extracted the SDK from this image by using:
$bitbake sato-with-ua -c populated_sdk
There is also no problem. After that I try to check the functionality of this extracted SDK. My tutor gave me a test project written by c++. I try to build this project in eclipse.
But here comes the problem, Eclipse can not find the debug libraries---lib*d(for example libuabased.a) by linking libraries. I found that there is libuabase.a but no libuabased.a in my package. Location of the package:/home/yocto/workspace/poky/rpiHouse/tmp/work/armv6-vfp-poky-linux-gnueabi/opcua/1.0-r0/packages-split. In Eclipse, we develop project in debug version so it also needs libraries in debug version.
I'm confused that why yocto installed only release library but not debug library. Both are included in source code. yocto can only install one type?
so I try to modify the opcua recipe to include the debug library into my packages-split. After reading the reference of yocto I added the follows to my recipe "opcua":
PACKAGES =+ " ${PN}-alibd ${PN}-solibd"
FILES_${PN}-alibd = "${libdir}/libstackd.so"
FILES_${PN}-solibd = "${libdir}/libuabased.a ${libdir}/libuaclientd.a ${libdir}/libuapkid.a ${libdir}/libxmlparserd.a"
After bitbake opcua I got the two new packages ${PN}-alibd and ${PN}-solibd indeed, but both packages are empty. All of those libraries I listed above are not included.
My first question is that, does this variable ${libdir} indicate /usr/lib of our host machine? I found there is no lib*d.a file in that directory. So I think maybe I make a mistake by understanding this variable. what does this ${libdir} referred to?
My second question, how to install those debug libraries into my packages after bitbake the recipe? my goal is that I can get those debug libraries in the sato-with-ua image und then extract the SDK from this image.This SDK included those debug libraries so that I can link them in my Eclipse to develop my project correctly.
i am so sorry that i told a long story. This is the first time i made something related with software. so I beg your appologise.

Related

Boost++ Libraries in libPTP of OMNeT++

When I import libPTP in OMNeT++, I need to install Boost++ Libraries. I installed the Boost++ Libraries according to the Install Guide, but it didn't work. The following error occurred:
Errors occurred during the build.
Errors running builder 'OMNeT++ Makefile Builder' on project 'libPTP'.
Path must include project and resource name: /boost
Do I need to set the path of Assembly, GNU C and GNU C++ to C:\boost of the Includes tab when I do the step ‘Add the path where you have installed Boost (e.g. C:\boost)`?
Looking forward to your reply. Thank you.
Best Regards,
Fei

Yocto Project Boost library : Change default package version used in bitbake recipe

I am developing a Linux image operating system using Yocto Project.
I am using SUMO branch (Yocto Project 2.5).
In order to install the boost library in my Linux image, I added this line to the local.conf file :
IMAGE_INSTALL_append = " boost"
But I discover that the default version installed is Boost 1.66.0.
Under meta/recipes-support/boost directory I can find three files :
recipes-support/boost/boost_1.66.0.bb
recipes-support/boost/boost-1.66.0.inc
recipes-support/boost/boost.inc
I think that those are the recipes for this library.
I need to use version 1.70.0 because I have an application coded using this version.
I don't know how to modify these recipes in order to have the desired version, or is there another method to use ? I don't find any helpful tips on the internet. Can you help me please ?
Thank you!
take a look at the openembedded layer index. There you'll find the recipe for boost 1.72. If this recipe doesn't depend on any other components of your system (like gcc version), you'll be able to add this recipe in your own layer. Then, in your build/local.conf, after IMAGE_INSTALL_append = "<YOUR_OTHER_PGS> boost" set the preferred version for boost by adding PREFERED_VERSION_boost="1.72.0" to the file and rerun bitbake.
I hope this helps.

OpenMP support in xcode build and automated builds

I need to integrate cpp files that are using the omp header file in my xcode project. I followed this article http://antonmenshov.com/2017/09/09/clang-openmp-setup-in-xcode/ which helped me compile the xcode project without issues. However, the paths being /usr/local/... doesn't work for automated builds. I am using VSTS for automated-build of my xcode project and it can't obviously find the file/directory.
I tried to include the header and dylib as part of the xcode project and reference it instead of the /usr/local path. But I don't know how to update the "user defined setting" described in the article which points to the path /usr/local/opt/llvm/bin/clang. The auto-build is failing because of this path.
Is there a way to make this work for automated builds?
The path for the user-defined setting CC is depend on where the llvm installed.
If you are using Hosted macOS Preview agent for VSTS build, you should install llvm first (brew install llvm) and then get the path for where llvm installed (it's mainly in the path /usr/local/opt/llvm), and then you should use the path /usr/local/opt/llvm/bin/clang instead.
If you are using private agent for VSTS build, the path for user-defined setting CC should be where llvm installed on the agent machine.

Can't build Rustless on Windows

I'm trying to build the rustless "basic usage" sample project.
This is my Cargo.toml. I had to add the dependencies in Cargo.toml in order to avoid the build error error[E0463]: can't find crate for 'hyper'
[package]
name = "rustlessTest"
version = "0.1.0"
authors = ["x"]
[dependencies.rustless]
git = "https://github.com/rustless/rustless"
[dependencies]
hyper = "0.9.14"
iron = "0.4.0"
rustc-serialize = "0.3.22"
valico = "1.0.1"
I also downloaded the OpenSSL library & sources. I stored them under C:\OpenSSL\lib and C:\OpenSSL\include and set the directories as a environment variable, as mentioned in this thread about how to using Hyper on Windows.
When I try to compile, it fails with the following output:
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for `openssl v0.7.14`
....
....
I finally managed to build OpenSSL on Windows by following the solution from this blog post.
Here's a summary:
Download Win64 OpenSSL v1.0.1u from here. Install it with default settings.
Set the following environment variables
DEP_OPENSSL_INCLUDE=C:\OpenSSL-Win64\include
OPENSSL_INCLUDE_DIR=C:\OpenSSL-Win64\include
OPENSSL_LIB_DIR=C:\OpenSSL-Win64\lib\VC
OPENSSL_LIBS=ssleay32MT:libeay32MT
Install Visual Studio 2015 or Visual Studio Code with C++ support.
Ensure that all path variables are set correctly
Set rust-msvc as the toolchain. You can check this by typing rustup show into the console. You should get an output like this:
Default host: x86_64-pc-windows-msvc
stable-x86_64-pc-windows-msvc (default)
rustc 1.13.0 (2c6933acc 2016-11-07)
Now you should able to build Rust projects which requires OpenSSL.
You are right that it is because OpenSSL is not found. A good tutorial is in the README of rust-openssl.
Windows MSVC
On MSVC it's unfortunately not always a trivial process acquiring
OpenSSL. Perhaps the easiest way to do this right now is to download
precompiled binaries and install them on your system. Currently it's
recommended to install the 1.1.0 (non-light) installation if you're
choosing this route.
Once a precompiled binary is installed you can configure this crate to
find the installation via an environment variable:
set OPENSSL_DIR=C:\OpenSSL-Win64
Note that this OpenSSL distribution does not ship with any root
certificates. So to make requests to servers on the internet, you have
to install them manually. Download the cacert.pem file from here,
copy it somewhere safe (C:\OpenSSL-Win64\certs is a good place) and
point the SSL_CERT_FILE environment variable there:
set SSL_CERT_FILE=C:\OpenSSL-Win64\certs\cacert.pem
After that, you're just a cargo build away!
Windows GNU (MinGW)
The easiest way to acquire OpenSSL when working with MinGW is to
ensure you're using MSYS2 and to then
execute:
# 32-bit pacman -S mingw-w64-i686-openssl
# 64-bit pacman -S mingw-w64-x86_64-openssl
And after that, a cargo build should be all you need!
Manual configuration
rust-openssl's build script will by default attempt to locate OpenSSL
via pkg-config or other system-specific mechanisms. This will not work
in some situations however, for example cross compiling or when using
a copy of OpenSSL other than the normal system install.
The build script can be configured via environment variables:
OPENSSL_DIR - If specified, a directory that will be used to find OpenSSL installation. It's expected that under this directory the
include folder has header files and a lib folder has the runtime
libraries.
OPENSSL_LIB_DIR - If specified, a directory that will be used to find OpenSSL libraries. Overrides the lib folder implied by
OPENSSL_DIR (if specified).
OPENSSL_INCLUDE_DIR - If specified, a directory that will be used to find OpenSSL header files. Overrides the include folder implied
by OPENSSL_DIR (if specified).
OPENSSL_STATIC - If specified, OpenSSL libraries will be statically rather than dynamically linked.
If OPENSSL_DIR is specified, then the build script will skip the
pkg-config step.
It's a nightmare; OpenSSL with Windows is really painful. I hope that one day Rust has its own implementation of SSL/TLS.

New Qt Directory is not valid

I've written an application using Qt on OS X. The installed SDK automatically installed as a framework which I didn't want. So I cloned their newest version from the Qt git repository and built it from source as static libraries. I would like it to compile using those static libraries instead of the framework but in preferences in setting the version/Path of Qt no matter what path I direct it to it says it's not a valid Qt directory. What has to be in a qt Directory that constitutes it being valid?
I'm closing this, The problem was installing on OSX I needed to declare -no-framework when running configure.
Some tips;
Install into a path that doesn't contain spaces
Use -prefix $PWD from the current path, and set the PATH, INCLUDE and LIB env variables appropriately - this makes it possible to have multiple Qt builds, e.g. multiple shadow builds from one source directory
Don't do static configure - it makes using plugins difficult, and assuming you use LGPL you have to ship the .o files.

Resources