Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

Smart.js build fails on RPI

Zille MeierZille Meier Charlottesville
the latest git clone repo does not build successfully on RPI (update and upgraded debian wheezy 7.9)
performed this: "git clone https://github.com/cesanta/smart.js.git"
and then: "make" as root

Got the following message (s.th. missing in initializer)
root@raspberrypi:/home/pi/smart.js/smartjs/platforms/posix# make
make[1]: Entering directory '/home/pi/smart.js/v7'
make[1]: Nothing to be done for 'v7.c'.
make[1]: Leaving directory '/home/pi/smart.js/v7'
  CC lnx_gpio.c -> build/lnx_gpio.o
lnx_gpio.c: In function ‘gpio_export’:
lnx_gpio.c:22:10: error: missing initializer [-Werror=missing-field-initializers]
lnx_gpio.c:22:10: error: (near initialization for ‘s.__pad1’) [-Werror=missing-field-initializers]
lnx_gpio.c: In function ‘gpio_set_edge’:
lnx_gpio.c:113:3: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
cc1: all warnings being treated as errors
Makefile:142: recipe for target 'build/lnx_gpio.o' failed
make: *** [build/lnx_gpio.o] Error 1


Comments

  • Hi!
    Did you try to use `smartjs/platforms/posix/makearm.sh` instead of base `make`?
    This is script for compilation for ARM on x86 (i.e cross-compilation). 
    Basically, it is general way for compilation for ARM.
    I just tried - works OK (for me, of course)
  • Zille MeierZille Meier Charlottesville
    this "./makearm.sh" only bring me to the docker help screen:
    root@raspberrypi:/home/pi/smart.js/smartjs/platforms/posix# ./makearm.sh
    docker - version 1.4
    Copyright 2003, Ben Jansens <ben@orodu.net>

    Usage: docker [OPTIONS]

    Options:
      -help             Show this help.
      -display DISPLAY  The X display to connect to.
      -border           The width of the border to put around the
                        system tray icons. Defaults to 1.
      -vertical         Line up the icons vertically. Defaults to
                        horizontally.
      -wmaker           WindowMaker mode. This makes docker a
                        fixed size (64x64) to appear nicely in
                        in WindowMaker.
                        Note: In this mode, you have a fixed
                        number of icons that docker can hold.
      -iconsize SIZE    The size (width and height) to display
                        icons as in the system tray. Defaults to
                        24.
      -color COLOR      The background color to use for the tray.
                        Defaults to whatever color the window
                        manager specifies.
    root@raspberrypi:/home/pi/smart.js/smartjs/platforms/posix#


  • Zille MeierZille Meier Charlottesville
    some more:
    root@raspberrypi:/home/pi/smart.js/smartjs/platforms/posix# cat makearm.sh
    #!/bin/sh

    SDK=$(cat arm_sdk.version)
    DEVDIR=$(dirname $(dirname $(dirname $PWD)))

    # Note: "//" in "//bin/bash" is a workaround for a boot2docker bug on Windows.
    exec docker run --rm -it -v ${DEVDIR}:/cesanta ${SDK} //bin/bash -c "cd /cesanta/smartjs/platforms/posix && make $@"

    root@raspberrypi:/home/pi/smart.js/smartjs/platforms/posix# cat arm_sdk.version
    docker.cesanta.com:5000/eabihf-arm-build:r1

  • Actually, `makearm.sh` is intended to run on host (x86) machine.
    The Docker you have on RPI isn't docker you need to build.
    It is another packet: http://icculus.org/openbox/2/docker/

    So, you can try to install docker (this - https://www.docker.com/) on RPI, but I cannot recommend this.
    Also, you can try to build smart.js directly on ARM (w/out docker), but in order to do this, you need to install a lot of dependencies and ESP SDK.
    I.e. the best option - install Docker on PC, build FW and copy it to RPI.
Sign In or Register to comment.