LaosLaser / Firmware

Embedded software (firmware) for the laser system and components, including configuration files
27 stars 27 forks source link

Build failure #58

Closed peteruithoven closed 8 years ago

peteruithoven commented 8 years ago

On a fresh Ubuntu installation (through Docker), after following the steps in the Readme and running workspace_tools/build.py I get the following error:

 Building library CMSIS (LPC1768, GCC_ARM)
Copy: core_cm3.h
Copy: core_cm0plus.h
Copy: core_cm0.h
Copy: core_ca_mmu.h
Copy: core_cmInstr.h
Copy: core_caFunc.h
Copy: core_caInstr.h
Copy: core_cm4.h
Copy: core_cmFunc.h
Copy: core_cm4_simd.h
Copy: core_ca9.h
Copy: cmsis_nvic.h
Copy: system_LPC17xx.h
Copy: cmsis.h
Copy: LPC17xx.h
Copy: LPC1768.ld
[Errno 2] No such file or directory

Completed in: (0.01)s

  Build failures:
  * GCC_ARM::LPC1768
# cat workspace_tools/private_settings.py
GCC_ARM_PATH = "/home/gcc-arm-none-eabi-4_9-2015q3/bin/"
# ls /home/gcc-arm-none-eabi-4_9-2015q3/bin/
arm-none-eabi-addr2line  arm-none-eabi-cpp        arm-none-eabi-gcc-ar      arm-none-eabi-gdb-py  arm-none-eabi-objcopy  arm-none-eabi-strings
arm-none-eabi-ar         arm-none-eabi-elfedit    arm-none-eabi-gcc-nm      arm-none-eabi-gprof   arm-none-eabi-objdump  arm-none-eabi-strip
arm-none-eabi-as         arm-none-eabi-g++        arm-none-eabi-gcc-ranlib  arm-none-eabi-ld      arm-none-eabi-ranlib
arm-none-eabi-c++        arm-none-eabi-gcc        arm-none-eabi-gcov        arm-none-eabi-ld.bfd  arm-none-eabi-readelf
arm-none-eabi-c++filt    arm-none-eabi-gcc-4.9.3  arm-none-eabi-gdb         arm-none-eabi-nm      arm-none-eabi-size

I've downloaded the latest linux installation tarball from https://launchpad.net/gcc-arm-embedded/: https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2

peteruithoven commented 8 years ago

Also tried the 4.9-2015-q2, 4.9-2015-q1 and 4.8-2014-q1 (the one mentioned in the Readme) releases.

peteruithoven commented 8 years ago

Jaap mentioned once that I might need to install libc6:i386, but I can't:

# apt-get update
# apt-get install libc6:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libc6
peteruithoven commented 8 years ago

I get the same error when I change the GCC_ARM_PATH into something that really doesn't exist. I tried moving the gcc-arm-none-eabi-4_9-2015q3 folder to the /root folder and link to that, same result. I tried to use the path without the / in front. I tried moving the gcc-arm-none-eabi-4_9-2015q3 folder in the mbed folder and using gcc-arm-none-eabi-4_9-2015q3/bin as path.

peteruithoven commented 8 years ago

Using Ubuntu 14.04.3 LTS btw.

jrv commented 8 years ago

If you didn't even get as far as compiling LaOS firmware, it's not a LaOS problem. Please read the fine manual on MBED/GCC-arm and if it really doesn't work, complain there. Of course you're welcome to improve the LaOS documentation with tips to make life easier for newbies.

joostn commented 8 years ago

Hi Peter, try: apt-get install libc-i386 I remember vaguely running into exactly these error messages when running a 32 bit gcc-arm on a 64 bit system.

Also see here: http://askubuntu.com/questions/325669/how-to-detect-missing-dependencies-for-an-executable

joostn commented 8 years ago

BTW here's the Dockerfile I used for LAOS (it's been a while ago I've used it though):

FROM ubuntu:13.10

RUN apt-get update &&\
    apt-get install -y sudo unzip python wget nano bzip2 patch lib32z1 lib32ncurses5 lib32bz2-1.0

RUN mkdir /launchpad && \
    cd /launchpad && \
    wget --no-check-certificate https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q2-update/+download/gcc-arm-none-eabi-4_8-2014q2-20140609-linux.tar.bz2 -O - | tar -xj

ADD LaosFirmware /Firmware

RUN cd /Firmware/mbed/ && \
    patch -p1 < ../laser/mbed.patch

RUN echo 'GCC_ARM_PATH = "/launchpad/gcc-arm-none-eabi-4_8-2014q2/bin/"' > /Firmware/mbed/workspace_tools/private_settings.py

RUN python /Firmware/mbed/workspace_tools/build.py -m LPC1768 -t GCC_ARM -r -e -u -c
RUN ln -s  /Firmware/laser /Firmware/mbed/libraries/tests/net/protocols/ && \
    python /Firmware/mbed/workspace_tools/make.py -m LPC1768 -t GCC_ARM -n laser

Then build using the following bash script:

#!/bin/bash

set -e

docker build -t laosfirmwarebuilder .
docker run -i laosfirmwarebuilder cat /Firmware/mbed/build/test/LPC1768/GCC_ARM/laser/laser.bin > laser.bin
peteruithoven commented 8 years ago

Good point @jrv. Thanks for the tip @joostn, installing libc6-i386did the trick, I can now compile the image in the Ubuntu Docker instance.