Hi, Wahid. Sorry, there is no further information on the opts files. These files were hand-written by David Gay in order for him to do some internal unit testing on the nesC compiler. They were not widely published, and I obtained them from him and included them in the Viptos release only so that more of the nesC files would compile automatically with nc2moml, without user intervention.

Basically, you should put whatever you need into opts that will allow you to compile nesC files separately from the rest of the application (and don't put it only in the makefile, even though you might be able to find the information you need in the pre-existing makefiles). The necessary flags and environment variables are not Viptos-specific. You should consult the nesC and TinyOS documentation for further information. If you need help on understanding makefiles, the O'Reilly reference on make is a good one to read. Another good reference is to read the man pages for gcc or avr-gcc, since some necessary flags may be gcc-specific.

Good luck,

On Wed, 26 Dec 2007, Wahid wrote:

hello Ms Cheong,
Thanks for the reply. opts example files were
very helpful. still, I need more information
regarding this file as there were more than just
-I switches in them. i also saw keywords like
"include" and some environment variables set(if
i'm not mistaken). is there any reference i can
read on what this file can contain(and what not)
i googled opts but didn't get much.
thank you

--- Elaine Cheong <[EMAIL PROTECTED]>

In order for nc2moml to successfully compile
any given .nc file, there
must be an "opts" file in the same directory
that specifies the
correct include paths (using the -I flag), so
that nc2moml can find
any necessary dependencies (otherwise it uses
the default paths that
the nesC compiler uses).  If the opts file does
not exist, or is not
fully specified, then the .nc file will not
compile succesfully.
Unfortunately, many directories in contrib do
not follow this standard
(which is used in many parts of the main tos
branch), so you will
probably have to create these by hand.  The
.tar.gz file that you
unzip (with unzip-opts.sh) when setting up
nc2moml contains some opts
files that were created by hand by David Gay
for the main branch.  You
can use that as an example.  You can usually
extract the correct paths
from a makefile in the same directory, since
this is the usual
alternative way that people use to specify

I suggest that you read the following pages for
more information:




ncapp2moml is not the same as nc2moml.
ncapp2moml compiles whole
TinyOS applications, rather than individual .nc
files.  You'll have to
look at the .java source code for these tools
to understand how they
work and/or read the .htm pages above.

You can run both the nc2moml and ncapp2moml
scripts with a -v option
in order to get more detailed debugging output.


On Dec 23, 2007 10:04 AM, Christopher Brooks
Hi Wahid,
I have no hints for you.  I'm not that
with Viptos.  You would need to apply
standard debugging
techniques.  One thing to make sure is that
you are
using the version of PtinyOS underwhich
Viptos was


    Hello Mr.Christopher,
    Thanks for the reply.
    yes it worked fine,
    now i'v gone further to convert a more
    Among the projects in the contrib dir of
TOS1, i
    picked vigilnet(from UVA)which has over
    sub-directories full of .nc file, most of
    could not be compiled successfully!!! in
    would be less confused if none of the
    files were compiled :) is there anything
in the
    files that nc2moml cannot compile?
    any sort of hints would be highly



    --- Christopher Brooks

   > Hi Wahid,
   > Errno 2 usually means "File not found"
   > Does /usr/PTII/bin/.ncapp2moml-util
   > exist and is it executable?
   > I have:
   > bash-3.00$ ls -l
   > lrwxrwxrwx   1 cxh      labstaff
8 Dec 15
   > 02:42
   > -> ptinvoke
   > If you don't have .ncapp2moml-util,
then you
   > will need to run
   > configure and make.
   > See the installation instructions.
   > The short form is
   >   cd $PTII
   >   ./configure
   >   cd bin
   >   make
   > To debug this, you could try running
   > command by hand.
   > _Christopher
   > --------
   >     Hi,
   >     I am trying to run apps/Blink in
   > viptos.(the demo
   >     is already there in place but i
   > experience
   >     the conversion myself)
   >     So i run the following command:
   >     ./ncapp2moml apps/Blink
   >     I got an error as the result :
   >     system "apps/Blink" failed: 2 at

   >     line 158
   >     I went to the above mentioned line
in that
   > file
   >     printed the value of
$ncapp2momlcmd(in case
   > you
   >     require for debugging):
   >     /usr/PTII/bin/.ncapp2moml-util
   >     /usr/PTII/vendors/ptinyos/momlapp
   > .opts
   >     /usr/PTII/vendors/ptinyos/momlapp


   >    >>

   >     2>&1
   >     I appreciate your help.
   >     wahid
   > --------

    Never miss a thing.  Make Yahoo your home

=== message truncated ===

Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  

Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to