pxfgetenv missing
Jennifer Brauch
jennifer.brauch@senckenberg.de
Tue Nov 15 08:29:00 GMT 2011
Hello Tobias and Arjen,
thanks for your help. I actually choose the get_environment_variable
option and it work!
I'm only confused, because I compile the very same model on the same
computer with gcc 3 weeks ago and it worked. Not only for me, but also
for a colleague. So I thought, something got lost on the system side.
There were a lot of updates on the computer.
Anyway, the model is running and that's great.
Thanks again for your help,
Jenny
On 11/14/2011 08:14 PM, Tobias Burnus wrote:
> Jennifer Brauch wrote:
>> I run a fortran modell which needs an etxra module. So I compiled both
>> with the same compiler (gcc_4.4.5 and gcc_4.6.1).
>> When I link the two together, I get this error:
>>
>> getEnvironment.F:(.text+0xc4): undefined reference to `pxfgetenv_'
>>
>> Now I'm lost. pxfgetenv should be part of gcc as far as I understood it.
>
> pxfgetenv is not part of the Fortran standard. However, it is part of
> the IEEE Standard 1003.9-1992, which has been withdrawn. This 1003.9
> specifies POSIX bindings for Fortran.
>
> There is a long-standing plan to implement those bindings for gfortran,
> however, other features had a higher priority, especially as one can
> implement those in external libraries.
>
> For PXFGETENV, 1003.9 specifies:
>
> SUBROUTINE PXFGETENV (NAME, LENNAME, VALUE, LENVAL, IERROR)
> CHARACTER*(*) NAME, VALUE
> INTEGER LENNAME, LENVAL, IERROR
>
> It can be replaced by gfortran's vendor extension:
> | CALL GETENV(NAME, VALUE)|
> if one ignores the IERROR and removes the length values.
>
> It can also be replaced by the Fortran 2003 intrinsic
> GET_ENVIROMENT_VARIABLE, cf.
> http://gcc.gnu.org/onlinedocs/gfortran/GET_005fENVIRONMENT_005fVARIABLE.html
>
>
>
> As Arjen mentioned, there are also compiler-independent libraries, which
> implement POSIX bindings; I don't know how complete or compatible are
> those.
>
> See: http://gcc.gnu.org/wiki/GFortranStandards#POSIX (last words of the
> POSIX section).
>
> Tobias
More information about the Fortran
mailing list