On Jul 19, 2006, at 6:12 AM, ashish makani wrote:
Hi Gary, Phil & other folks
First up, Phil, thanks a lot for your explanation of the ncc call
chain
I am still not able to compile the Blink....I have tried to
organize all my doubts & whatever i have attempted, to do to get it
to work, in the following 5 queries :
(1) As suggested by Phil above, i tried compiling the simple 5-line
code he had mentioned.
I created a directory in /opt/tinyos-2.x/apps & created a file
phil.c in it containing the 5-line code.
Now if i try to compile this with just "avr-gcc" it does not
succeed, but if i use the command avr-gcc-3.4.3 it compiles ok.
Am i correct in assuming, & as hinted by Phil, that the problem is
that avr-gcc internally invokes avr-gcc-3.4.3 but is not pointing
correctly to it & hence efforts to compile using avr-gcc fail.
No. Chances are that avr-gcc is not 3.4.3. Try avr-gcc --version. You
can move avr-gcc to a name reflecting its version (e.g., mv avr-gcc
avr-gcc-8.1.2), and then symlink avr-gcc to avr-gcc-3.4.3 (ln -s avr-
gcc-3.4.3 avr-gcc).
If yes, how do i rectify this ?
Here is the output i get..(the commands are in bold)
[EMAIL PROTECTED] rnd_july19]$ pwd
/opt/tinyos-2.x/apps/rnd_july19
[EMAIL PROTECTED] rnd_july19]$ cat phil.c
main() {
int i;
i=7;
while(1)
i++;
}
[EMAIL PROTECTED] rnd_july19]$ avr-gcc
avr-gcc avr-gcc-3.4.3
avr-gcc-3.3-tinyos avr-gccbug
[EMAIL PROTECTED] rnd_july19]$ avr-gcc phil.c
/usr/local/lib/gcc-lib/avr/3.3-tinyos/../../../../avr/bin/ld:
cannot open crts8515.o: No such file or directory
[EMAIL PROTECTED] rnd_july19]$ avr-gcc-3.3-tinyos phil.c
/usr/local/lib/gcc-lib/avr/3.3-tinyos/../../../../avr/bin/ld:
cannot open crts8515.o: No such file or directory
[EMAIL PROTECTED] rnd_july19]$ avr-gcc-3.4.3 phil.c
(2) I tried checking the nesc versions as suggested in Lesson1 of
the TinyOS 2.x tutorial
Here is the output i got :
[EMAIL PROTECTED] tinyos-2.x]$ ncc -v
/usr/bin/nescc -fnesc-include=tos -topdir=/opt/tinyos-2.x -
DPLATFORM_NULL -v -gc c=gcc -fnesc-target=pc -fnesc-no-debug -fnesc-
scheduler=TinySchedulerC,TinySched
ulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask -I/opt/
tinyos-2.x/tos/platf orms/null -I/opt/tinyos-2.x/tos/lib/timer -I/
opt/tinyos-2.x/tos/lib/serial -I/op t/tinyos-2.x/tos/interfaces -I/
opt/tinyos-2.x/tos/types -I/opt/tinyos- 2.x/tos/sy stem
nescc: 1.2.7a
gcc -_fnesc-gcc=gcc -specs=/usr/lib/ncc/tdspecs -_fnesc-
include=nesc_nx -I/usr/l ib/ncc -_fnesc-include=tos -DPLATFORM_NULL
-v -_fnesc-target=pc -_fnesc-no-debug -_fnesc-
scheduler=TinySchedulerC,
TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,r unTask,postTask -I/
opt/tinyos-2.x/tos/platforms/null -I/opt/tinyos-2.x/tos/lib/t imer -
I/opt/tinyos-2.x/tos/lib/serial -I/opt/tinyos-2.x/tos/interfaces -I/
opt/ti nyos-2.x/tos/types -I/opt/tinyos- 2.x/tos/system -DNESC=127
Using built-in specs.
Reading specs from /usr/lib/ncc/tdspecs
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/u sr/share/info --enable-shared --enable-threads=posix --
enable-checking=release - -with-system-zlib --enable-__cxa_atexit --
disable-libunwind-exceptions --enable- libgcj-multifile --enable-
languages=c,c++,objc,obj-c++,java,fortran,ada --enable -java-
awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java- 1.4.2-
gcj-1.4.2. 0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)
[EMAIL PROTECTED] tinyos-2.x]$ ncc --version
ncc: 1.2.1
nescc: 1.2.7a
gcc: gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
Copyright (C) 2006 Free Software Foundation, Inc.
[EMAIL PROTECTED] tinyos-2.x]$ which ncc
/usr/bin/ncc
[EMAIL PROTECTED] tinyos-2.x]$ /usr/bin/ncc --version
ncc: 1.2.1
nescc: 1.2.7a
gcc: gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
Copyright (C) 2006 Free Software Foundation, Inc.
[EMAIL PROTECTED] tinyos-2.x]$ which nescc
/usr/bin/nescc
[EMAIL PROTECTED] tinyos-2.x]$ /usr/bin/nescc --version
nescc: 1.2.7a
gcc: gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
(3) But when i try to check the version of nesc1(which i guess is
invoked by nescc & is at the bottom of the ncc call chain) i get this
[EMAIL PROTECTED] tinyos-2.x]$ which nesc1
/usr/bin/which: no nesc1 in (/usr/local/arm/3.3.2/bin:/opt/
IBMJava2-142/bin:/usr/local/arm/3.3.2/bin:/opt/IBMJava2-142/bin:/
usr/kerberos/bin:/usr/local/bin:/usr/bin:
/bin:/usr/X11R6/bin:/home/spiff/bin:.:/home/spiff/bin:.)
(4) I also ran the tos-check-env script and checked the MAKERULES
environment variable & here is what i got
[EMAIL PROTECTED] tinyos-2.x]$ pwd
/opt/tinyos-2.x
[EMAIL PROTECTED] tinyos-2.x] $ printenv MAKERULES
/opt/tinyos-2.x/support/make/Makerules
[EMAIL PROTECTED] tinyos-2.x]$ tos-check-env
Path:
/opt/ibm/java2-i386-50/bin
/usr/local/arm/3.3.2/bin
/opt/IBMJava2-142/bin
/usr/local/arm/3.3.2/bin
/opt/IBMJava2-142/bin
/usr/kerberos/bin
/usr/local/bin
/usr/bin
/bin
/usr/X11R6/bin
/home/spiff/bin
.
/home/spiff/bin
.
Classpath:
/opt/tinyos-2.x/support/sdk/java/tinyos.jar
.
rpms:
/bin/rpm
avr-binutils-2.13.2.1-1
nesc-1.2.7a-1
automake14-1.4p6-12.1
avr-binutils-2.15tinyos-3
automake-1.9.6-2
avr-insight-pre6.0cvs.tinyos-1.3
avr-gcc-3.4.3-1
avr-libc-1.2.3-1
automake17-1.7.9-6.1
avr-gcc-3.3tinyos-1
avr-insight-6.3-1
tinyos-tools-1.2.2-1
avarice-2.4-1
tinyos-2.0.0beta2-3
make-3.80-10.2
automake16-1.6.3-5.1
automake15-1.5-14
avarice-2.0.20030825cvs-1
nesc:
/usr/bin/nescc
Version: nescc: 1.2.7a
perl:
/usr/bin/perl
Version: v5.8.8 built for i386-linux-thread-multi
flex:
/usr/bin/flex
bison:
/usr/bin/bison
java:
/opt/ibm/java2-i386-50/bin/java
java version "1.5.0"
graphviz:
/usr/bin/dot
dot version 2.8 (Sat Feb 4 00:13:23 UTC 2006)
--> WARNING: The graphviz (dot) version found by tos-check-env is
not 1.10. Please update your graphviz version if you'd like to use
the nescdoc documentation generator.
tos-check-env completed with errors:
--> WARNING: The graphviz (dot) version found by tos-check-env is
not 1.10. Please update your graphviz version if you'd like to use
the nescdoc documentation generator.
(5) When i try to compile the Blink app in /opt/tinyos-2.x/apps I
get a huge list of errors as before, the last 3 lines of which are
as follows :
In component `BlinkAppC':
BlinkAppC.nc:51: cannot find `Boot'
make: *** [exe0] Error 1
The last line looks suspiciously similar to what is mentioned in
Lesson1 of the tinyos-2.x tutorial. So am I invoking an older
version of the nesc compiler, as is menetioned in the tut ?
Also, the 2nd last line says "cannot find `Boot' "...To you(David,
Phil) does this give some hint as to what could the problem
probably be ?
Your TOSDIR environment variable.
My guess is that if you fix your avr-gcc and your TOSDIR, things will
work OK.
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help