beeware / mobile-forge

A tool to manage building cross-platform binary wheels for mobile devices
BSD 3-Clause "New" or "Revised" License
14 stars 9 forks source link

Added flang compiler #28

Open ydesgagn opened 4 months ago

ydesgagn commented 4 months ago

This is an incomplete draft to enable flang compiling, but a team effort will be required here to complete the work.

The setup-iOS.sh file is modified to build the docker image that will be used to compile the Fortran part of Scipy or any other package.

The main build script must be modified to put the newly added bin folder first in the path of the build environment so the makefile can see gfortran, which is actually a Python script that will call the docker container.

Next just create the recipe for scipy. Add dependencies as required like openblas and patch the setup/makefile as required like any other recipe. Scipy will build the c part at the beginning and after a few minutes it will hit the fortan part. At that point, the compilation will become really slow because of the file copy to the docker container and the terminal might be strange with broken CR/LF. After a few minutes, the fortran part will complete and the wheel will be packed as usual.

When I do that on my side with a repository pre-dating the first chaquopy iOS build system, it does work but I was only building the iphoneos wheel, not the fat wheel for the simulator.