NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

g++: Command not Found

Hi ,

g++ does not exist with that name on ni linux rt target. You should first install it with opkg install g++. And then export alias variables.

For a 64 bit target (exemple PXI88xx) you could define the following variables in environment

:

export CC = x86_64-nilrt-linux-gcc

export CXX = x86_64-nilrt-linux-g++

 

Then be sure to use that variables in your makefile (which is very common).

Regards

 

0 Kudos
Message 11 of 14
(1,525 Views)

Were you ever able to get this cross compiled and working on the cRIO?

0 Kudos
Message 12 of 14
(1,452 Views)

I was able to get Mosquitto installed with TLS with the following combination of things (I might have left something out):

 

 

opkg install g++
opkg install packagegroup-core-buildessential
opkg install packagegroup-core-buildessential-dev
opkg install packagegroup-core-python
opkg install packagegroup-core-full-cmdline
opkg install packagegroup-core-perl

export CC=x86_64-nilrt-linux-gcc
export CXX=x86_64-nilrt-linux-g++

wget https://mosquitto.org/files/source/mosquitto-1.6.12.tar.gz
tar xvf mosquitto-1.6.12.tar.gz

cd mosquitto-1.6.12
make LIB_CFLAGS="-I/usr/include/ -fPIC"
make install

 

 

then I made an init.d script for mosquitto and installed per the instructions here:

 

 

#!/bin/bash

NAME="Mosquitto Startup Script"
DAEMON="/usr/local/sbin/mosquitto"
ARGS=""
USER=mosquitto
PIDFILE=/var/run/mosquitto.pid

do_start() {
        /sbin/start-stop-daemon --start --pidfile $PIDFILE \
                --make-pidfile --background \
                --chuid $USER --exec $DAEMON $ARGS
}

do_stop() {
    /sbin/start-stop-daemon --stop --pidfile $PIDFILE --verbose
}

case "$1" in
  start)
    echo "Starting $NAME"
    do_start
    ;;
  stop)
    echo "Stopping $NAME"
    do_stop
    ;;
  restart)
    echo "Restarting $NAME"
    do_stop
    do_start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
    ;;

esac
exit 0

 

 

So far everything seems to be working. I'll update if I find that I've left something out. 

Message 13 of 14
(1,433 Views)

I've encountered some issues regarding logging and persistence locations. It seems to be related to folder/file permissions and I haven't had a chance to sort through all of that. 

0 Kudos
Message 14 of 14
(1,324 Views)