getarg/sleep/etime for Visual Fortran 
Author Message
 getarg/sleep/etime for Visual Fortran

I found the documentation for getarg for Visual Fortran. However
I do not want to have any F90 USE statements in the piece of code
since it should keep compatible with the rest of the platforms I am
using (Unix workstations).

Are there any compiler flags I could add (=> libraries) to
resolve these undefined symbols:




Oh, yes of course some #if defined ... preprocessor symbols would
be appropriate but these also would not fit into our concept (means I
do not want to change a file from foo.f to foo.F because of the
Windows platform, there should be further (platform) request for doing
so.)

The Compaq release notes say:
( http://www.*-*-*.com/ )

   - An entry point for a two argument form of GETARG has been
     added. This allows users to call GETARG with only two arguments
     without specifying a "use dflib" statement.  (dvf3730)

That's exactly what I expect (2 arguments, no USE statement), but what
library do I have to add?

Regards,

Holger

--
     Holger Bauer                                        
     ITSM, University of Stuttgart



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran
On 27 Nov 2000 17:14:28 +0100, Holger Bauer

Quote:

>I found the documentation for getarg for Visual Fortran. However
>I do not want to have any F90 USE statements in the piece of code
>since it should keep compatible with the rest of the platforms I am
>using (Unix workstations).

The library you want is dfport.lib  This is automatically linked in as
of CVF 6.5 - I thought it was also included in some earlier version.

We would have been happy to answer this question if sent to



Fortran Engineering
Compaq Computer Corporation, Nashua NH

Compaq Fortran web site: http://www.compaq.com/fortran
Message Board: http://www.compaq.com/fortran/forum



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran
Yes, dfport.lib has been in CVF long enough for a few competing compilers to
have an option of similar nature; c.f. 'ifl /4Yportlib...' in Intel's
inimitable habit of carrying obscurity one step further.  In the older CVF
versions, I believe it is necessary to
USE DFPORT
and, if using LINK in makefiles, to specify the DEC/Compaq names for the
additional libraries.  But why not use standard Fortran function
alternatives, where applicable; etime works differently on each system which
supports a version, even from one Unix box to another.


Quote:
> On 27 Nov 2000 17:14:28 +0100, Holger Bauer

> The library you want is dfport.lib  This is automatically linked in as
> of CVF 6.5 - I thought it was also included in some earlier version.



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran
    Tim> the additional libraries.  But why not use standard Fortran
    Tim> function alternatives, where applicable; etime works
    Tim> differently on each system which supports a version, even
    Tim> from one Unix box to another.

Yes, that's what I thought, too, so far.

BUT. I think I've posted my timings for the call to CPU_TIME (F95
intrinsic) and etime on several UNIX workstations. On ALL machines
etime did what the man page described. It returns user time and system
time in a two-element array of type REAL and its return argument will
contain the sum of these two values.
CPU_TIME() is treated at the compiler programmer's good will. On one
machine it returns the CPU (user) time on others it returns the sum of
system and user time. So why wasting time for this?
If the compilers are ready it is one line in my code which then I am
happy to change. But meanwhile I stick with etime since it is more
predictable what it returns.

Holger

--
     Holger Bauer                                        
     ITSM, University of Stuttgart



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran
I've found the problem:
I have to use `external routines' : upper_case

Holger

--
     Holger Bauer                                        
     ITSM, University of Stuttgart



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran
On 28 Nov 2000 17:30:51 +0100, Holger Bauer

Quote:

>I've found the problem:
>I have to use `external routines' : upper_case

That is the default - apparently you changed it to lower-case.  If you
did a USE DFPORT, then it wouldn't matter if you used that option or
not.



Fortran Engineering
Compaq Computer Corporation, Nashua NH

Compaq Fortran web site: http://www.compaq.com/fortran
Message Board: http://www.compaq.com/fortran/forum



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran

Quote:

> That is the default - apparently you changed it to lower-case.  If you
> did a USE DFPORT, then it wouldn't matter if you used that option or
> not.

Yes, upper case is the default on Windows NT, but not on Unix
workstations, so in the beginning I've adjusted most of the
compiler flags to be most compatible with major UNIX workstation
compilers. However, I assumed that Compaq/Digital compiler programmers
are clever enough to acknowledge their own compiler flags. This means:
If I adjust to lower-case I do not see any reason why I won't
automatically link to appropriate wrappers for these lower case
routines.

Anyway, it's working now. Maybe someone could put this into the
Hyper-Manuals. I've browsed through but could not find anything (and
this should be written in the appropriate compiler flag section).

As I said. I do not see any reason why I would spoil my code with too
many preprocessor directions or Compaq specific USE statements in
order to keep it compatible with other platforms.

Currently the code only has one emulation routine with preprocessor
directives for such routines like CLOCK/CPU_TIME/ETIME (because some
systems just do not know about) and one C source file (emulating some
of the `standard' F77 utility functions by ANSI C-Routines, also including
preprocessor directives. The rest of the 107000 code lines are either
F90 or F77 code which compiles and runs on:

Hitachi(SR2201)
NEC(SX/4+SX/5)
Linux (Absoft Comp.), Intel X86
HP(HP-UX)
SGI, IRIX64
Compaq (DEC) Alpha (Tru64Unix)
IBM(AIX)
SUN(Solaris)
(now also: Compaq Visual Fortran)

So, why should I write a DFPORT module because of one single platform?
Adjusting compiler flags is much easier ...

:-)

There is another recommendation to the compiler people of Compaq:
Mixing Fortran and C is sometimes not to avoid. However, the default
compiler flag for CVF is to put character string length arguments
immediately after the character pointers. Is there any other system
around which does it like this? So far I only found systems where the
character length arguments are hidden arguments, pushed to the end of
the parameter list.



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran

Quote:


> > That is the default - apparently you changed it to lower-case.  If you
> > did a USE DFPORT, then it wouldn't matter if you used that option or
> > not.

> Yes, upper case is the default on Windows NT, but not on Unix
> workstations, so in the beginning I've adjusted most of the
> compiler flags to be most compatible with major UNIX workstation
> compilers. However, I assumed that Compaq/Digital compiler programmers
> are clever enough to acknowledge their own compiler flags. This means:
> If I adjust to lower-case I do not see any reason why I won't
> automatically link to appropriate wrappers for these lower case
> routines.

I agree. About the automatic link at least. Although I do assume that Compaq/Digital
compilers are clever. :o)

I don't use windows-based compilers at all, but it boggles my mind that case is even an
issue (but it's good to know that it is....just in case). I wonder why it isn't
case-insensitive? Then again, one has to deal with single and multiple underscores in
various and sundry places when linking fortran/c under different unix flavours so I should
keep my mouth shut.

cheers,

paulv

--
Paul van Delst           Ph:  (301) 763-8000 x7274


Camp Springs MD 20746



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran

Quote:
> I don't use windows-based compilers at all, but it boggles my mind that case is even an
> issue (but it's good to know that it is....just in case). I wonder why it isn't
> case-insensitive?...

Case is always an issue in C (which we are talking about linking to),
regardless of the operating system.  Whether this is a good or bad
thing is a popular subject of flame wars, so I'll keep my mouth shut
on that part.  (Not that I don't have a very strong opinion on it - I
just don't find flame wars useful).  C requires case sensitivity - you
can have 2 functions whose names differ only in case - so you pretty
much have to deal with that if you want to interface with C in any
generality.

--
Richard Maine



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran


Quote:
>Adjusting compiler flags is much easier ...

>:-)

>There is another recommendation to the compiler people of Compaq:
>Mixing Fortran and C is sometimes not to avoid. However, the default
>compiler flag for CVF is to put character string length arguments
>immediately after the character pointers. Is there any other system
>around which does it like this? So far I only found systems where the
>character length arguments are hidden arguments, pushed to the end of
>the parameter list.

I believe that this default behavior in C VF was adopted for
compatibility with FPS.  I assume that you've found the compiler flag.

/iface:nomixed_str_len_arg

which puts the hidden length args in sequential order at the end of
the argument list (which should be compatible with other UNIX
systems).

hth,
John



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran

Quote:


> > I don't use windows-based compilers at all, but it boggles my mind that case is even an
> > issue (but it's good to know that it is....just in case). I wonder why it isn't
> > case-insensitive?...

> Case is always an issue in C (which we are talking about linking to),
> regardless of the operating system.

Oh my. I had no idea.

The problems I have had in the past linking to C code suddenly seem more tractable, i.e. I
don't have to rewrite a bunch of C in f90 coz I can't get the damn stuff to link.

Is there a "C for Dummies" book available? :o)

cheers,

paulv

--
Paul van Delst           Ph:  (301) 763-8000 x7274


Camp Springs MD 20746



Wed, 18 Jun 1902 08:00:00 GMT  
 getarg/sleep/etime for Visual Fortran

Quote:

> Is there a "C for Dummies" book available? :o)

Fif{*filter*} years ago, when I needed to become acquainted with C (and
knowing nothing more but Fortran, Pascal and Basic), I found Kernighan
and Ritchie's classic text very readable.

Nowadays you'd want the second edition, that discusses the '89 ANSI
Standard (I don't believe they already updated it for ANSI C '99).

--

Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
GNU Fortran 77: http://www.*-*-*.com/
GNU Fortran 95: http://www.*-*-*.com/ (under construction)



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Creating - Fortran 77 dll for use in Visual Basic 6.0 (not using Compaq Visual Fortran)

2. Building DLLs with Compaq Visual Fortran and Intel Visual Fortran

3. Open Watcom Fortran: ETIME, FDATE, FLUSH, GETENV

4. FORTRAN ETIME subroutine on AIX4.3/xlf5.1

5. DTIME() and ETIME() for MS FORTRAN

6. dtime, etime and itime in RS6000 fortran

7. getenv, getarg, iargc, system etc with intel fortran compiler

8. HP-UX Fortran 90 getarg

9. GETARG & IARGC in Intel Fortran

10. Using GETARG in Absoft Fortran under MPW

11. Fortran on Linux (f2c): NARG() and GETARG()

12. HP C/Fortran getarg question

 

 
Powered by phpBB® Forum Software