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

flang support #404

Open
jeroen opened this issue Nov 11, 2023 · 1 comment
Open

flang support #404

jeroen opened this issue Nov 11, 2023 · 1 comment

Comments

@jeroen
Copy link

jeroen commented Nov 11, 2023

Right now we build the full gcc for x86_64-apple-darwin22-gfortran to cross compile some fortran code. The latest versions of ubuntu now include the llvm flang toolchain: https://packages.ubuntu.com/noble/flang-16.

Is this something that could possibly work at some point?

@ivan-aksamentov
Copy link

ivan-aksamentov commented Feb 23, 2024

I was hoping that

ENABLE_FORTRAN=1 ./build.sh

will do just that. But was surprised that it doesn't.

I don't know the internal workings of osxcross, but this could potentially be as simple as adding flang to the list of LLVM_ENABLE_PROJECTS here:

https://github.com/tpoechtrager/osxcross/blob/ff8d100f3f026b4ffbe4ce96d8aac4ce06f1278b/build_clang.sh#L168C6-L168C27

like that:

-DLLVM_ENABLE_PROJECTS='clang;flang'

(there are also other things you might want to add: https://github.com/llvm/llvm-project/blob/5f1319bb385342c7ef4124b05b83b89ef8588ee8/llvm/CMakeLists.txt#L126-L128)

It would be nice in fact to have more control over LLVM build, potentially by passing CMake flags directly, instead of having a limited set of proxy env vars.

Now that flang is stable, it would not harm anyone if it is enabled by default.

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