What development environment is best to compile

Hello Everyone,

I am brand new to Flukso and am interested in playing with the device. I am trying to compile the source and coming up with a problem that I am hoping to get help on.

  1. make[3]: Leaving directory `/home/ubuntu/workspace/flukso2/bin/flm02.1.4/package/linux-atm'
  2. make[2]: Leaving directory `/home/ubuntu/workspace/flukso2/bin/flm02.1.4'
  3. make[1]: *** [/home/ubuntu/workspace/flukso2/bin/flm02.1.4/staging_dir/target-mips_uClibc-0.9.30.1/stamp/.package_compile] Error 2
  4. make[1]: Leaving directory `/home/ubuntu/workspace/flukso2/bin/flm02.1.4'
  5. make: *** [world] Error 2

It seems this is a known issue - but I can't find a solution.

If I change the target to broadcom (really anything other than Atheros) the compile works. Otherwise I get the error above.

I have tried compiling the system on several different Ubuntu systems from 8.04 to 11.10 and get the same error.

So my questions for anyone who may be able to help are;

1. What development environment/operating system are most people using for development and compiling?

2. Does anyone know how to fix this problem (above)?

3. Any there any special "tricks" that are useful to know?

Thanks in advance

Geoff

icarus75's picture

Hi Geoff,

I am compiling the target under Ubuntu 10.04. The whole x-compilation toolchain is downloaded from source and compiled for your machine when running make for the first time. Could you try compling with:

  1. make V=99

This will output a lot more traces and might help to pinpoint the problem. There should be an error reported near the end of the trace.

One more remark: Are you sure that you've got the avr-gcc package installed on your machine? Preferably 4.3.4 or higher.

Cheers,
Bart.

geofftech's picture

Hi Bart,

Thanks

I have not explicitly installed AVR so that could be the issue. I will start with a brand new Ubuntu 10.04 LTS image and see where I end up.

regards

Geoff

geofftech's picture

Just an update for anyone who comes across this later. I was able to completely download, compile and flash the device using the following steps.

I used a completely new install of Ubuntu 10.04 32bit Desktop on a laptop computer.

  1. sudo apt-get update
  2. sudo apt-get install -y build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt unzip gcc-avr avr-libc gdb-avr
  3. sudo apt-get install -y avra avrp avrdude
  4. mkdir ~/workspace/flukso2 -p
  5. cd ~/workspace/flukso2
  6. git clone <a href="https://github.com/flukso/flm02.git" title="https://github.com/flukso/flm02.git">https://github.com/flukso/flm02.git</a> .
  7. cd ~/workspace/flukso2/openwrt
  8. ./install.sh ~/workspace/flukso2/bin
  9. cd ~/workspace/flukso2/bin/flm02.1.4
  10. make -j8 V=99

Compile takes about 1 hour

  1. make flash V=99

make sure the device is plugged in directly with a cross over cable and OFF. Not through a switch or router. When you see "Device detection in progress..", turn the device ON (plug power in) and it should be discovered in a few seconds and flashed in a couple of minutes.

Is there a WIKI this can go into anywhere?

icarus75's picture

Nice work! And thanks for listing all the deb package dependencies. Flukso doesn't have a wiki right now. But feel free to post this step-by-step guide to the flukso-dev [1] mailing list.

The first compilation does indeed take a long time since it needs to download and compile the entire x-compilation toolchain. If you now run a

  1. make clean
  2. make

the compilation should only take a couple of minutes. If you want to (re-)compile a single package xyz then

  1. make package/xyz/compile

can be used.

[1]: http://lists.flukso.net/mailman/listinfo/flukso-dev

jcw's picture

Had to change line 7, "cd ~/workspace/flukso2/openwrt" to:

cd ~/workspace/flukso2/flm02/openwrt

The build is "flm02.1.7" - I'm now running the initial make.

fablab-leuven's picture

Following the above, I got the following error on Ubuntu 12.04 (64bit):

  1. /flukso_git/bin/flm02.1.7/build_dir/target-mips_uClibc-0.9.30.1/luci-0.9+svn/build/mkversion.sh /flukso_git/bin/flm02.1.7/build_dir/target-mips_uClibc-0.9.30.1/luci-0.9+svn/ipkg-atheros/luci-core/usr/lib/lua/luci/version.lua "OpenWrt Firmware" "Backfire (r27608)" "branches/luci-0.9" "0.9+svn"
  2. /flukso_git/bin/flm02.1.7/build_dir/target-mips_uClibc-0.9.30.1/luci-0.9+svn/build/mkversion.sh: 3: local: not in a function
  3. make[3]: *** [/flukso_git/bin/flm02.1.7/bin/atheros/packages/luci-core_0.9+svn-1_atheros.ipk] Error 2
  4. make[3]: Leaving directory `/flukso_git/flm02/openwrt/package/luci/contrib/package/luci'
  5. make[2]: *** [package/feeds/flukso/luci/compile] Error 2
  6. make[2]: Leaving directory `/flukso_git/bin/flm02.1.7'
  7. make[1]: *** [/flukso_git/bin/flm02.1.7/staging_dir/target-mips_uClibc-0.9.30.1/stamp/.package_compile] Error 2
  8. make[1]: Leaving directory `/flukso_git/bin/flm02.1.7'
  9. make: *** [world] Error 2

This actually just says that the line "local variant" in the file "bin/flm02.1.7/build_dir/target-mips_uClibc-0.9.30.1/luci-0.9+svn/build/mkversion.sh" is not ok. I believe local variables are default in Bourne Shell, so you can probably just remove that line and re-execute the last mkversion.sh command:

  1. /flukso_git/bin/flm02.1.7/build_dir/target-mips_uClibc-0.9.30.1/luci-0.9+svn/build/mkversion.sh /flukso_git/bin/flm02.1.7/build_dir/target-mips_uClibc-0.9.30.1/luci-0.9+svn/ipkg-atheros/luci-core/usr/lib/lua/luci/version.lua "OpenWrt Firmware" "Backfire (r27608)" "branches/luci-0.9" "0.9+svn"

Then I reran: make, now it compiles. (See also https://forum.openwrt.org/viewtopic.php?id=26169 for a related thread)

MVI's picture

Hi,

I'm new in GNU/linux so probably the problem I'm having should have an easy solution but I can't solve it.

I have follow the steps @GEOFFTECH shows in the upper post in Ubuntu 10.04 x32bits and I get the next message when compiling:

  1. make[4]: Leaving directory `/home/mas/workspace/flukso2/flm02/bin/flm02.2.3/package/ncurses'
  2. rm -rf /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses
  3. mkdir -p /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses/host /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/staging_dir/target-mips_uClibc-0.9.30.1/packages /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/staging_dir/host/packages
  4. install -d -m0755 /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses/usr/include
  5. cp -fpR /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/build_dir/target-mips_uClibc-0.9.30.1/ncurses-5.7/ipkg-install/usr/include/*.h /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses/usr/include/
  6. install -d -m0755 /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses/usr/lib
  7. cp -fpR /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/build_dir/target-mips_uClibc-0.9.30.1/ncurses-5.7/ipkg-install/usr/lib/lib{curses,ncurses,panel,menu,form}.{a,so*} /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses/usr/lib/
  8. find /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses -name '*.la' | xargs -r rm -f;
  9. if [ -d /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses ]; then (cd /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses; find ./ > /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/staging_dir/target-mips_uClibc-0.9.30.1/packages/ncurses.list); cp -fpR /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses/* /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/staging_dir/target-mips_uClibc-0.9.30.1/; fi
  10. rm -rf /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/tmp/stage-ncurses
  11. touch /home/mas/workspace/flukso2/flm02/bin/flm02.2.3/staging_dir/target-mips_uClibc-0.9.30.1/stamp/.ncurses_installed
  12. make[3]: Leaving directory `/home/mas/workspace/flukso2/flm02/bin/flm02.2.3/package/ncurses'
  13. make[2]: Leaving directory `/home/mas/workspace/flukso2/flm02/bin/flm02.2.3'
  14. make[1]: *** [/home/mas/workspace/flukso2/flm02/bin/flm02.2.3/staging_dir/target-mips_uClibc-0.9.30.1/stamp/.package_compile] Error 2
  15. make[1]: Leaving directory `/home/mas/workspace/flukso2/flm02/bin/flm02.2.3'
  16. make: *** [world] Error 2

Please, could you help me?

Also, will be better to use a newest version of Ubuntu?

Thank you.

icarus75's picture

I can't seem to find the error in your trace. You're probably running make with the '-j' switch. Can you do a

  1. make clean; make

and post the last trace lines in a comment?

MVI's picture

Sure, there are the results with: make clean; make

  1. mas@vm-ubuntu:~/workspace/flukso2/flm02/bin/flm02.2.3$ make clean; make
  2.  make[1] clean
  3.  make[2] target/linux/clean
  4.  make[3] -C target/linux clean
  5.  make[1] world
  6.  make[2] target/compile
  7.  make[3] -C target/linux compile
  8.  make[2] package/cleanup
  9.  make[2] package/compile
  10.  make[3] -C package/opkg host-compile
  11.  make[3] -C package/base-files compile
  12.  make[3] -C package/busybox compile
  13.  make[3] -C package/libtool compile
  14.  make[3] -C package/cyassl compile
  15.  make[3] -C package/dnsmasq compile
  16.  make[3] -C package/dropbear compile
  17.  make[3] -C package/e2fsprogs compile
  18.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/expat compile
  19.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/intltool host-compile
  20.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/gdbm compile
  21.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/libdaemon compile
  22.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/avahi compile
  23.  make[3] -C package/ncurses compile
  24.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/avrdude compile
  25.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/button compile
  26.  make[3] -C package/lua compile
  27.  make[3] -C package/uhttpd compile
  28.  make[3] -C package/uci compile
  29.  make[3] -C package/px5g compile
  30.  make[3] -C package/lua host-compile
  31.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/luci/contrib/package/luci compile
  32.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/flm-ui compile
  33.  make[3] -C package/zlib compile
  34.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/rrdtool-1.0.x compile
  35.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/ntpclient compile
  36.  make[3] -C /home/mas/workspace/flukso2/flm02/openwrt/package/flukso compile
  37. make -r world: build failed. Please re-run make with V=99 to see what's going on
  38. make: *** [world] Error 1

Also doing it with: make V=99; Here the results:

  1. -------- begin --------
  2. avr-gcc (GCC) 4.3.4
  3. Copyright (C) 2008 Free Software Foundation, Inc.
  4. This is free software; see the source for copying conditions.  There is NO
  5. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  6.  
  7.  
  8. Compiling: main.c
  9. avr-gcc -c -mmcu=atmega168 -I. -gdwarf-2 -DF_CPU=16000000UL   -D DBG=0 -Winline -finline-functions -DBOARD_ID= -DHW_VERSION_MAJOR=2 -DHW_VERSION_MINOR=2 -DSW_VERSION_MAJOR=1 -DSW_VERSION_MINOR=0 -DCTRL_RX_BUFFER_SIZE=32 -DCTRL_TX_BUFFER_SIZE=128  -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.lst  -std=gnu99 -MD -MP -MF .dep/main.o.d main.c -o main.o
  10. In file included from main.c:39:
  11. rfm12.h:1:36: error: rfm12/src/rfm12_config.h: No such file or directory
  12. rfm12.h:2:29: error: rfm12/src/rfm12.h: No such file or directory
  13. main.c: In function '__vector_17':
  14. main.c:125: warning: implicit declaration of function 'rfm12_rx_byte'
  15. main.c:125: warning: implicit declaration of function 'rfm12_rx_len'
  16. main.c:132: warning: implicit declaration of function 'rfm12_rx_clear'
  17. main.c:149: warning: implicit declaration of function 'rfm12_rx_status'
  18. main.c:149: error: 'STATUS_COMPLETE' undeclared (first use in this function)
  19. main.c:149: error: (Each undeclared identifier is reported only once
  20. main.c:149: error: for each function it appears in.)
  21. main.c:161: warning: implicit declaration of function 'rfm12_tx_start'
  22. main.c:170: warning: implicit declaration of function 'rfm12_tx_occupy'
  23. main.c:184: warning: implicit declaration of function 'rfm12_tx_buffer_add'
  24. main.c: In function '__vector_10':
  25. main.c:356: warning: implicit declaration of function 'rfm12_spi_disable'
  26. main.c: In function 'main':
  27. main.c:584: warning: implicit declaration of function 'rfm12_init'
  28. main.c:606: warning: implicit declaration of function 'rfm12_tick'
  29. make[4]: *** [main.o] Error 1
  30. make[4]: Leaving directory `/home/mas/workspace/flukso2/flm02/avr/b'
  31. make[3]: *** [/home/mas/workspace/flukso2/flm02/bin/flm02.2.3/build_dir/target-mips_uClibc-0.9.30.1/flukso-2.2.3/.prepared_b68c3499c25bd9e561feec3728848d09] Error 2
  32. make[3]: Leaving directory `/home/mas/workspace/flukso2/flm02/openwrt/package/flukso'
  33. make[2]: *** [package/feeds/flukso/flukso/compile] Error 2
  34. make[2]: Leaving directory `/home/mas/workspace/flukso2/flm02/bin/flm02.2.3'
  35. make[1]: *** [/home/mas/workspace/flukso2/flm02/bin/flm02.2.3/staging_dir/target-mips_uClibc-0.9.30.1/stamp/.package_compile] Error 2
  36. make[1]: Leaving directory `/home/mas/workspace/flukso2/flm02/bin/flm02.2.3'
  37. make: *** [world] Error 2

Thank you.

icarus75's picture

That trace makes a lot more sense. The rfm12 git submodule was not initialized. Run these commands in the root dir of the flm02 repository:

  1. icarus75@cirrus:~/dev/flm02 (develop)$ git submodule init
  2. icarus75@cirrus:~/dev/flm02 (develop)$ git submodule update

Then re-run the make command in your build dir. It should now compile properly. I will add the submodule init commands to the install file.

MVI's picture

Hi Brad,

Finally got it! As I said I'm new on GNU/Linux, so it has been really difficult to make

  1. icarus75@cirrus:~/dev/flm02 (develop)$ git submodule update

I've had a lot of problems with ssh certification to conect with github.com.... but finally I achieved to update the module. After that I compile the firmware again and it works perfect this time!

Now I'm going to continue playing with the device. :)

Thank you!