Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Compile android-llvm with flang support

94 views
Skip to first unread message

sodabitters

unread,
Sep 17, 2024, 4:11:12 PM9/17/24
to android-llvm
Hi!
In the old version of NDK, we were able to add gfortran to the GCC build by editing the python build scripts. I'm currently attempting the same, editing line 736 in base_builders.py.

defines['LLVM_ENABLE_PROJECTS'] = ';flang;mlir;'.join(sorted(self.llvm_projects))

Anyways, has anyone else tried this? I'm currently running into some compile errors (and my computer is running out of memory during the build, haha)

Cheers!

Pirama Arumuga Nainar

unread,
Sep 18, 2024, 4:01:24 PM9/18/24
to sodabitters, android-llvm
The following diff should suffice.
diff --git a/builders.py b/builders.py
index 661cefb..c348499 100644
--- a/builders.py
+++ b/builders.py
@@ -152,7 +152,7 @@ class Stage2Builder(base_builders.LLVMBuilder):
 
     @property
     def llvm_projects(self) -> Set[str]:
-        proj = {'clang', 'lld', 'clang-tools-extra', 'polly', 'bolt'}
+        proj = {'clang', 'lld', 'clang-tools-extra', 'polly', 'bolt', 'flang', 'mlir'}
         if self.build_lldb:
             proj.add('lldb')
         return proj
 
I get an error, which I haven't fully investigated:
$ toolchain/llvm_android/build.py --no-build=lldb,windows --no-lto --skip-tests
...
/usr/local/google/home/pirama/work/llvm-toolchain/out/llvm-project/flang/lib/Decimal/decimal-to-binary.cpp:381:24: error: called object type 'float' is no
t a function or function pointer                                                                                                                          
  381 |       return {Real{HUGE()}};                                                                                                                      
      |                    ~~~~^                                                                                                                          
1 error generated.


--
You received this message because you are subscribed to the Google Groups "android-llvm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-llvm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-llvm/f9087eb6-79ac-4ac8-b720-0b6d32762f94n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages