|
From: fj on 5 Apr 2008 12:00 On 5 avr, 16:31, "Dr Ivan D. Reid" <Ivan.R...(a)brunel.ac.uk> wrote: > On Sat, 5 Apr 2008 12:20:23 +0000 (UTC), FX <coud...(a)alussinan.org> > wrote in <ft7qq7$s5...(a)nef.ens.fr>: > > >> I think the compiler isn't passing the lib to the linker. > > It does. > >> Did you try 'gfortran-4.1 -Xlinker -lg2 -o demo demo.f'? > > This is really equivalent to 'gfortran-4.1 -lg2 -o demo demo.f'. > > OK; I still have trouble with Unix and its position-dependent > switches so I tend to try all possibilities. > > >> I'd also check the sources to see what decorated names the Fortran > >> interface wrappers expect; they might be using a different convention > >> to the one gfortran uses. > > I think that's more probable. > > -- > Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration, > Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN > KotPT -- "for stupidity above and beyond the call of duty". I think that the decoration convention supposed by g2 is the so-called f2c convention : a Fortan routine name containing an underscore ends with 2 undersores. So the final name of `g2_open_ps' is surely `g2_open_ps__' whereas gfortran translates it into g2_open_ps_ As consequence, replace "g2_open_ps" by "g2_open_ps_" when you use gfortran. A butter way might be to find the right compiler option in the jungle of all possible options. Notice that your example should compile and link correctly with g95 which applies, by default the f2c convention.
From: Dr Ivan D. Reid on 5 Apr 2008 12:10 On Sat, 5 Apr 2008 09:00:13 -0700 (PDT), fj <francois.jacq(a)irsn.fr> wrote in <65348f96-4394-4fbe-b306-7cbde7b679e6(a)m71g2000hse.googlegroups.com>: > A butter way might be to find the right compiler option in > the jungle of all possible options. That would be the cream on the cake. <gd&r> -- Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration, Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN KotPT -- "for stupidity above and beyond the call of duty".
From: FX on 5 Apr 2008 12:25 > As consequence, replace "g2_open_ps" by "g2_open_ps_" when you use > gfortran. A butter way might be to find the right compiler option in > the jungle of all possible options. That's always the problem: if you have few options, you get criticised because of lack of options, and if you have many, then other people blame you :) In this case, simply looking at http://gcc.gnu.org/onlinedocs/gfortran/Option-Summary.html and searching for "f2c" or "underscore" reveals -ff2c and -fsecond-underscore which will do what you want, whether g2 expects (respectively) full calling conventions or just f2c name mangling conventions. -- FX
From: Nikolaus Rath on 6 Apr 2008 06:47 "FX" <coudert(a)alussinan.org> writes: >> As consequence, replace "g2_open_ps" by "g2_open_ps_" when you use >> gfortran. A butter way might be to find the right compiler option in >> the jungle of all possible options. > > That's always the problem: if you have few options, you get criticised > because of lack of options, and if you have many, then other people blame > you :) > > In this case, simply looking at > http://gcc.gnu.org/onlinedocs/gfortran/Option-Summary.html and searching > for "f2c" or "underscore" reveals -ff2c and -fsecond-underscore > which will do what you want, whether g2 expects (respectively) full > calling conventions or just f2c name mangling conventions. That was the problem indeed, thanks a lot! Best, -Nikolaus -- Nikolaus(a)rath.org | College Ring 6, 28759 Bremen, Germany Class of 2008 - Physics | Jacobs University Bremen »My opinions may have changed, but not the fact that I am right.«
First
|
Prev
|
Pages: 1 2 Prev: Assumed-shape arrays and dummy procedures Next: reading integer text matrix into real array |