Operating System - HP-UX
1752604 Members
4427 Online
108788 Solutions
New Discussion юеВ

Re: Starbase problem with Fortran

 
SOLVED
Go to solution
Yong Zhang
Occasional Advisor

Starbase problem with Fortran

First, I run the following three commands (as 'root') and the correponding results are attached as file '1.txt', '2.txt', '3.txt', respectively (no result when runing the 3rd command):

swlist
uname -a
swlist -lfileset -astate | grep -v \# | grep -v conf



Attachment 'graphinfo.txt' is the result when runing command '/usr/bin/graphinfo > graphinfo.txt', while 'test.f' is the simple Fortran program I wrote. I am using Fortran90 compiler and the attachment 'Makefile' is used to compile and link 'test.f'.


Following is the error message when I run the program 'test':

$ ./test
Starbase error 3: Device kind is not supported for the specified device.
Procedure name: gopen
File descriptor: -1
Device file name: Unknown
Library location: device control (10)
fildes: -1
$


Any advice/help is highly appreciated.
Yong
15 REPLIES 15
Mike Stroyan
Honored Contributor
Solution

Re: Starbase problem with Fortran

You need to change your includes from the /usr/include ones meant for f77 to the starbase-f90.1.h and starbase-f90.2.h meant for f90.
You need to change the parameter passing for strings so you put a trailing null character at the end.
You need to specify a window name rather than a crt device file. That window can be created with xwcreate, or
can be created by some other method and then mapped to a gopen string parameter with a call to the C routine- make_X11_gopen_string.
The attached example works with a window created by "xwcreate test".
While f90 can make calls to starbase, you would be better served by using C code for the window creation and main program. Fortran is not well suited to the event loop based model that X11 expects. You can use a gopen fildes from C code that is passed into fortran routines.
You could start with an example like /opt/graphics/starbase/demos/starbase/motif_sb1.c
and call your fortran code from that C/motif main body.
Yong Zhang
Occasional Advisor

Re: Starbase problem with Fortran

It is working. Thanks so much.

BTW, besides 'Grapgics Administration Guide for HP UX 11.x' (http://www.hp.com/workstations/support/documentation/manuals/user_guides/graphics/GAG11/GAG.html), are there any documents/manuals to get more ideas?

Bill McNAMARA_1
Honored Contributor

Re: Starbase problem with Fortran

You should find a lot of docs on your system in /usr/share/docs

Bill
It works for me (tm)
Mike Stroyan
Honored Contributor

Re: Starbase problem with Fortran

There are documents on Starbase at
http://docs.hp.com./hpux/dev/index.html#Starbase
There is a paper-only manual,
98592-90081
Starbase Graphics Techniques
which is more of a Starbase tutorial. Starbase is being replaced by OpenGL. There is no Starbase support in 11iV1.5 for Itanium systems. However, there is no Fortran binding shipped for OpenGL.
You need to call OpenGL from C or C++ code.
Yong Zhang
Occasional Advisor

Re: Starbase problem with Fortran

I got another problem in using Exceed to access my HP machine remotely.

After you guru's help, I could use Starbase successfully with the demo program 'simple_f.f' from '/opt/graphics/starbase/examples/dl' (modified according to your suggestions, see attchment). I could run the program in front of the HP machine (got a cube). But when I run the program in my PC remotly, I got the following error messages:

$ ./simple_f
Starbase error 1: Graphics device is not initialized for this operation.
Procedure name: open_segment
File descriptor: 2063865000
Device file name: Unknown
Library location: global definitions (1)
Starbase error 1: Graphics device is not initialized for this operation.
Procedure name: close_segment
File descriptor: 2063865000
Device file name: Unknown
Library location: global definitions (1)
Starbase error 1: Graphics device is not initialized for this operation.
Procedure name: refresh_segment
File descriptor: 2063865000
Device file name: Unknown
Library location: global definitions (1)
$

I could run other programs like 'liberty' from '/opt/graphics/starbase/demos/dl' remotly on my PC.

Do I need to install any other patches? FYI, the result running 'swlist -l product' on the HP machine.

Any input is highly appreciated.

Volker Borowski
Honored Contributor

Re: Starbase problem with Fortran

Hi Yong,

I think the gurus above would have a slightly higher intention to help you again, if you would provide some points for the solution they already gave you.

No points for this post please.
Volker
Yong Zhang
Occasional Advisor

Re: Starbase problem with Fortran

Sure. But how can I do that?
Yong Zhang
Occasional Advisor

Re: Starbase problem with Fortran

Sorry, I knew how to that. Thank you for the help.
Yong Zhang
Occasional Advisor

Re: Starbase problem with Fortran

Sorry, I knew how to do that. Thank you for the remind.