[Fwd: Re: Problem compiling NONMEM with mingw gfortran 4.3.0 builds]

Jerry DeLisle jvdelisle@verizon.net
Sat Jul 21 17:20:00 GMT 2007


Forwarding to gcc list since there seems to be a C related problem here as well. 
Example code below.

-------- Original Message --------
Subject: Re: Problem compiling NONMEM with mingw gfortran 4.3.0 builds
Date: Sat, 21 Jul 2007 10:13:32 -0700
From: Jerry DeLisle <jvdelisle@verizon.net>
To: Danny Smith <dannysmith@clear.net.nz>, Fortran List <fortran@gcc.gnu.org>
References: <000301c7c8d0$b2ee4160$cb4861cb@THOMAS>

Danny,

I experimented with your simple Hello World in C running on Cygwin, writing to
CONOUT$.  It does not error out, but does nothing.

On the gfortran side it creates a file named CONOUT$.

I would like to intercept this file name on mingw and cygwin systems and attempt
to map it to stdio in the gfortran runtime library. (band aid fix)

A couple of questions:

1) Is there a #define somewhere that I can use to conditionally compile this
"band aid" just for mingw and cygwin?  I have looked in config.h and did not
find anything useful.

2) At least on cygwin, since the example does not work for the C version (I have
not tried mingw, but presume it works there) is there a "system" level fix for
this problem that would be more appropriate?

Best regards,

Jerry

Examples:

$ cat test.c
#include <fcntl.h>
#include <sys/stat.h>
#include <stdlib.h>

int main()
{
  int fd= _open ("CONOUT$", _O_RDWR);
   if (fd >= 0)
    _write (fd, "Hello world", sizeof ("Hello world"));
  return 0;
}

$ cat test.f
        open(unit=29,file="CONOUT$")
        write(29,100)
100    format('Hello, world!')
        end





More information about the Gcc mailing list