Re: gcc vs gfortran

2019-12-06 Thread Patrick Dupre
OK, it is fixed, I compiled with the option -ff2c This was an error > > in C > > > > double complex a, b, z > > int lnchf ip > > out = conhyp_ (&a, &b, &z, &lnchf, &ip) ; > > The above isn't very close to C, e.g. ; is missing at the end of first line, > , and ; are missing around ip on the second

Re: gcc vs gfortran

2019-12-06 Thread Jakub Jelinek
On Fri, Dec 06, 2019 at 06:12:28PM +0100, Patrick Dupre wrote: > Actually, this is what I have: > > in C > > double complex a, b, z > int lnchf ip > out = conhyp_ (&a, &b, &z, &lnchf, &ip) ; The above isn't very close to C, e.g. ; is missing at the end of first line, , and ; are missing around i

Re: gcc vs gfortran

2019-12-06 Thread Tom Horsley
On Fri, 6 Dec 2019 18:12:28 +0100 Patrick Dupre wrote: > out = conhyp_ (&a, &b, &z, &lnchf, &ip) ; I don't know what "out" is, but if the return type of a fortran function is some struct-like object (which complex might qualify as), I believe there is a hidden first argument that is a pointer to

Re: gcc vs gfortran

2019-12-06 Thread Patrick Dupre
Actually, this is what I have: in C double complex a, b, z int lnchf ip out = conhyp_ (&a, &b, &z, &lnchf, &ip) ; In Fortran: FUNCTION CONHYP (A,B,Z,LNCHF,IP) INTEGER LNCHF,IP COMPLEX*16 CHGF,A,B,Z,CONHYP And what I get is A= b, B=z (the other values are wrong) It means that

Re: gcc vs gfortran

2019-12-06 Thread Patrick Dupre
    On Fri, 6 Dec 2019 at 06:31, Patrick Dupre wrote: Hello, Several times I called a fortran routine from a c program, it was OK. I am trying to do the same with complex numbers in the call. Is it a problem ? in c, I use double complex in f95, I use COMPLEX*16     Typo?

Re: gcc vs gfortran

2019-12-06 Thread George N. White III
On Fri, 6 Dec 2019 at 06:31, Patrick Dupre wrote: > Hello, > > Several times I called a fortran routine from a c program, it was OK. > I am trying to do the same with complex numbers in the call. > Is it a problem ? > in c, I use double complex > in f95, I use COMPLEX*16 > > Typo? From f2c.h

Re: gcc vs gfortran

2019-12-06 Thread Tom Horsley
On Fri, 6 Dec 2019 11:30:14 +0100 Patrick Dupre wrote: > in c, I use double complex > in f95, I use COMPLEX*16 Never heard of double complex in c. Fortran passes all arguments by reference, so a fortran routine that has a complex*16 arg probably needs something like this in C struct c16 { do

gcc vs gfortran

2019-12-06 Thread Patrick Dupre
Hello, Several times I called a fortran routine from a c program, it was OK. I am trying to do the same with complex numbers in the call. Is it a problem ? in c, I use double complex in f95, I use COMPLEX*16 my fortran cade translated to c by f2c does not work I get a segmentation fault: are the

gfortran

2016-12-29 Thread Patrick Dupre
Hello, I have a program (c) calling a routine compiled by f95 In the c program I have a loop (calling the fortran routine) that I wanted to paralleled by #pragma omp parallel for At the execution, I get: Disk file read error number 5002 Type to exit program All files have been compiled and li

Re: current version og mingw-gfortran useless

2015-10-21 Thread stan
On Wed, 21 Oct 2015 10:01:59 +0200 (CEST) "Jouk Jansen" wrote: > Hi All > > The current version (5.1.0-2) of mingw-gfortran is useless since it > the produced executable cannot open any existing file (see > http://sourceforge.net/p/mingw-w64/bugs/487/ ). The proble

current version og mingw-gfortran useless

2015-10-21 Thread Jouk Jansen
Hi All The current version (5.1.0-2) of mingw-gfortran is useless since it the produced executable cannot open any existing file (see http://sourceforge.net/p/mingw-w64/bugs/487/ ). The problem seems to be solved in version 5.2. I filed a bug (#1268248) some weeks ago , but the fedora-maintainer