NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Attempting to Setup ARM Boost cross compiler in Ubuntu

Solved!
Go to solution

I have the NI Library from this link downloaded and installed along with the source code to Boost 1.69

 

http://www.ni.com/download/labview-real-time-module-2017/6760/en/

 

https://www.boost.org/doc/libs/1_69_0/

 

I untar the boost library, started to bootstrap.sh , in order to ready the system to compile a copy of the boost libraries that I can use on the NICRio i have... but I am having trouble getting bootstrap.sh and corresponding b2, to tie into the NI provided gcc... anyone have some tips?  System is Ubuntu 18.04 LTS if it matters.

0 Kudos
Message 1 of 3
(6,487 Views)
Solution
Accepted by topic author jimmyjohns

After much gnashing of teeth, I successfully got the NICrio provided gcc cross compiler to arm... working with compiling the Boost Library (only dynamically at this moment, not yet gotten static builds of the library yet)

 

Steps to do this yourself :

Download the aforementioned Boost library, and NICrio compilers to a Debian/Ubuntu environment.  I used Ubuntu 18.04 LTS.

 

 

run <build_root_dir>/bootstrap.sh

next, you need to customize the build process so that you can call out for the NICRio's provided ARM cross compiler..

 

 

customize/create the following file:

<build_root_dir>/tools/build/src/user-config.jam

import os ;

ni_arm_gcc_root = /usr/local/oecore-x86_64 ;

using gcc : arm : $(ni_arm_gcc_root)/sysroots/x86_64-nilrtsdk-linux/usr/bin/arm-nilrt-linux-gnueabi/arm-nilrt-linux-gnueabi-g++ : <root>$(ni_arm_gcc_root)/sysroots/x86_64-nilrtsdk-linux/usr/bin <compileflags>--sysroot="$(ni_arm_gcc_root)/sysroots/cortexa9-vfpv3-nilrt-linux-gnueabi" <compileflags>-std=c++11 <compileflags>-I"$(ni_arm_gcc_root)/sysroots/cortexa9-vfpv3-nilrt-linux-gnueabi/usr/include/c++/4.9.2" <compileflags>-I"$(ni_arm_gcc_root)/sysroots/cortexa9-vfpv3-nilrt-linux-gnueabi/usr/include/c++/4.9.2/arm-nilrt-linux-gnueabi" <compileflags>-mfpu=vfpv3 <compileflags>-mfloat-abi=softfp <linkflags>-L"$(ni_arm_gcc_root)/sysroots/cortexa9-vfpv3-nilrt-linux-gnueabi/usr/lib" <linkflags>--sysroot="$(ni_arm_gcc_root)/sysroots/cortexa9-vfpv3-nilrt-linux-gnueabi" ;

 you now should have all you need to build boost library for ARM on NICrios.. execute the build by this command

 

./b2 --toolset=gcc-arm --address-model=64 --architecture=arm --stagedir=./some_stage_dir_ARM64 --withoutpython --without-context --variant=release

full disclosure, I think some of those parameters are for the regular gcc, which has great support from Boost library and it's default build system.. but I am unsure and not confident that they work when you misdirect the build to use the NICrio cross compiler for ARM... that being said, it worked.. albeit I cannot seem to invoke options like static 

 

--link=static

they don't seem to affect the build that comes out

 

Once this all finishes, you should have a build in your stage dir.. you can now copy that lib folder or reference it in whatever C++ programs you were using with Boost.. for usage on an ARM NICrio

Message 2 of 3
(6,445 Views)

works for me! Thank you for posting your solution on that!

 

This is IMHO worth an entry in knowledge.ni.com or the getting startet tutorial (http://www.ni.com/tutorial/14625/) since boost is widely used in c++ applications.

 

0 Kudos
Message 3 of 3
(6,272 Views)