openEmbedded sdk installation - sdk

I am trying to install openEmbedded sdk for arm with libxml2 and freetype packages.
I hope that somebody here can give me good advice.
Question is about deploying sdk and giving include paths to the makefile.
To deploy sdk, I use /home/vincent/oe_dir3/setup-scripts/build/tmp-defaultsetup-eglibc-eglibc/deploy/sdk/oecore-i686-armv5te-toolchain-oe-core.0.sh and chose /home/vincent/oe_dir3/oecore-i686/ directory.
First I am surprise I have no freetype or libxml2 include in the install directory.
vincent#electronic:~$ find /home/vincent/oe_dir3 -name "freetype" | grep "include/freetype"
/home/vincent/oe_dir3/setup-scripts/build/tmp-defaultsetup-eglibc-eglibc/sysroots/eukrea-cpuimx25/usr/include/freetype2/freetype
I continue to do the make with above path as include.
I meet following error :
Linking... /home/vincent/eclipseProjects/sensigom/obj/parcoursMusical.o
/home/vincent/oe_dir3/oecore-i686/sysroots/i686-oesdk-linux/usr/bin/armv5te-oe-linux-gnueabi/../../libexec/armv5te-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.7.2/ld: cannot find crt1.o: No such file or directory
/home/vincent/oe_dir3/oecore-i686/sysroots/i686-oesdk-linux/usr/bin/armv5te-oe-linux-gnueabi/../../libexec/armv5te-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.7.2/ld: cannot find crti.o: No such file or directory
/home/vincent/oe_dir3/oecore-i686/sysroots/i686-oesdk-linux/usr/bin/armv5te-oe-linux-gnueabi/../../libexec/armv5te-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.7.2/ld: cannot find crtbegin.o: No such file or directory
/home/vincent/oe_dir3/oecore-i686/sysroots/i686-oesdk-linux/usr/bin/armv5te-oe-linux-gnueabi/../../libexec/armv5te-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.7.2/ld: cannot find -lstdc++
/home/vincent/oe_dir3/oecore-i686/sysroots/i686-oesdk-linux/usr/bin/armv5te-oe-linux-gnueabi/../../libexec/armv5te-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.7.2/ld: cannot find -lm
collect2: error: ld returned 1 exit status
I don't know where and also in which documentation to search. If you have any idea I would be happy.
Regards

Freetype and libxml2 have to be added to your rootfs befor you generate the sdk.
IMAGE_INSTALL += "freetype libxml2"
They mustthen appear in your sysroot

Related

How to build opencv samples

I am new to cmake though not to make. This question is different from Could not build OpenCV Android sample project since that other question is about a single project and this one is looking at the overall CMakeLists.txt.
Speaking of which: consider the CMakeLists.txt in ${OPENCVDIR}/samples :
I followed basic process for cmake:
cd "${OPENCVDIR}/samples"
mkdir build
cd build
cmake ..
But at the last step I have:
$ cmake ..
CMake Error at CMakeLists.txt:72 (find_package):
Could not find a package configuration file provided by "OpenCV" with any
of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
See also "/git/opencv/samples/CMakeFiles/CMakeOutput.log".
Line 72 has this: find_package(OpenCV REQUIRED PATHS "..")
I looked at the error log and it was not informative.
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in "/git/opencv/samples/CMakeFiles/3.13.4/CompilerIdCXX/a.out"
Determining if the C compiler works passed with the following output:
Change Dir: /git/opencv/samples/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_26f76/fast"
/usr/bin/make -f CMakeFiles/cmTC_26f76.dir/build.make CMakeFiles/cmTC_26f76.dir/build
make[1]: Entering directory '/git/opencv/samples/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_26f76.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_26f76.dir/testCCompiler.c.o -c /git/opencv/samples/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_26f76
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_26f76.dir/link.txt --verbose=1
/usr/bin/cc -rdynamic CMakeFiles/cmTC_26f76.dir/testCCompiler.c.o -o cmTC_26f76
make[1]: Leaving directory '/git/opencv/samples/CMakeFiles/CMakeTmp'
Detecting C compiler ABI info compiled with the following output:
"/git/opencv/samples/CMakeFiles/CMakeOutput.log" 706 lines, 48095 characters
Feature record: CXX_FEATURE:0cxx_defaulted_move_initializers
Feature record: CXX_FEATURE:0cxx_delegating_constructors
Feature record: CXX_FEATURE:0cxx_deleted_functions
Feature record: CXX_FEATURE:0cxx_digit_separators
Feature record: CXX_FEATURE:0cxx_enum_forward_declarations
Feature record: CXX_FEATURE:0cxx_explicit_conversions
Feature record: CXX_FEATURE:0cxx_extended_friend_declar
etc ..
What is the correct way to build these examples - hopefully using the CMakeLists.txt already provided?
It seems the installation directory of OpenCV couldn't be found by cmake. Try to provide the value through the argument:
cmake -DCMAKE_PREFIX_PATH=/home/someone/src/opencv/install ..
Ff it works, you could define this in the top-level CMakeLitst.txt:
list(APPEND CMAKE_PREFIX_PATH /home/someone/src/opencv/install)
This should provide CMake the place where it should look to.
$ opencv_version
3.4.16
$ cd OpenCV/samples/
$ cmake -B build
$ cmake --build build
JPEG display
$ build/cpp/example_cpp_image data/lena.jpg
USB camera capture
$ build/cpp/example_cpp_videocapture_basic
$ build/cpp/example_cpp_videocapture_camera
Recognition by AI
$ build/tapi/example_tapi_hog

ld cannot find OCCI libraries even if they exist in LD_LIBRARY_PATH

I am just doing some simple OCCI thing, however it compiles a bit strangely
Environment:
Oracle VM: Centos7 64bit on Windows 8 64bit
gcc-c++.x86_64
Simply installed Oracle XE by double clicking the rpm (download pages says
linux 64bit)
echo $LD_LIBRARY_PATH yields:
/usr/local/lib64/:/u01/app/oracle/product/11.2.0/xe/lib/
I also tried export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib/
so that it yields
/u01/app/oracle/product/11.2.0/xe/lib/
some listing command:
find /u01/app/oracle/product/11.2.0/xe/lib/ -name lib*
yields the following:
/u01/app/oracle/product/11.2.0/xe/lib/
/u01/app/oracle/product/11.2.0/xe/lib/libagtsh.so.1.0
/u01/app/oracle/product/11.2.0/xe/lib/libcell11.so
/u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1
/u01/app/oracle/product/11.2.0/xe/lib/libnnz11.so
/u01/app/oracle/product/11.2.0/xe/lib/libocci.so.11.1
/u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so
/u01/app/oracle/product/11.2.0/xe/lib/libocci.so
/u01/app/oracle/product/11.2.0/xe/lib/libagtsh.so
and some others....
however the compile command says ld cannot find some libraries:
g++ -o ab -I/u01/app/oracle/product/11.2.0/xe/rdbms/public/ -lnnz11 -lclntsh -locci a.cpp
/usr/bin/ld: cannot find -lnnz11
/usr/bin/ld: cannot find -lclntsh
/usr/bin/ld: cannot find -locci
collect2: error: ld returned 1 exit status
I have tried adding -L/u01/app/oracle/product/11.2.0/xe/lib/, it successfully compiles however running the program will cause it silently crashes / blocks at the simple line
Environment *env = Environment::createEnvironment();
no exceptions caught.
Does anyone know some part I did wrong? or are the two issues related?
And by the way, it USED to work like 5 hours ago, when it suddenly stopped working I reinstalled the whole VM and now it still doesn't work.
however the compile command says ld cannot find some libraries: g++ -o ab -I/u01/app/oracle/product/11.2.0/xe/rdbms/public/ -lnnz11 -lclntsh -locci a.cpp
Your command is incorrect (and the linker is right to complain). You need to tell the linker where to find the library, and you do that with -L flag:
ORACLE=/u01/app/oracle/product/11.2.0/xe
g++ -I ${ORACLE}/rdbms/public -L ${ORACLE}/lib a.cpp -lnnz11 -lclntsh -locci
(Note that your placement of source after library is also incorrect, and I fixed it above. Placement of libraries and sources on link command line matters.)

Installing Circos: Problems installing GD module on Mac OS

I would like to install Circos. I followed the instructions on Circos website. In particular, I checked for missing perl modules. I'm missing several of them:
missing Font::TTF::Font
missing GD
missing GD::Polyline
missing SVG
missing Statistics::Basic
missing Text::Format
So I followed again the instructions about Installing Perl Modules on Mac OS X on Circos website. Specifically, I followed the detailed instructions in Paulo Nuin's blog post. Freetype and Fontconfig were missing and I installed them.
Now, when I run the configuration for libgd-2.2.1, I get this configuration summary:
Support for Zlib: yes
Support for PNG library: yes
Support for JPEG library: yes
Support for WebP library: no
Support for TIFF library: no
Support for Freetype 2.x library: yes
Support for Fontconfig library: yes
Support for Xpm library: no
Support for liq library: no
Support for pthreads: yes
It looks good enough to me. But when I run the make, I get errors:
clang: warning: argument unused during compilation: '-pthread'
ld: malformed 64-bit a.b.c.d.e version number: 4.20201
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libgd.la] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
Since it was not working, I followed this recommendation on Stackoverflow and I ran
brew install gd
(I had to update brew by doing
cd /usr/local/Library
git pull origin master
following this answer on Stackoverflow.)
But I get an error:
Error: You must `brew link libpng freetype` before gd can be installed
And when I run 'brew link libpng freetype', I get another error:
Linking /usr/local/Cellar/libpng/1.6.21...
Error: Could not symlink bin/libpng-config
Target /usr/local/bin/libpng-config
already exists. You may want to remove it:
rm '/usr/local/bin/libpng-config'
To force the link and overwrite all conflicting files:
brew link --overwrite libpng
To list all files that would be deleted:
brew link --overwrite --dry-run libpng
Any solution to finally be able to run Circos?
Thanks in advance for your help!
Finally, I solved the problem by changing the permissions in /usr/local:
sudo chown -R $(whoami) /usr/local
Following the recommendations on brew webpage.
Once this was solved, I just installed GD in Perl, as described in the last step in Paulo Nuin's post.

Enabling the gold linker on Freebsd

I have been trying to enable the gold linker on FreeBSD to use the link time optimizations. I made gold from the binutils under /usr/ports. After building binutils using make -k install clean i got ld under /usr/bin and in the directory /usr/local/bin i got ld, ld.gold and ld.bfd.
Now while trying to use link time optimization for the simple example programs here http://llvm.org/docs/GoldPlugin.html (a.c and b.c under the heading 'Examples of Link Time Optimization') i entered the four commands as follows:
clang -flto a.c -c -o a.o
ar q a.a a.o
clang b.c -c -o b.o
clang -flto a.a b.o -o main
I got the following error:
usr/bin/ld: unrecogonized option '-plugin'
usr/bin/ld: use the --help option for usage information
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there the problem with the linker that ld.gold is not being called. Should I replace the ld with ld.gold? Does the linker looks in the right directiry for the .so plugins?
The LLVMgold.so and libLTO.so shared objects are in the directory /usr/local/llvm-devel/lib/.
I cannot find the directory where clang is installed. I am not sure where to make the bfd-plugins directory and add the symlinks to LLVMgold.so and libLTO.so.
I am using freebsd 10.1 release. How to enable the gold linker for link time optimizations?
also how can I enable it to be the default linker?
You may want to use ld.gold instead of ld. It is installed at /usr/local/bin/ld.gold. If you are using a Makefile, it would work by setting LD variable to ld.gold, either by modifying your Makefile or specifying it on command line. Example in case you are using lang/clang37:
gmake all CC=clang37 LD=ld.gold
EDIT:
It would be even more neat if you add -fuse-ld=gold to your LDFLAGS:
LDFLAGS=-fuse-ld=gold
I'm not sure ld.bfd allows plugins, but I could be wrong.
Your /usr/bin/ld should be a symlink to whatever linker you want. You can change which linker is used by using binutils-config. Check the man-page here: http://www.linuxhowtos.org/manpages/8/binutils-config.htm. I realise this is a Linux link, but it's directed at binutils itself rather than linux-specifically.
It should be something along the lines binutils-config --gold.
On my Gentoo box it is binutils --linker=gold
EDIT: As pointed out, binutils-config doesn't work on BSD it seems. You can still manually update the symlinks though, the downside is that there might be a few of them.
You can find out which ld is used by your compiler by using gcc -print-prog-name=ld or clang -print-prog-name=ld. The file printed should be a symlink you can re-create to point to ld.gold as oposed to ld.bfd.

Errors due to vowpal wabbit's dependencies on boost library

I'm trying real hard to install vowpal wobbit and it fails when i run the make file, throwing:
cd library; make; cd ..
g++ -g -o ezexample temp2.cc -L ../vowpalwabbit -l vw -l allreduce -l boost_program_options -l z -l pthread
ld: library not found for -lboost_program_options collect2: ld returned 1 exit status make[1]: *** [ezexample] Error 1'
I then added the links to the boost library here by specifying -L/usr/local/lib
Now I get the following error:
g++ -g -o ezexample temp2.cc -L/usr/local/lib ../vowpalwabbit -l vw -l allreduce -l boost_program_options -l z -l pthread
ld: library not found for -lvw
collect2: ld returned 1 exit status
make: *** [ezexample] Error 1
I happened to get everything working on OS X 10.7 as follows:
Make sure you have a working Boost installation. As indicated on the Getting started page, usually we only need header files, but some Boost libraries must be built separately, including the program_options library which is used to process options from command line or config file. Go into your boost folder, and then at your shell prompt:
$ ./bootstrap.sh
$ ./bjam
This will compile and build everything. You should now have a bin.v2/ directory in your boost directory, with all built libraries for your system (static and threaded libs).
$ ls bin.v2/libs/
date_time iostreams python serialization test
filesystem math random signals thread
graph program_options regex system wave
More importantly, extra Boost libraries are made available in the stage/lib/ directory. For me, these are Mach-O 64-bit dynamically linked shared library x86_64.
The include path should be your_install_dir/boost_x_xx_x, where boost_x_xx_x is the basename of your working Boost. (I personally have boost_1_46_1 in /usr/local/share/ and I symlinked it to /usr/local/share/boost to avoid having to remember version number.) The library path (for linking) should read your_install_dir/boost_x_xx_x/stage/lib. However, it might be best to symlink or copy (which is what I did) everything in usual place, i.e. /usr/local/include/boost for header files, and /usr/local/lib for libraries.
Edit the Makefile from the vowpal_wabbit directory, and change the include/library paths to reflect your current installation. The Makefile should look like this (first 12 lines):
COMPILER = g++
UNAME := $(shell uname)
ifeq ($(UNAME), FreeBSD)
LIBS = -l boost_program_options -l pthread -l z -l compat
BOOST_INCLUDE = /usr/local/include
BOOST_LIBRARY = /usr/local/lib
else
LIBS = -l boost_program_options -l pthread -l z
BOOST_INCLUDE = /usr/local/share/boost # change path to reflect yours
BOOST_LIBRARY = /usr/local/share/boost/stage/lib # idem
endif
Then, you are ready to compile vowpal_wabbit (make clean in case you already compiled it):
$ make
$ ./vw --version
6.1
$ make test
You can also install vowpal wabbit on OS X using brew:
brew install vowpal-wabbit
Or you can just install boost, and then install vw from the github repo.
brew install boost
For installation on CentOS 7 (6.5 perl version is too old for latest vw source code), I've found the instructions at http://wkoplitz.blogspot.be/2012/12/vowpal-wabbit-on-centos.html to work fine:
yum install zlib-devel boost-devel
yum groupinstall "Development Tools"
git clone git://github.com/JohnLangford/vowpal_wabbit.git
cd vowpal_wabbit
./autogen.sh
make
make test
Good news:
As of the latest release VowpalWabbit version 9.1.0, vw no longer relies on Boost program_options
From the release highlights:
Removal of Boost Program Options dependency
For a long time we have depended on Boost Program Options
for command line options parsing. In this release, we have > replaced this dependency with our own implementation of
command line parsing. Apart from one place where we depend > on Boost Math in standalone mode, this means that VW core
and the command line tool are free of Boost dependencies
hopefully making the code a bit easier to build and package.
Vowpal Wabbit 9.1.0 release notes

Resources