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 paths.

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

$PTII/ptolemy/domains/ptinyos/util/
$PTII/ptolemy/domains/ptinyos/util/nc2moml/index.htm
$PTII/ptolemy/domains/ptinyos/util/ncapp2moml/index.htm

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.

Elaine

On Dec 23, 2007 10:04 AM, Christopher Brooks <[EMAIL PROTECTED]> wrote:
> Hi Wahid,
> I have no hints for you.  I'm not that familiar
> 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
> developed.
>
> _Christopher
> --------
>
>     Hello Mr.Christopher,
>     Thanks for the reply.
>     yes it worked fine,
>     now i'v gone further to convert a more serious
>     applications.
>     Among the projects in the contrib dir of TOS1, i
>     picked vigilnet(from UVA)which has over 15
>     sub-directories full of .nc file, most of which
>     could not be compiled successfully!!! in fact,i
>     would be less confused if none of the project
>     files were compiled :) is there anything in the
>     files that nc2moml cannot compile?
>     any sort of hints would be highly appreciated.
>
>     thanks
>
>     wahid
>
>     --- Christopher Brooks <[EMAIL PROTECTED]>
>     wrote:
>
>     > 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 $PTII/bin/.ncapp2moml-util
>     > lrwxrwxrwx   1 cxh      labstaff       8 Dec 15
>     > 02:42 /home/eecs/cxh/ptII/bin/.ncapp2moml-util
>     > -> 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 the
>     > command by hand.
>     >
>     > _Christopher
>     >
>     > --------
>     >
>     >     Hi,
>     >     I am trying to run apps/Blink in
>     > viptos.(the demo
>     >     is already there in place but i wanna
>     > 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
>     >
>     >
>     /usr/PTII/ptolemy/domains/ptinyos/util/ncapp2moml/ncapp2moml-main
>     >     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/tinyos-1.x
>     >     /usr/PTII/vendors/ptinyos/momlapp .ncxml
>     > .opts
>     >     /usr/PTII/vendors/ptinyos/momlapp
>     >
>     >
>     /usr/PTII/vendors/ptinyos/momlapp/.ncapp2moml-tempfile
>     >
>     >
>     /usr/PTII/ptolemy/domains/ptinyos/lib/MicaBoard.xml
>     >     >>
>     >
>     >
>     /usr/PTII/vendors/ptinyos/momlapp/ncapp2moml-log.txt
>     >     2>&1
>     >
>     >     I appreciate your help.
>     >     wahid
>     >
>     > --------
>     >
>
>
>
>           
> _____________________________________________________________________
>    _______________
>     Never miss a thing.  Make Yahoo your home page.
>     http://www.yahoo.com/r/hs
> --------
>
>

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

Reply via email to