How to compile libgfortran to run on i64 arm64 architecture?

I have a huge piece of Fortran code that I need to run on an iOS device (in an iOS application that I will talk to as Objective-C → C → Fortran).

I was able to compile this Fortran code for arm64using dragonegg. However, at the linking stage, I miss a lot of characters from the library gfortran.

I tried to compile file gfortranby file using Xcode, but this is pretty problematic. I would prefer to at least use configureit maketo somehow bring me closer to the result, but it seems that it --target=arm-apple-darwinis not really supported.

Any idea of ​​creation libgfortrancreated for arm64? maybe someone has pre-built libgfortranfor arm64?

+4
source share
1 answer

You can compile many libraries based on configure and Makefile by starting the ./configurestatic library as usual and changing the compiler and linker when you invoke make. This can be done as follows: script:

#!/bin/sh

export SDK=iphoneos
export CFLAGS="-arch armv7 -arch arm64"
export CC="xcrun --sdk $SDK clang"
export CPP="xcrun --sdk $SDK cpp -D__arm__"
export LD="xcrun --sdk $SDK clang"
make -e
0
source

Source: https://habr.com/ru/post/1695454/


All Articles