How to use the JIT with llvm-gfortran ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use the JIT with llvm-gfortran ?

pmarguinaud
Hi all,

I am having a look at llvm-gfortran; it compiles OK, but I do not know how to using the JIT as described in http://llvm.org/docs/GettingStarted.html#tutorial. With llvm-gcc I managed to invoke the lli properly, but with llvm-gfortran compiled programs, it fails with the following message:

philou@tleilax:~/gcc/llvm/install/bin$ lli ./main.bc
'main' function not found in module.

I understand it does not find the entry point of the program ( gfortran  creates a MAIN__ function  to be linked with some other code ).

What should I so to have the lli running fortran code ?

Regards,

Philippe



Get news, entertainment and everything you care about at Live.com. Check it out!
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How to use the JIT with llvm-gfortran ?

Olivier Meurant
Hi,

Have you try the "-entry-function=" parameter of lli ?

Olivier.

2009/3/31 philippe marguinaud <[hidden email]>:

> Hi all,
>
> I am having a look at llvm-gfortran; it compiles OK, but I do not know how
> to using the JIT as described in
> http://llvm.org/docs/GettingStarted.html#tutorial. With llvm-gcc I managed
> to invoke the lli properly, but with llvm-gfortran compiled programs, it
> fails with the following message:
>
> philou@tleilax:~/gcc/llvm/install/bin$ lli ./main.bc
> 'main' function not found in module.
>
> I understand it does not find the entry point of the program ( gfortran
> creates a MAIN__ function  to be linked with some other code ).
>
> What should I so to have the lli running fortran code ?
>
> Regards,
>
> Philippe
>
>
> ________________________________
> Get news, entertainment and everything you care about at Live.com. Check it
> out!
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How to use the JIT with llvm-gfortran ?

Anton Korobeynikov-2
In reply to this post by pmarguinaud
Hi

> I understand it does not find the entry point of the program
> ( gfortran  creates a MAIN__ function  to be linked with some other
> code ).
> What should I so to have the lli running fortran code ?
This can be tricky... I think you should compile libgfortran as .bc
library and link it in. main() is library function there :(

--
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev