Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run the bitcode #120

Closed
htg20 opened this issue Jun 30, 2017 · 3 comments
Closed

Cannot run the bitcode #120

htg20 opened this issue Jun 30, 2017 · 3 comments

Comments

@htg20
Copy link

htg20 commented Jun 30, 2017

Hello,

For the hello world example, the normal executable works. However, when I do
flang -emit-llvm hello.f90 -c -o hello.bc

and try to run using lli ( lli hello.bc), I get the error message:

'main' function not found in module.

In case of C++, this works as expected. What am I missing here?

@sscalpone
Copy link
Member

The name of a main program in flang is MAIN_.

I was able to run hello.f90 with this command (where $flang is my install directory):

$flang/bin/lli -entry-function=MAIN_ -load=$flang/lib/libflangrti.so -load=$flang/lib/libflang.so hello.bc
hello world from from hello.f90

@htg20
Copy link
Author

htg20 commented Jul 3, 2017

Thank you, worked also for me.

BTW, do you know of any effort to make flang work with Emscripten?

@sscalpone
Copy link
Member

No idea about Emscripten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants