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 #306

Open
marchdf opened this issue Jan 27, 2024 · 8 comments
Open

Flang support #306

marchdf opened this issue Jan 27, 2024 · 8 comments

Comments

@marchdf
Copy link
Contributor

marchdf commented Jan 27, 2024

Hi, I was using the flang compiler on Frontier today (which I was using for openfast) but I got errors in ROSCO when using the same compiler. I noticed in the cmake that ROSCO only supports GNU and Intel compilers:

if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU")
. I was hoping there was a path towards supporting flang so that I don't have to mix compilers. Thanks!

@dzalkind
Copy link
Collaborator

Hi,

Interesting! I'm not that familiar with Flang and may not have the bandwidth to tackle (and, mainly, test a fix for) this issue very soon, but there's definitely a path towards its support. The process should be

  • Adding these lines to the ROSCO CMakeLists.txt that you linked.
  • Adding the SysFlangLinux.f90 file to the ROSCO sys files
  • Tidying up the sys file to match the other in ROSCO, which mainly consists of removing some extra submodules and compiler directives. I did a quick diff between the OpenFAST and ROSCO SysFiles.

I hope this helps. I'll leave this open until we're supporting Flang. If you're able to get to it before we do, we'd greatly appreciate any tips or a PR.

Best, Dan

@marchdf
Copy link
Contributor Author

marchdf commented Jan 30, 2024

Thanks for answering so quickly! If I get a chance I might give your suggestion a shot.

@marchdf
Copy link
Contributor Author

marchdf commented Feb 5, 2024

@dzalkind I needed this for frontier and I have a working version. But it's for ROSCO 2.7 because those are the input files I was given. Here's the branch: https://github.com/marchdf/ROSCO/tree/rosco-27-flang. Let me know if that "looks" ok and I can try doing the same for the dev version of ROSCO and submit a PR.

@dzalkind
Copy link
Collaborator

dzalkind commented Feb 6, 2024

Thanks, Marc! It looks okay to me. Ideally, we'd figure out how to keep these lines as they are ROSCO's main debugging output.

Apparently there are a bunch of Flang flavors out there, with a new one due in March. Maybe it will resolve the issue you raised. Which Flang compiler you are using on frontier?

@marchdf
Copy link
Contributor Author

marchdf commented Feb 6, 2024

Yes I definitely think the eventual PR should have those lines in there. I am going to work with someone who knows fortran/flang better than me and see if we can resolve this. I am a bit confused by the flang landscape. Let me get back to on what kind of version I am using.

@dzalkind
Copy link
Collaborator

dzalkind commented Dec 6, 2024

@ndevelder is also interested in flang support (#397)

I don't have a set up with flang, so it's hard for me to make the required fixes to this source code. If either of you are able to help me with that, I could support this better.

@marchdf
Copy link
Contributor Author

marchdf commented Dec 6, 2024

That would be fantastic and if you had something, I would be happy to test. Here is a link to my branch that made v2.7 work: https://github.com/marchdf/ROSCO/tree/rosco-27-flang. Please feel free to adapt for newer versions and I can try it out.

@dzalkind
Copy link
Collaborator

dzalkind commented Dec 6, 2024

Great! I'll bring your branch up to date.

The only real hang up was that flang didn't like this: marchdf@cb5005e#diff-24535ca502db14768af01d975fd720e3fd71b2986252bd59cda15e89af2f13f2L519

That bit of code is used to see the internal signals of ROSCO, so it could be something we just omit from flang builds with a compile-time flag.

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