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.

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 ?

Any suggestions/ideas/workarounds/hacks welcome

Thanks a ton all of you,

Looking forward to your responses

cheers
ashish



On 7/16/06, Philip Levis <[EMAIL PROTECTED]> wrote:
On Jul 12, 2006, at 9:08 AM, ashish makani wrote:

> Hi David & other folks
>
>  I was very excited & hopeful when I saw your post on the mailing
> list, that at last I would be able to get tinyos successfully
> installed on my linux box, especially since I spent all of
> yesterday & today, unsuccessfully I might add, trying to get it to
> work.
>
>
> So, right now, I am totally clueless & feeling very frustrated &
> desperate.
>
> Should i try to revert back to the earlier version of the avr-libc
> rpm, avr-libc-20030512cvs-1, which was installed earlier.
>
> If so, can you guide me how i should go about doing this ?

Generally, all of these sorts of problems come down to one cause: one
of the scripts in the ncc invocation chain is invoking the wrong
version of another script/tool.

For example, your initial problem sounded like when you typed ncc,
the avr-gcc and avr-libc that were being used were older ones. TinyOS
2.x is written to use the new ones, so you ran into some of the
inconsistencies.

The basic ncc call chain goes like this:

ncc (from tinyos-2.x/tools/scripts/tinyos/ncc) invokes
nescc (from nescc/tools/nescc) invokes
nesc1 (from nescc/src/nesc1) produces app.c and invokes
native compiler

ncc is the TinyOS-specific part of nesC; it processes .platform
files, understands TOSSIM, etc. nescc is the script that invokes the
nesc compiler; it understands nesdoc, etc.
nesc1 is the actual (binary) compiler.

The order specified in the install instructions is pretty important.
For example, when you install ncc (as part of the tinyos-tools RPM),
it finds where nescc is and has the script point to that. So what I
think is happening is you're changing the bottom of the toolchain,
and things above it don't know how to point to it correctly.

The best way to figure out the problems and make things work
correctly, is to consider the call chain and make sure that each step
is invoking the right thing. E.g., first check that when you type
'ncc', you are invoking the version of ncc you want to be. Then,
check which nescc (in terms of your filesystem) ncc is invoking.
Then, check which nescc. Then, check which nesc1. The -v flag is VERY
helpful in this regard.

For starters, can you compile a basic application with avr-gcc? E.g.,
just write something like

main() {
   int i;
   i = 7;
   while (1)
     i++;
}

If you can't compile this, then your avr-gcc is misconfigured. From
your last error messages, it looks like doing the --force on avr-libc
changed some files which avr-gcc was expecting to be there: its
search path is different than what it should be. This, again, comes
down to installing things lower down on the call chain, whose new
locations are different than what things higher up on the call chain
expect.

Phil

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to