| Author |
Message |
vivian
Guest
|
Posted:
Tue Nov 15, 2005 9:10 pm Post subject:
Anybody knows how to use system call in c++ to call ocean? |
|
|
I want to call "oean" in c++ program. Since in ocean, you have to use
load("filename.ocn") i n ocean prompts to run the simulation.
In c++, I use
system("ocean -b load("file.ocn") > file.out");
There is syntax error.
how to use system call ? thanks a lot!
|
|
| Back to top |
|
 |
Stefano Zanella
Guest
|
Posted:
Wed Nov 16, 2005 1:10 am Post subject:
Re: Anybody knows how to use system call in c++ to call ocea |
|
|
escape the quotes
system("ocean -b load(\"file.ocn\") > file.out");
Stefano
vivian wrote:
| Quote: | I want to call "oean" in c++ program. Since in ocean, you have to use
load("filename.ocn") i n ocean prompts to run the simulation.
In c++, I use
system("ocean -b load("file.ocn") > file.out");
There is syntax error.
how to use system call ? thanks a lot!
|
|
|
| Back to top |
|
 |
Andrew Beckett
Guest
|
Posted:
Wed Nov 16, 2005 1:10 am Post subject:
Re: Anybody knows how to use system call in c++ to call ocea |
|
|
Or use "ocean -restore file.ocn" instead of -b (which I didn't know existed!)
Andrew.
On Tue, 15 Nov 2005 13:14:13 -0800, Stefano Zanella <stefanoDOTzanella@pdf.com>
wrote:
| Quote: | escape the quotes
system("ocean -b load(\"file.ocn\") > file.out");
Stefano
vivian wrote:
I want to call "oean" in c++ program. Since in ocean, you have to use
load("filename.ocn") i n ocean prompts to run the simulation.
In c++, I use
system("ocean -b load("file.ocn") > file.out");
There is syntax error.
how to use system call ? thanks a lot!
|
|
|
| Back to top |
|
 |
vivian
Guest
|
Posted:
Wed Nov 16, 2005 5:10 pm Post subject:
Re: Anybody knows how to use system call in c++ to call ocea |
|
|
I tired system( "ocean -restore file.ocn"), c ++ compiler says bad
formed expression. |
|
| Back to top |
|
 |
Andrew Beckett
Guest
|
Posted:
Wed Nov 16, 2005 9:10 pm Post subject:
Re: Anybody knows how to use system call in c++ to call ocea |
|
|
On 16 Nov 2005 08:38:40 -0800, "vivian" <wangllu@yahoo.com> wrote:
| Quote: | I tired system( "ocean -restore file.ocn"), c ++ compiler says bad
formed expression.
|
Don't see why - this is a normal C function.
Still, you're not exactly giving anyone much to work on...
Andrew. |
|
| Back to top |
|
 |
vivian
Guest
|
Posted:
Wed Nov 16, 2005 9:10 pm Post subject:
Re: Anybody knows how to use system call in c++ to call ocea |
|
|
Stefano, Thank you for your reply. I tried it. It compiles successful.
When I run it, still got some error:
sh: syntax error at line 1: `(' unexpected
I think it is the '(' after "load". |
|
| Back to top |
|
 |
vivian
Guest
|
Posted:
Wed Nov 16, 2005 9:10 pm Post subject:
Re: Anybody knows how to use system call in c++ to call ocea |
|
|
Expert Andrew,
I am surprised that you dont even know '-b". At least it compiles
successfully.
It can not even compile with '-restore'. |
|
| Back to top |
|
 |
Andrew Beckett
Guest
|
Posted:
Thu Nov 17, 2005 1:10 am Post subject:
Re: Anybody knows how to use system call in c++ to call ocea |
|
|
On 16 Nov 2005 10:48:44 -0800, "vivian" <wangllu@yahoo.com> wrote:
| Quote: | Expert Andrew,
I am surprised that you dont even know '-b". At least it compiles
successfully.
It can not even compile with '-restore'.
|
Well, from the UNIX prompt I tried:
ocean -b 'load("myscript.ocn")'
and it did nothing except start ocean interactively - which is what
it would have done without the -b arg.
So from my experiments, -b is not a supported argument of the Cadence "ocean"
executable - which might explain why I've not come across it.
Perhaps you have a wrapper called "ocean" around the Cadence "ocean" executable
which implements the -b arg, and stops the -restore argument from being passed
(-restore definitely should work with the Cadence executable)?
I can't see why the command should affect the compilation of the C++ code - it's
just a string, so it wouldn't care until run time.
Regards,
Andrew. |
|
| Back to top |
|
 |
fogh
Guest
|
Posted:
Thu Nov 17, 2005 9:10 pm Post subject:
Re: Anybody knows how to use system call in c++ to call ocea |
|
|
vivian wrote:
| Quote: | I want to call "oean" in c++ program. Since in ocean, you have to use
load("filename.ocn") i n ocean prompts to run the simulation.
In c++, I use
system("ocean -b load("file.ocn") > file.out");
There is syntax error.
how to use system call ? thanks a lot!
Just when I was wondering wether I was getting grumpy and rude the last |
times...
Thank you, you have put it all in perspective. |
|
| Back to top |
|
 |
vivian
Guest
|
Posted:
Fri Nov 18, 2005 1:10 am Post subject:
Re: Anybody knows how to use system call in c++ to call ocea |
|
|
Finally, I solved the problem.
First, write the following in the file "myFile":
load("file.ocn")
then, in c++, write:
system("ocean < myFile >> file.out ");
It runs successfully.
Thank all the people who helped me! |
|
| Back to top |
|
 |
|
|
|
|