Hi,
I'm following the blip tutorial[bliptut] and have run into some
trouble compiling 'libmote.a'. Basically, the build sequence dies
trying to create 'serialpacket.h'.
While this post is rather large, the brunt of it is extracts from a
terminal which may or may not turn out revealing. References at the
end of the post.
Also, I am seeing this on two separate machines:
- Machine A: x86_64 running Ubuntu Karmic Koala (9.10)
Environment:
http://www.asjo.dk/~aslak/wastebook/delta/bliptut/printenv-machineA.txt
- Machine B: i686 running Ubuntu Lucid Lynx (10.04 beta1)
Environment:
http://www.asjo.dk/~aslak/wastebook/delta/bliptut/printenv-machineB.txt
Tinyos 2.1.1 is installed on both machines as described in
[tosinstall] with distribution set to karmic/lucid and '2.1.0'
replaced by '2.1.1'. Nescc is at version '1.3.1'.
The Original Problem:
=====================
I started out with:
as...@hoazin:/opt/tinyos-2.1.1/support/sdk/c/sf$ ./bootstrap
configure.ac:5: installing `config-aux/install-sh'
configure.ac:5: installing `config-aux/missing'
Makefile.am: installing `config-aux/depcomp'
as...@hoazin:/opt/tinyos-2.1.1/support/sdk/c/sf$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
configure: creating ./config.status
config.status: creating Makefile
config.status: creating autoconf.h
config.status: executing depfiles commands
as...@hoazin:/opt/tinyos-2.1.1/support/sdk/c/sf$ make
mig -o serialpacket.h -c-prefix=spacket c
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h serial_packet
-D_POSIX_C_SOURCE
Died at /usr/lib/ncc/migdecode.pm line 45.
make: *** [serialpacket.h] Error 255
as...@hoazin:/opt/tinyos-2.1.1/support/sdk/c/sf$
Work done on the Problem:
=========================
It turns out that the error comes from building the serialpacket.h
target, so I began inserting printouts in various nesc-related
scripts. The failing mig command calls
/usr/bin/nescc-mig -nescc=/usr/bin/ncc -o serialpacket.h
-c-prefix=spacket c /opt/tinyos-2.1.1/tos/lib/serial/Serial.h
serial_packet -D_POSIX_C_SOURCE
which calls
/usr/bin/ncc -fsyntax-only -D_POSIX_C_SOURCE
-fnesc-msg=serial_packet -x nesc
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h
which calls
/usr/bin/nescc -fnesc-include=tos -topdir=/opt/tinyos-2.1.1
-fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask
-DPLATFORM_NULL -fsyntax-only -D_POSIX_C_SOURCE
-fnesc-msg=serial_packet -x nesc
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h -fnesc-target=pc
-fnesc-no-debug -gcc=gcc -I/opt/tinyos-2.1.1/tos/platforms/null
-I/opt/tinyos-2.1.1/tos/lib/timer -I/opt/tinyos-2.1.1/tos/lib/serial
-I/opt/tinyos-2.1.1/tos/interfaces -I/opt/tinyos-2.1.1/tos/types
-I/opt/tinyos-2.1.1/tos/system
which calls
gcc -_fnesc-gcc=gcc -specs=/usr/lib/ncc/tdspecs
-_fnesc-include=nesc_nx -I/usr/lib/ncc -_fnesc-include=tos
-_fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask
-DPLATFORM_NULL -fsyntax-only -D_POSIX_C_SOURCE
-_fnesc-msg=serial_packet -x nesc
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h -_fnesc-target=pc
-_fnesc-no-debug -I/opt/tinyos-2.1.1/tos/platforms/null
-I/opt/tinyos-2.1.1/tos/lib/timer -I/opt/tinyos-2.1.1/tos/lib/serial
-I/opt/tinyos-2.1.1/tos/interfaces -I/opt/tinyos-2.1.1/tos/types
-I/opt/tinyos-2.1.1/tos/system -DNESC=131
which spews out lots of errors and warnings[gcc-output]. Some of these
errors were of the form:
/usr/lib/ncc/deputy_nodeputy.h:4:20: error: stddef.h: No such file or directory
/opt/tinyos-2.1.1/tos/system/tos.h:5:22: error: inttypes.h: No such
file or directory
/opt/tinyos-2.1.1/tos/system/tos.h:13:20: error: string.h: No such
file or directory
/opt/tinyos-2.1.1/tos/system/tos.h:14:20: error: stdlib.h: No such
file or directory
/opt/tinyos-2.1.1/tos/system/tos.h:15:18: error: math.h: No such file
or directory
/opt/tinyos-2.1.1/tos/system/tos.h:16:20: error: stddef.h: No such
file or directory
/opt/tinyos-2.1.1/tos/system/tos.h:17:19: error: ctype.h: No such file
or directory
This led me to two posts[cflags1][cflags2] from tinyos-help suggesting
that part of the problem has to do with the CFLAGS. I therefore
extended the MIGFLAGS variable by adding the line
MIGFLAGS += -I/usr/lib/gcc/i486-linux-gnu/4.4/include
-I/usr/msp430/include/sys -I/usr/msp430/include
-I/usr/lib/gcc-lib/msp430/3.2.3/include
to the /opt/tinyos-2.1.1/support/sdk/c/sf/Makefile. As a result, the
call-sequence of doing a 'make serialpacket.h' is now:
mig -o serialpacket.h -c-prefix=spacket c
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h serial_packet
-D_POSIX_C_SOURCE -I/usr/lib/gcc/i486-linux-gnu/4.4/include
-I/usr/msp430/include/sys -I/usr/msp430/include
-I/usr/lib/gcc-lib/msp430/3.2.3/include
/usr/bin/nescc-mig -nescc=/usr/bin/ncc -o serialpacket.h
-c-prefix=spacket c /opt/tinyos-2.1.1/tos/lib/serial/Serial.h
serial_packet -D_POSIX_C_SOURCE
-I/usr/lib/gcc/i486-linux-gnu/4.4/include -I/usr/msp430/include/sys
-I/usr/msp430/include -I/usr/lib/gcc-lib/msp430/3.2.3/include
/usr/bin/ncc -fsyntax-only -D_POSIX_C_SOURCE
-I/usr/lib/gcc/i486-linux-gnu/4.4/include -I/usr/msp430/include/sys
-I/usr/msp430/include -I/usr/lib/gcc-lib/msp430/3.2.3/include
-fnesc-msg=serial_packet -x nesc
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h
/usr/bin/nescc -fnesc-include=tos -topdir=/opt/tinyos-2.1.1
-fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask
-DPLATFORM_NULL -fsyntax-only -D_POSIX_C_SOURCE
-fnesc-msg=serial_packet -x nesc
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h -fnesc-target=pc
-fnesc-no-debug -gcc=gcc -I/usr/lib/gcc/i486-linux-gnu/4.4/include
-I/usr/msp430/include/sys -I/usr/msp430/include
-I/usr/lib/gcc-lib/msp430/3.2.3/include
-I/opt/tinyos-2.1.1/tos/platforms/null
-I/opt/tinyos-2.1.1/tos/lib/timer -I/opt/tinyos-2.1.1/tos/lib/serial
-I/opt/tinyos-2.1.1/tos/interfaces -I/opt/tinyos-2.1.1/tos/types
-I/opt/tinyos-2.1.1/tos/system
gcc -_fnesc-gcc=gcc -specs=/usr/lib/ncc/tdspecs
-_fnesc-include=nesc_nx -I/usr/lib/ncc -_fnesc-include=tos
-_fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask
-DPLATFORM_NULL -fsyntax-only -D_POSIX_C_SOURCE
-_fnesc-msg=serial_packet -x nesc
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h -_fnesc-target=pc
-_fnesc-no-debug -I/usr/lib/gcc/i486-linux-gnu/4.4/include
-I/usr/msp430/include/sys -I/usr/msp430/include
-I/usr/lib/gcc-lib/msp430/3.2.3/include
-I/opt/tinyos-2.1.1/tos/platforms/null
-I/opt/tinyos-2.1.1/tos/lib/timer -I/opt/tinyos-2.1.1/tos/lib/serial
-I/opt/tinyos-2.1.1/tos/interfaces -I/opt/tinyos-2.1.1/tos/types
-I/opt/tinyos-2.1.1/tos/system -DNESC=131
This shrinks the errors produced by gcc to
as...@hoazin:/opt/tinyos-2.1.1/support/sdk/c/sf$ gcc -_fnesc-gcc=gcc
-specs=/usr/lib/ncc/tdspecs -_fnesc-include=nesc_nx -I/usr/lib/ncc
-_fnesc-include=tos
-_fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask
-DPLATFORM_NULL -fsyntax-only -D_POSIX_C_SOURCE
-_fnesc-msg=serial_packet -x nesc
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h -_fnesc-target=pc
-_fnesc-no-debug -I/usr/lib/gcc/i486-linux-gnu/4.4/include
-I/usr/msp430/include/sys -I/usr/msp430/include
-I/usr/lib/gcc-lib/msp430/3.2.3/include
-I/opt/tinyos-2.1.1/tos/platforms/null
-I/opt/tinyos-2.1.1/tos/lib/timer -I/opt/tinyos-2.1.1/tos/lib/serial
-I/opt/tinyos-2.1.1/tos/interfaces -I/opt/tinyos-2.1.1/tos/types
-I/opt/tinyos-2.1.1/tos/system -DNESC=131
/tmp/nesccppbTHSHib:11:16: warning: extra tokens at end of #include directive
/tmp/nesccppbTHSHib:11:23: warning: extra tokens at end of #include directive
/tmp/nesccppbTHSHib:11:30: warning: extra tokens at end of #include directive
/tmp/nesccppbTHSHib:11:34: warning: extra tokens at end of #include directive
/tmp/nesccppbTHSHib:11:35: error: ...: No such file or directory
/tmp/nesccppbTHSHib:12:16: warning: extra tokens at end of #include directive
/tmp/nesccppbTHSHib:12:23: warning: extra tokens at end of #include directive
/tmp/nesccppbTHSHib:12:30: warning: extra tokens at end of #include directive
/tmp/nesccppbTHSHib:12:34: warning: extra tokens at end of #include directive
In file included from /usr/msp430/include/math.h:10,
from /opt/tinyos-2.1.1/tos/system/tos.h:15:
/usr/msp430/include/sys/ieeefp.h:199:2: error: #error Endianess not declared!!
as...@hoazin:/opt/tinyos-2.1.1/support/sdk/c/sf$
Adding '-D__IEEE_LITTLE_ENDIAN' to MIGFLAGS in the makefile leaves us with
as...@hoazin:/opt/tinyos-2.1.1/support/sdk/c/sf$ gcc -_fnesc-gcc=gcc
-specs=/usr/lib/ncc/tdspecs -_fnesc-include=nesc_nx -I/usr/lib/ncc
-_fnesc-include=tos
-_fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask
-DPLATFORM_NULL -fsyntax-only -D_POSIX_C_SOURCE -D__IEEE_LITTLE_ENDIAN
-_fnesc-msg=serial_packet -x nesc
/opt/tinyos-2.1.1/tos/lib/serial/Serial.h -_fnesc-target=pc
-_fnesc-no-debug -I/usr/lib/gcc/i486-linux-gnu/4.4/include
-I/usr/msp430/include/sys -I/usr/msp430/include
-I/usr/lib/gcc-lib/msp430/3.2.3/include
-I/opt/tinyos-2.1.1/tos/platforms/null
-I/opt/tinyos-2.1.1/tos/lib/timer -I/opt/tinyos-2.1.1/tos/lib/serial
-I/opt/tinyos-2.1.1/tos/interfaces -I/opt/tinyos-2.1.1/tos/types
-I/opt/tinyos-2.1.1/tos/system -DNESC=131
/tmp/nesccppbNfQhRn:11:16: warning: extra tokens at end of #include directive
/tmp/nesccppbNfQhRn:11:23: warning: extra tokens at end of #include directive
/tmp/nesccppbNfQhRn:11:30: warning: extra tokens at end of #include directive
/tmp/nesccppbNfQhRn:11:34: warning: extra tokens at end of #include directive
/tmp/nesccppbNfQhRn:11:35: error: ...: No such file or directory
/tmp/nesccppbNfQhRn:12:16: warning: extra tokens at end of #include directive
/tmp/nesccppbNfQhRn:12:23: warning: extra tokens at end of #include directive
/tmp/nesccppbNfQhRn:12:30: warning: extra tokens at end of #include directive
/tmp/nesccppbNfQhRn:12:34: warning: extra tokens at end of #include directive
as...@hoazin:/opt/tinyos-2.1.1/support/sdk/c/sf$
Note: On machine B it wasn't necessary to add '-D__IEEE_LITTLE_ENDIAN'
to the MIGFLAGS.
The file /tmp/nesccppbNfQhRn is being removed by gcc before it exits.
Any pointers on how to proceed would be greatly appreciated.
I can't help thinking that my problem is of a more fundamental nature though.
Regards,
Aslak
References:
===========
[bliptut] http://docs.tinyos.net/index.php/BLIP_Tutorial
[tosinstall]
http://docs.tinyos.net/index.php/Installing_TinyOS_2.1.1#Two-step_install_on_your_host_OS_with_Debian_packages
[cflags1]
http://www.mail-archive.com/[email protected]/msg30119.html
[cflags2]
http://www.mail-archive.com/[email protected]/msg29783.html
[gcc-output] http://www.asjo.dk/~aslak/wastebook/delta/bliptut/gcc-output.txt
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help