fortran compiler - VxWorks

This is a discussion on fortran compiler - VxWorks ; Hello VxWorkers ! Does anyone have an idea about how to compile fortran code for VxWorks on a x86 target ? Thanks a lot ~M~...

+ Reply to Thread
Results 1 to 6 of 6

Thread: fortran compiler

  1. fortran compiler

    Hello VxWorkers !

    Does anyone have an idea about how to compile fortran code for VxWorks
    on a x86 target ?

    Thanks a lot

    ~M~


  2. Re: fortran compiler

    I'd start locating a gnu Fortran compiler for x86. If you can create a
    ..o file in the needed format (eg elf), you should be able to link it in
    with some C code and test it.

    Not sure about the compatibility of FORTRAN calling sequences from C -
    you'd have to play around with that to get it right. FORTRAN passes
    everything by value I think.

    Good luck,
    lc
    noiram wrote:
    > Hello VxWorkers !
    >
    > Does anyone have an idea about how to compile fortran code for VxWorks
    > on a x86 target ?
    >
    > Thanks a lot
    >
    > ~M~



  3. Re: fortran compiler

    LarryC wrote:
    > I'd start locating a gnu Fortran compiler for x86. If you can create a
    > .o file in the needed format (eg elf), you should be able to link it in
    > with some C code and test it.
    >
    > Not sure about the compatibility of FORTRAN calling sequences from C -
    > you'd have to play around with that to get it right. FORTRAN passes
    > everything by value I think.


    That is not correct. As a counter-example, the following Fortran 95
    program

    subroutine twice(i)
    implicit none
    integer :: i
    i = i*2
    end subroutine twice

    program xtwice
    implicit none
    integer :: i
    i = 3
    call twice(i)
    print*,i
    end program xtwice

    gives output "6". The same program, with minor syntax changes, could be
    written in FORTRAN 77.

    I suggest that the OP ask his question in comp.lang.fortran .


  4. Re: fortran compiler

    If it by reference, then calling vxWorks C system functions that take
    values directly might require some wrappers to be written. If the
    goal is to just link in a FORTRAN library to a C app written for
    vxWorks it should be easier. Follow some of the cookbook direction for
    matching up the idiosyncracies between the two languages (ie array
    indicies, type difference, etc). There is a lot of doc on this
    interface ("calling fortran from C").

    Good luck,
    lc




    beliavsky@aol.com wrote:
    > LarryC wrote:
    > > I'd start locating a gnu Fortran compiler for x86. If you can create a
    > > .o file in the needed format (eg elf), you should be able to link it in
    > > with some C code and test it.
    > >
    > > Not sure about the compatibility of FORTRAN calling sequences from C -
    > > you'd have to play around with that to get it right. FORTRAN passes
    > > everything by value I think.

    >
    > That is not correct. As a counter-example, the following Fortran 95
    > program
    >
    > subroutine twice(i)
    > implicit none
    > integer :: i
    > i = i*2
    > end subroutine twice
    >
    > program xtwice
    > implicit none
    > integer :: i
    > i = 3
    > call twice(i)
    > print*,i
    > end program xtwice
    >
    > gives output "6". The same program, with minor syntax changes, could be
    > written in FORTRAN 77.
    >
    > I suggest that the OP ask his question in comp.lang.fortran .



  5. Re: fortran compiler


    LarryC a écrit :

    > I'd start locating a gnu Fortran compiler for x86. If you can create a
    > .o file in the needed format (eg elf), you should be able to link it in
    > with some C code and test it.
    >


    could you tell which version of gnu Fortran I should use and where I
    can find it ?
    My host is Windows. Can I use GNU Fortran G77 for Win32 ?
    (http://kkourakis.tripod.com/)

    thanks a lot for your precious help

    ~M~


    > Not sure about the compatibility of FORTRAN calling sequences from C -
    > you'd have to play around with that to get it right. FORTRAN passes
    > everything by value I think.
    >
    > Good luck,
    > lc
    > noiram wrote:
    > > Hello VxWorkers !
    > >
    > > Does anyone have an idea about how to compile fortran code for VxWorks
    > > on a x86 target ?
    > >
    > > Thanks a lot
    > >
    > > ~M~



  6. Re: fortran compiler

    It should work if the object code comes out in the right format. I'll
    see if I can make an executable from a .o with the F77 gnu compiler.

    lc
    noiram wrote:
    > LarryC a écrit :
    >
    > > I'd start locating a gnu Fortran compiler for x86. If you can create a
    > > .o file in the needed format (eg elf), you should be able to link it in
    > > with some C code and test it.
    > >

    >
    > could you tell which version of gnu Fortran I should use and where I
    > can find it ?
    > My host is Windows. Can I use GNU Fortran G77 for Win32 ?
    > (http://kkourakis.tripod.com/)
    >
    > thanks a lot for your precious help
    >
    > ~M~
    >
    >
    > > Not sure about the compatibility of FORTRAN calling sequences from C -
    > > you'd have to play around with that to get it right. FORTRAN passes
    > > everything by value I think.
    > >
    > > Good luck,
    > > lc
    > > noiram wrote:
    > > > Hello VxWorkers !
    > > >
    > > > Does anyone have an idea about how to compile fortran code for VxWorks
    > > > on a x86 target ?
    > > >
    > > > Thanks a lot
    > > >
    > > > ~M~



+ Reply to Thread