Installing/cross compiling programs

Holds topics that document the NAS box's features and any related procedures. Stuff in here should eventually make it into a specification or the user guide.
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Using the cross compiler

Post by hamishmb »

Installing Matplotlib

Download the tarball for v3.2.1 from https://pypi.org/project/matplotlib/#files.

To build, run:

Code: Select all

CC="arm-unknown-linux-gnueabi-gcc --sysroot=/home/wmt/nas-sysroot" CXX="arm-unknown-linux-gnueabi-g++ --sysroot=/home/wmt/nas-sysroot" CFLAGS="-I/home/wmt/nas-sysroot/usr/local/include -I/home/wmt/nas-sysroot/usr/local/include/freetype2" LD_LIBRARY_PATH="/home/wmt/nas-sysroot/lib:/home/wmt/nas-sysroot/usr/local/lib" qemu-arm-static -L /home/wmt/nas-sysroot ~/nas-sysroot/usr/local/bin/python3 setup.py build
This takes quite a long time to build, because of having to use QEMU, but also a lot of C and C++ files have to be compiled. It also seems to think it's building for armv7l, but it is building for armv5te as needed - don't be concerned by the warning.

To install, run:

Code: Select all

sudo chmod a+rwx /home/wmt/nas-sysroot/usr/local/lib/python3.7/site-packages/setuptools.pth
CC="arm-unknown-linux-gnueabi-gcc --sysroot=/home/wmt/nas-sysroot" CXX="arm-unknown-linux-gnueabi-g++ --sysroot=/home/wmt/nas-sysroot" CFLAGS="-I/home/wmt/nas-sysroot/usr/local/include -I/home/wmt/nas-sysroot/usr/local/include/freetype2" LD_LIBRARY_PATH="/home/wmt/nas-sysroot/lib:/home/wmt/nas-sysroot/usr/local/lib" qemu-arm-static -L /home/wmt/nas-sysroot ~/nas-sysroot/usr/local/bin/python3 setup.py install
Attached are my notes for which dependencies I did and didn't install, in case we need them later.
Attachments
matplotlib notes.txt
(872 Bytes) Downloaded 75 times
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Installing/cross compiling programs

Post by hamishmb »

Installing psutil (dependency for river system software, used when monitoring system load)

Download the tarball for v5.7.0 from https://pypi.org/project/psutil/#files.

To build, run:

Code: Select all

CC="arm-unknown-linux-gnueabi-gcc --sysroot=/home/wmt/nas-sysroot" CXX="arm-unknown-linux-gnueabi-g++ --sysroot=/home/wmt/nas-sysroot" LD_LIBRARY_PATH="/home/wmt/nas-sysroot/lib:/home/wmt/nas-sysroot/usr/local/lib" qemu-arm-static -L /home/wmt/nas-sysroot ~/nas-sysroot/usr/local/bin/python3 setup.py build
This is very quick to build. It seems to think it's building from armv7l, but it is building for armv5te as needed - don't be concerned by the warning.

To install, run:

Code: Select all

sudo CC="arm-unknown-linux-gnueabi-gcc --sysroot=/home/wmt/nas-sysroot" CXX="arm-unknown-linux-gnueabi-g++ --sysroot=/home/wmt/nas-sysroot" LD_LIBRARY_PATH="/home/wmt/nas-sysroot/lib:/home/wmt/nas-sysroot/usr/local/lib" qemu-arm-static -L /home/wmt/nas-sysroot ~/nas-sysroot/usr/local/bin/python3 setup.py install
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Installing/cross compiling programs

Post by hamishmb »

Installing xinetd (dependency for river system software, used to serve the time)

Download the tarball for v2.3.15 from https://github.com/xinetd-org/xinetd/releases. This is old, but in sync with Debian Buster (so in sync with what Sump Pi is running at the time of writing).

To configure, run:

Code: Select all

./configure --host=arm-unknown-linux-gnueabi --target=arm-unknown-linux-gnueabi --build=x86_64-linux-gnu CC="arm-unknown-linux-gnueabi-gcc --sysroot=/home/wmt/nas-sysroot" CXX="arm-unknown-linux-gnueabi-g++ --sysroot=/home/wmt/nas-sysroot" LD="arm-unknown-linux-gnueabi-ld --sysroot=/home/wmt/nas-sysroot" --prefix=/home/wmt/nas-sysroot/usr/local
To build, run the usual command.

To install, run:

Code: Select all

sudo PATH="/home/wmt/x-tools/arm-unknown-linux-gnueabi/bin:$PATH" make DESTDIR=/home/wmt/nas-sysroot install
Configuration

Create~/nas-sysroot/etc/xinetd.conf and fill with the contents of the attached file.
Attachments
xinetd.conf.txt
(4.8 KiB) Downloaded 73 times
Hamish
Post Reply