- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to know if there is a plan for Intel Fortran Compiler (ifx) to compile fortran code to webassembly (wasm) in the future. Of if ifx can emit LLVM bit code since it uses LLVM backend compiler technology.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can answer this question for Intel: we have no plans to provide the capability to emit LLVM bitcode from the Intel Fortran Compiler (ifx).
As @dhn suggests, Flang-new and LFortran are great alternatives.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am also interested in this. Can anyone answer the original query now...
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here are some workarounds that we have tried:
- use flang-new-15: https://niconiconi.neocities.org/tech-notes/fortran-in-webassembly-and-field-solver/
- use LFortran: https://lfortran.org/
- convert a small portion of our code from Fortran to C and use emscripten to compile the C code to wasm
1 and 2 aren't mature enough to support all the features we implemented in our pretty big Fortran program (100K+ LOC). 3 works well but isn't practical since we would need to convert all of our code from Fortran to C, and then maintain two different Fortran/C baselines to support both desktop and web applications.
ifx already uses LLVM backend so it must already compile Fortran code to LLVM-IR. Not sure how hard that is to compile LLVM-IR to WebAssembly (just like what llc does).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can answer this question for Intel: we have no plans to provide the capability to emit LLVM bitcode from the Intel Fortran Compiler (ifx).
As @dhn suggests, Flang-new and LFortran are great alternatives.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your prompt response!
As I understand, your current icx and dpcpp are able to emit LLVM bitcode. I was wondering why you have no plans to provide that same capability to the ifx?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For ICX, we support emitting bitcode is as an output from the pre-link phase of LTO compilation, and we embed bitcode into fat binaries for offload scenarios. In those cases we haven’t run any optimizations. Our optimizations are proprietary.
For IFX, one may think that the LTO case would give a path to what you're trying to do, but in many cases it wouldn’t really help since we use intrinsics and other IR constructs that are unknown to open source LLVM tools. The Intel dialect of LLVM IR is not 100% cross-compatible with open source LLVM IR and we currently have no intention of supporting any such cross-compatibility. Fortran front end uses such extensions more often than the C/C++ front end. It works in some cases, but that’s entirely dependent on whether we’ve used any of our proprietary extensions.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page