libmodbus cross compilation and install in Beaglebone - linux

Can any one tell me how I can install and cross-compile libmodbus library(libmodbus.org) for beaglebone??
I tried to compile for my local machine having ubuntu installed in it and the library got installed properly and works fine. But I want to install for beaglebone. I have beaglebone's file system on my local machine(target Network file system)
I want to write a modbus master(client) rtu code and run on the board which i mentioned above. Please guide me for this work.

Manual cross-compilation
You should configure the build system with the prefix of your toolchain (for example arm-none-linux-gnueabi for Sourcery CodeBench ARM 2013.05):
./configure --host=arm-none-linux-gnueabi
(if you can't find confgure script, execute autogen.sh first to create it), build the library:
make
Then copy library files to your rootfs:
cp src/.libs/libmodbus.* path-to-your-rootfs-usr-lib
Buildroot flavor
git clone git://git.busybox.net/buildroot
make beaglebone_defconfig
make menuconfig
And search for libmodbus "Target packages->Libraries->Networking", select it and build the entire rootfs:
make

Related

Building Tensorflow Lite for Linux x86_64 using bazel

As the title says im trying to build TFLite(R2.2) for Linux x86_64, i already have it working for Macosx x86_64, but i cant seem to find any options within the bazel build configs to change the build for linux.
I configure the bazel build by using ./configure and setting all the properties correctly, then use
bazel build //tensorflow/lite/java:libtensorflowlite_jni.so to build the .so
But no matter what options i pass into --config it always builds the .so for the host architecture (Macosx)
If anyone knows how to do this would be grand.
This Reference answers your solution and for linux follow

Clone compiled cmake build to identical hardware

I have successfully compiled opencv 3.1 on a raspberry pi. Developing with the library works perfectly fine. Now I wanted to set up another, identical raspberry with opencv and to save the compilation time, my idea was to copy the binaries to the second raspberry.
So I copied the opencv directories including the build folder and tried to run sudo make install. Instead of using the already compiled files, compilation using cmake starts over again.
How can I convince the second raspberry's build environent that there is no need to recompile everything? On my original raspberry, I can run sudo make install on the exactly same files without recompilation. Installed dev-libraries are the same on both systems. Is this a cmake, make or a opencv specific problem?
I also tried to copy all .so and .h files from /usr/... directories, but then I run into further problems when other cmake projects try to locate the opencv package.
Build directory is not intended to be copied into other place or on another machine.
For deliver program to other machine you should use installed files, or, more generally, a package.
CMake is shipped with CPack, which can build the program from sources and create package contained all its deliverables.
You may create .deb package on the first Raspberry PI machine:
cpack -G DEB <source-dir>
and install it on the second machine using dpkg.
There are also "archive" packages like .tgz or .zip. Full list of CPack generators is described in wiki.

how to install cross compiled programs (thttpd) on arm linux boards

I cross complied thttpd with php for arm linux boards successfully and I got a single file namged thttpd. I copied this file to arm board and ran it successfully with the following command:
thttpd -C CONFIG_FILE // CONFIG_FILE is the path of thttpd configuration file.
the question is: How can I INSTALL the thttpd on the target (here the arm board) to it run automatically, for example as a service. You know when you compile thttpd on normal linux (x86) you can install it using "make install" command, but what can I do on the arm board with the single executable thttpd file?
Offcourse this is my general question that how can I install cross compiled programs on the arm boards?

Advice regarding installing ARM toolchain on Ubuntu VM (64bit)

Trying to compile Linux kernel for arm platform on a Ubuntu virtual machine
$make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
It fails as follows
arm-none-linux-gnueabi-gcc: not found
Tried to install
$sudo apt-get install arm-none-linux-gnueabi-gcc
E: unable to locate package arm-none-linux-gnueabi-gcc
Where to find the correct package? how to include it in the system? (I found a couple of links on line that didn't work for me). It would be great if you could provide a correct solution or reference.
The Ubuntu package names are gcc-arm-linux-gnueabi/gcc-arm-linux-gnueabihf.
For building the kernel, which one you use does not make much difference. For building anything else, "gnueabihf" is the hard-float version. For any modern ARM processor (this statement excludes the Raspberry PI), this is the one you would want.
Download arm-2013.05-24-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 from https://sourcery.mentor.com/GNUToolchain/
or https://sourcery.mentor.com/sgpp/lite/arm/portal/subscription?#template=lite
Get correct version of the arm-none-linux-gnueabi toolchain (i.e. targetting GNU/Linux rather than EABI).
untar it
tar xvf arm-2013.05-24-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
open bashrc
vi .bashrc
at the end add below comand
export PATH=$PATH:{path to toolchain}arm-2013.05/bin
e.g export PATH=$PATH:/home/vinay/under_linux/arm-2013.05/bin
save it and quit the terminal.
then you can cross-compile without everytime export.
Also take of correct toolchain there are two toolchain available choose according to your requirement.
Cross compile error "arm-none-eabi-g++ cannot find entry symbol"

Getting started with libftdi

I want to build a program that communicate with ftdi device from beagleboard XM EzSDK 6.0 board. FTDI provides pre-compiled D2XX library for arm Linux Kernel version 2.6.32. But EzSDK 6.0 uses Linux Kernel 3.3.7. So i downloaded opensource libftdi from http://www.intra2net.com/en/developer/libftdi/download.php
In the ReadMe, They tells
If you are building the release tar ball, just extract the source tar ball.
cd libftdi
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="/usr" ../
make
sudo make install
My query is when i follow above steps, it will create library for development environment (Ubuntu LTS 12.04),right? .
I want to run this program in ezsdk 6.0 board. How to specify target in the cross compilation. I am new to Linux and i need getting started information for this.
xtract the source tar ball.
tar xvjf libftdi1-1.0.tar.bz2
cd libftdi
mkdir build
cd build
//Source the /linux-devkit/environment-setup script to prepare to configure and build the plugins.
source <SDK INSTALL DIR>/linux-devkit/environment-setup
Then follow
cmake -DCMAKE_INSTALL_PREFIX="/usr" ../
make
make install
Thats all..

Resources