This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem installing!!


[please keep fortran@gcc.gnu.org in copy]

Now it's working but it only works in the terminal that I used to intall it.
If I open a new terminal, the command "gfc" is not recognized . . .

gfc is an alias defined for your convenience. You have to run again the "alias gfc..." command you issued after download every time you open a new shell (or put it in one of your start-up files, like .profile).


Also, "gfc" is not recognized if it is used inside a job file (even in the same
ternimal that I used to install it). Is there any special way to call it from a
job file?

Same problem. If you want to use gfortran extensively, you might want to put it in your PATH.


gfc -c c2ffn.f
gcc -c c2f.c
gfc c2f.o c2ffn.o
./a.out
Fortran runtime error: End of record

This seems to be due to the static linking (dynamic linking makes it work). I'll have a look at it when I can (or someone on the mailing-list can).


FX
#include <string.h>
#ifdef _CRAY
#  include <fortran.h>
#  define nameage      NAMEAGE
#else
#  if !defined(_AIX) && !defined(__hpux)
#    define nameage    nameage_
#  endif
#  define _fcd          char *
#  define _cptofcd(a,b) (a)
#  define _fcdlen(a)    strlen(a)
#endif

void nameage(_fcd name, int *nlen, int *age, float *temp);

int main() {
        char *name = "Knut";
        _fcd fp;
        int nlen,age = 4;
        float temp = 98.6;

        nlen = strlen(name);
        fp = _cptofcd(name, nlen);      /* convert to Fortran string */

        nameage(fp, &nlen, &age, &temp);
        return 0;
}
      SUBROUTINE NAMEAGE(NAME, NLEN, AGE, TEMP)
      CHARACTER*(*) NAME
      INTEGER NLEN,AGE
      REAL TEMP
C
      WRITE(6,1000) NAME(1:NLEN),AGE,TEMP
 1000 FORMAT(1X,'Hello ',A,', who is ',I2,
     .       ' years old, has a temperature of ', f4.1)
      RETURN
      END

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]