Compilation error

 

To comment on questions or provide answers, please login first.
Register | Login

 

Trevor Miles asked 6 years ago

Anyone run into this error when executing the “./create” script? If so, what am I doing incorrectly?
 
cp check_functionality logg bin
make[1]: Leaving directory ‘/home/pi/moitessier/app/sensors’
make: Leaving directory ‘/home/pi/moitessier/app’
******************************************************************************************
Compiling device tree…
******************************************************************************************
./create: line 99: ../kernel/scripts/dtc/dtc: No such file or directory
******************************************************************************************
ERROR occured!!
Compiling device tree failed

2 Answers
Thomas Staff answered 6 years ago

You need to compile the linux kernel first, otherwise the script “create” does not find the proper files.
make distclean ARCH=arm
KERNEL=kernel7
make bcm2709_defconfig ARCH=arm
make -j2 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage dtbs module
 
 
 
 

Trevor Miles replied 6 years ago

Thx Thomas. I did not see this included in the README. Did I miss it, or are you assuming a level of knowledge I do not possess?

Trevor Miles replied 6 years ago

OK, guessing it is a knowledge thing. When I type “make distclean ARCH=arm” in a terminal window I get the following error.

pi@openplotter:~ $ cd moitessier
pi@openplotter:~/moitessier $ make distclean ARCH=arm
make: *** No rule to make target ‘distclean’. Stop.

Any pointers would be much appreciated.

Thomas Staff replied 6 years ago

Maybe it is not clear for everybody, that the kernel module and the device tree needs to be cross-compiled. Therefore it needs to be referenced to the proper kernel sources, which holds the relevant information for the compilation.

See http://downloads.rooco.eu/moitessier/Moitessier_HAT_Software_Compilation_Installation.pdf
This might help you to get the sources compiled.

I’m currently setting up a virtual machine that will make things easier.

Regards,
Thomas

Trevor Miles replied 6 years ago

Thx Thomas. Can I run this all on the RPi, or are you assuming that I have access to a Linux machine? Other than the RPI I only have Windows machines.

Thomas Staff replied 6 years ago

Commands with host> are executed on a linux development machine (or virtual machine), commands with pi> are executed on the Raspberry Pi.
host> and pi> are not part of the command, but should indicate that these are executed in a terminal/shell.

You could compile the sources on the Pi as well (with slightly modified commands to compile the kernel), but this would take quite long and is not recommended.
I will upload the virtual machine in the next days, which can be used under Windows.

Regards,
Thomas

Trevor Miles replied 6 years ago

Thx

Trevor Miles replied 6 years ago

So I built my own virtual Ubuntu machine on Windows 10 using VirtualBox and everything works well until I get to the part where I am supposed to compile the kernel by issuing the command “make distclean ARCH=arm”. I get an error “gcc: command not found”. When I then type “$PATH”, assuming this is the source of the error, I get:
$PATH
bash: /bin:/usr/bin:/home/trevor/Desktop/Raspberry/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin: No such file or directory

I can get to the “bin” folder and when I run “ls” in this folder I get the following:
trevor@trevor-VirtualBox:~/Desktop/Raspberry/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin$ ls
arm-linux-gnueabihf-addr2line arm-linux-gnueabihf-gfortran
arm-linux-gnueabihf-ar arm-linux-gnueabihf-gprof
arm-linux-gnueabihf-as arm-linux-gnueabihf-ld
arm-linux-gnueabihf-c++ arm-linux-gnueabihf-ld.bfd
arm-linux-gnueabihf-c++filt arm-linux-gnueabihf-ldd
arm-linux-gnueabihf-cpp arm-linux-gnueabihf-ld.gold
arm-linux-gnueabihf-ct-ng.config arm-linux-gnueabihf-nm
arm-linux-gnueabihf-dwp arm-linux-gnueabihf-objcopy
arm-linux-gnueabihf-elfedit arm-linux-gnueabihf-objdump
arm-linux-gnueabihf-g++ arm-linux-gnueabihf-pkg-config
arm-linux-gnueabihf-gcc arm-linux-gnueabihf-pkg-config-real
arm-linux-gnueabihf-gcc-4.8.3 arm-linux-gnueabihf-ranlib
arm-linux-gnueabihf-gcc-ar arm-linux-gnueabihf-readelf
arm-linux-gnueabihf-gcc-nm arm-linux-gnueabihf-size
arm-linux-gnueabihf-gcc-ranlib arm-linux-gnueabihf-strings
arm-linux-gnueabihf-gcov arm-linux-gnueabihf-strip
trevor@trevor-VirtualBox:~/Desktop/Raspberry/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin$

There is a “arm-linux-gnueabihf-gcc”, but NOT a “gcc”

Ideas?

Thomas Staff replied 6 years ago

Hi Trevor,

I use Debian, not Ubuntu. So it might be necessary that some packages are still missing. However, gcc should be installed on any distribution. If not install it: sudo apt-get install gcc
You might also need to install “make”.

The correct command is “echo $PATH” not “$PATH”.

To check if the system can find your compiler call:
which arm-linux-gnueabihf-gcc
and
which gcc

Trevor Miles replied 6 years ago

Thx Thomas, progress was made, but still not all the way.

trevor@trevor-VirtualBox:~/Desktop/Raspberry$ which gcc
/usr/bin/gcc
trevor@trevor-VirtualBox:~/Desktop/Raspberry$ which arm-linux-gnueabihf-gcc
/home/trevor/Desktop/Raspberry/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
trevor@trevor-VirtualBox:~/Desktop/Raspberry$ cd kernel
trevor@trevor-VirtualBox:~/Desktop/Raspberry/kernel$ make distclean ARCH=arm
trevor@trevor-VirtualBox:~/Desktop/Raspberry/kernel$ KERNEL=kernel7
trevor@trevor-VirtualBox:~/Desktop/Raspberry/kernel$ make bcm2709_defconfig ARCH=arm
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
trevor@trevor-VirtualBox:~/Desktop/Raspberry/kernel$ make -j2 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage dtbs modules
./scripts/gcc-version.sh: line 26: /home/trevor/Desktop/Raspberry/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc: No such file or directory
./scripts/gcc-version.sh: line 27: /home/trevor/Desktop/Raspberry/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc: No such file or directory
make: arm-linux-gnueabihf-gcc: Command not found
make: arm-linux-gnueabihf-gcc: Command not found
make: arm-linux-gnueabihf-gcc: Command not found

Thomas Staff replied 6 years ago

Have you called the following commands?
echo PATH=\$PATH:~/Desktop/Raspberry/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin >> ~/.bashrc

source ~/.bashrc

Try to restart your system and start compilation again.

Trevor Miles replied 6 years ago

I’m going to start over with a Debian VM

Thomas Staff replied 6 years ago

If you have time to wait, the upload of the vm will be finished on Monday.

Trevor Miles replied 6 years ago

Thx Thomas, I am bashing my head against the wall.

Trevor Miles replied 6 years ago

Just so you know where I run into an error.

trevor@debian:~/Desktop/Raspberry/kernel$ make distclean ARCH=arm
CLEAN scripts/basic
CLEAN scripts/kconfig
CLEAN include/config include/generated
trevor@debian:~/Desktop/Raspberry/kernel$ KERNEL=kernel7
trevor@debian:~/Desktop/Raspberry/kernel$ make bcm2709 defconfig ARCH=arm
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf –silentoldconfig Kconfig
***
*** Configuration file “.config” not found!
***
*** Please run some configurator (e.g. “make oldconfig” or
*** “make menuconfig” or “make xconfig”).
***
scripts/kconfig/Makefile:38: recipe for target ‘silentoldconfig’ failed
make[3]: *** [silentoldconfig] Error 1
Makefile:512: recipe for target ‘silentoldconfig’ failed
make[2]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target ‘bcm2709’. Stop.
Makefile:264: recipe for target ‘__build_one_by_one’ failed
make: *** [__build_one_by_one] Error 2

Thomas Staff replied 6 years ago

The command should be: make bcm2709_defconfig ARCH=arm

An underscore is missing!!

Trevor Miles replied 6 years ago

The PDF version of the instructions does not show an underscore, but if I cope the text the underscore shows up.

Thomas Staff replied 6 years ago

This might be an issue with your PDF reader.

Thomas Staff answered 6 years ago

Use our virtual machine with preinstalled toolchain and sources: http://downloads.rooco.eu/moitessier/vm.zip

Trevor Miles replied 6 years ago

Hi Thomas, sorry, I need a bit more instruction.
– Where do I install the VM? Recall that I have Windows machines, one of which is running VirtualBox.
– What commands in the instructions do I need to use with the VM?

Thomas Staff replied 6 years ago

I’ve updated the document: http://downloads.rooco.eu/moitessier/Moitessier_HAT_Software_Compilation_Installation.pdf

Read chapter 1.6.
You can use the VM in Windows, you just need VirtualBox. The instructions are found in the PDF.

The sources and the toolchain are preinstalled in the VM, so you just need to update the sources (optional) prior compilation. The required instructions for package creation are listed in section 1.3 to 1.5.

Trevor Miles replied 6 years ago

Thx Thomas. I am in the process of downloading the ZIP, which is going to take 5 hours!! In the mean time I thought I’s spin up a Google Cloud instance and try on there. It fails at exactly the same location, namely on “make -j2 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage dtbs modules”. It cannot find the arm-linux-gnueabihf-gcc compiler. When I run “which arm-linux-gnueabihf-gcc” I get the correct result of “home/trevor_ian_miles/Desktop/Raspberry/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc”.

If I simply run the command “arm-linux-gnueabihf-gcc” I get an error “No such file or directory”, which is the error I get when I run make. I’ve navigated to the “bin” folder and run “ls” and I can confirm that the file is exactly where I would expect it to be, and is displayed in a light blue color along with c++ and ld, while all the other files are in a green. I don’t know if this is of significance.
The only other thing I noticed is that the “echo PATH” statement refers to “bcm2708” whereas the “make” statement refers to “bcm2709”.

Trevor Miles replied 6 years ago

I just googled the colors, and it seems that Debian thinks that “arm-Linux-gnueabihf-gcc” is a folder: http://pthakkar.com/2013/03/linux-color-files-ls-command/
Is there a step missing after the “git clone” for toolchain?

Trevor Miles replied 6 years ago

BTW, I did try to cd into “arm-linux-gnueabihf-gcc”, but got a message that it isn’t a folder.

Thomas Staff replied 6 years ago

There must be something wrong with your installation and it is not possible to find the issue without having access to your system. Please use the provided VM and don’t set up your own system unless you have advanced experience with Linux.

If you still want to solve the issue for your virtual machine, please use e-mail communication, otherwise, this thread gets completely confusing for others.

Regards,
Thomas

Trevor Miles replied 6 years ago

ok

 

To comment on questions or provide answers, please login first.
Register | Login