Skip to content

Conversation

samhatfield
Copy link
Collaborator

No description provided.

@samhatfield samhatfield force-pushed the add_amd-flang branch 3 times, most recently from f9d311f to ef22e1a Compare April 2, 2025 08:52
@samhatfield samhatfield added enhancement New feature or request actions labels Apr 2, 2025
@samhatfield samhatfield force-pushed the add_amd-flang branch 10 times, most recently from bde3d37 to 9494959 Compare April 2, 2025 17:27
@samhatfield
Copy link
Collaborator Author

samhatfield commented Apr 3, 2025

Status:

  • MPI has been disabled for amdflang. Somehow the OpenMPI built by amdflang can't be found by CMake. We will work on this in a future PR.
  • Otherwise all tests are passing with amdflang except for ectrans_test_install which segfaults when running transi_sptogp. This is very similar to what we saw with IntelLLVM actually, which is very suspicious. However I cannot yet debug this crash interactively as I can't build a working amdflang on ECMWF's systems (I could probably build amdflang on my Mac but I have a feeling it's OS-specific). Will liaise with @PaulMullowney about how to debug this further. - Edit: now working by setting stack size to unlimited.

@samhatfield samhatfield force-pushed the add_amd-flang branch 4 times, most recently from 39317d6 to bf23883 Compare April 4, 2025 12:38
@samhatfield samhatfield requested a review from wdeconinck April 4, 2025 12:39
@samhatfield
Copy link
Collaborator Author

Note #249 must be merged into this in order for the amdflang tests to pass.

Copy link
Collaborator

@wdeconinck wdeconinck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thanks also for the install-amd-flang script. Very useful.

@marsdeno
Copy link
Collaborator

Excellent!

@PaulMullowney
Copy link
Contributor

We should hook the GPU build in, next. It will runtime fail, but at least we'll be covering compilation.

@samhatfield
Copy link
Collaborator Author

Note #249 must be merged into this in order for the amdflang tests to pass.

Correction: #249 must be merged into this in order for the amdflang tests to run. In this branch the TESTS feature is disabled for amdflang because we are building without MPI. After #249 is merged to develop (and I rebase this branch) we will be able to enable TESTS without MPI and we can then check whether the test suite passes for amdflang.

@wdeconinck
Copy link
Collaborator

Let's merge #249 first regardless

@wdeconinck
Copy link
Collaborator

@samhatfield I rebased on develop.
Question. Why do we need to add the -fPIC and -fopenmp flags directly?
Does CMake not detect these flags automatically?
There exist alternatives like -DOpenMP_Fortran_FLAGS=-fopenmp to give CMake hints about which OpenMP Flag to use.

@samhatfield
Copy link
Collaborator Author

@samhatfield I rebased on develop. Question. Why do we need to add the -fPIC and -fopenmp flags directly? Does CMake not detect these flags automatically? There exist alternatives like -DOpenMP_Fortran_FLAGS=-fopenmp to give CMake hints about which OpenMP Flag to use.

Good question. It might be that I added those flags before I added the requirement for a CMake version that is amdflang-aware. I'll try removing them now and see what happens.

@samhatfield
Copy link
Collaborator Author

Okay, firstly on -fPIC:

  • amdflang/amdclang etc. requires position independent code. @PaulMullowney can probably explain, I don't know why to be honest. CMAKE_POSITION_INDEPENDENT_CODE=ON is supposed to add -fPIC to all targets but this doesn't seem to work with Fortran targets. -fPIC is missing on the compile line for Fortran objects and the dependent library link step. I know it's ugly, but I don't know how else to put -fPIC in all the places it needs to be without setting the flag explicitly.

@samhatfield
Copy link
Collaborator Author

  • As for the OpenMP flag issue, I have tried using instead OpenMP_{lang}_FLAGS=-fopenmp but this isn't working. I would like to use a cleaner CMake-idiomatic solution but it's difficult to debug this as I can't reproduce it locally.

@PaulMullowney
Copy link
Contributor

  • As for the OpenMP flag issue, I have tried using instead OpenMP_{lang}_FLAGS=-fopenmp but this isn't working. I would like to use a cleaner CMake-idiomatic solution but it's difficult to debug this as I can't reproduce it locally.

Can you come up with a list of issues and we'll discuss at Friday's meeting?

@samhatfield
Copy link
Collaborator Author

samhatfield commented Apr 24, 2025

  • As for the OpenMP flag issue, I have tried using instead OpenMP_{lang}_FLAGS=-fopenmp but this isn't working. I would like to use a cleaner CMake-idiomatic solution but it's difficult to debug this as I can't reproduce it locally.

Can you come up with a list of issues and we'll discuss at Friday's meeting?

I can. It's not really amdflang-new's fault necessarily, just CMake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants