gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1617 Posts in 535 Topics by 779 Members - Latest Member: rhoronjeff@comcast.net December 02, 2022, 08:59:46 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Macintosh  |  Executing UNIX Commands using SYSTEM under MRWE
gfx
gfxgfx
 

Author Topic: Executing UNIX Commands using SYSTEM under MRWE  (Read 1804 times)

Orbital Mechanic

  • Newbie
  • *
  • Posts: 16
Executing UNIX Commands using SYSTEM under MRWE
« on: June 29, 2014, 09:24:50 PM »
I'm running Absoft Pro Fortran ver. 14.0.3 on a MacBook Pro under Mac OS X ver. 10.9.3. I'm experimenting with a Fortran 77 program, GNUFOR, that runs GNUPLOT by initiating GNUPLOT using the SYSTEM function. A test program builds the command and data files before the SYSTEM function call for GNUPLOT.

I would like to run GNUFOR under the test program as an MRWE application. I can compile and link the test program and when I execute it, GNUPLOT does not execute. It appears that MRWE preempts the SYSTEM function calls.

Attached is a copy of the source code, data files, command files and atool file in zip file gnuplot_fortran_test.zip

Any suggestions?


forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
Re: Executing UNIX Commands using SYSTEM under MRWE
« Reply #1 on: June 30, 2014, 08:32:34 AM »
The SYSTEM() function works from MRWE. My guess is that you not specifying GNUPLOT correctly. I don't know anything about GNUPLOT, but from the command you constructed:

'gnuplot -persist ' // trim ( command_filename ) // ' &'

it looks like an application. On OS X, you need to use the "open", possibly a full path, and the full application name. For example:

open /path/to/gnuplot -persist ...

where "/path/to/" is the absolute path to the application. If GNUPLOT is not a command line application, but is instead an application bundle, then the name will be "gnuplot.app".

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
Re: Executing UNIX Commands using SYSTEM under MRWE
« Reply #2 on: June 30, 2014, 10:09:27 AM »
After building and installing GNU PLOT 4.6.5 on OS X 10.9.3, it appears that the GNU PLOT program requires a controlling console window (as provided by Apple's Terminal.app) in order to function correctly. 

Your example project runs fine when built as a Terminal application but does not work as an MRWE application.  After providing a full path to the gnuplot executable program in the SYSTEM call,  we found that it would hang after displaying the first plot.  Switching the project to use AWE produces the same result.

While AWE and MWRE provide basic support for keyboard input and screen output, they do not provide complete terminal emulation and are not designed to supply I/O support to sub processes launched through the SYSTEM call.
 
In order to use GNU PLOT, you will have to create a Terminal Application.
 




Orbital Mechanic

  • Newbie
  • *
  • Posts: 16
Re: Executing UNIX Commands using SYSTEM under MRWE
« Reply #3 on: June 30, 2014, 10:19:13 PM »
You got the same results I did whether an MRWE or AWE application was built. A terminal application it is.

Thanks for your help.


Absoft User Forum  |  Support  |  Macintosh  |  Executing UNIX Commands using SYSTEM under MRWE
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!