On Wednesday 26 February 2003 11:11, Richard Maine wrote:
> Alberto Águeda Maté writes:
> > I am looking for a (as much as possible) generic and portable way
> > to make system calls in whichever platform and using whichever
> > compiler.
>
> There ain't no such animal.
> One such standard is the Posix one. But just because something is
> standardized doesn't necessarily make it particularly portable. The
> number of platforms and compilers where you can actually use the
> Posix system calls from Fortran is not impressively high....in fact,
> it is pretty low. (I'm including only cases where it is safe to
> assume that the necessary libraries are actually installed on most
> systems, not cases where it would in theory be possible for a user
> to build and install the necessary libraries - that's not usually
> very helpful if you are trying to ship a Fortran application to
> users.)
>
> For example, if you assume Posix, you just ruled out Windows systems,
> which last time I checked had a pretty significant market share. :-)
All 32-bit Windows Fortran compilers I know of work fine under cygwin,
whether they were designed that way or not. Some of the posix calls would
work the same under MKS or sfu, both of those being higher priced
alternatives. If you could count all the Windows installations with
posix-like libraries running, you might outnumber some of the other OS, but
you still wouldn't find a significant fraction of Windows adherents agreeing
on posix as any kind of standard.
It wouldn't surprise me if the low popularity of Windows-64 were partly
caused by the difficulty of running posix emulations, but I don't think that
variant figured in your market shares.
>
> > In any case, would there be any standard way in F90 to ask for the
> > platform under which it is running and the compiler that was used
> > for its compilation?
>
> No. Nothing even close for that one.
Not beyond
call system("uname -a")
with the complications of creating a file first, directing the response to
that file, and reading that file.uname, for the first part, and even
further-fetched extensions of that idea for the second.
--
Tim Prince
|