How to use the JIT with llvm-gfortran ?

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

Hi,

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

Olivier.

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 :frowning: