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

sw4 #1472

Open
Sezoir opened this issue Feb 11, 2022 · 1 comment
Open

sw4 #1472

Sezoir opened this issue Feb 11, 2022 · 1 comment
Labels
apps Building Fortran applications with Flang - status + instructions

Comments

@Sezoir
Copy link
Collaborator

Sezoir commented Feb 11, 2022

Enable building and execution of the sw4 application with the LLVM Flang compiler.

@Sezoir
Copy link
Collaborator Author

Sezoir commented Feb 11, 2022

Next steps: I am not planning to take on this project. This is just an initial report found. Please feel free to work on this.

sw4:

https://geodynamics.org/cig/software/sw4/
https://github.com/geodynamics/sw4

This project requires the following:
- MPI C compiler. For this I used openmpi.
- blas
- lapack

For this report I used openblas as a replacement for both blas and lapack.

Initial report for sw4:

  • Minimum version of Fortran required using gfortran: F2008
    • Required arguments to compile with version: "-fdec"
  • How to compile with gfortran:
    1. First you can download the project by running in bash:
    git clone https://github.com/geodynamics/sw4.git
    cd sw4
    
    1. Now we want to setup the project configuration. You can use an existing default by:
    cd configs
    cp make.linux make.inc
    
    1. If you are using blas/lapack (as opposed to openblas), then make sure that the libraries can be found in /usr/lib64 and then you can skip step 4 and 5.
    2. Now load your OPENBLAS module. This should set the OPENBLAS_DIR environment variable to the appropriate path to your OPENBLAS build directory.
    3. Next, due to using OPENBLAS, you need to slightly modify the make.inc file. For modifying the make.inc file, under EXTRA_LINK_FLAGS variable replace -L/usr/lib64 -llapack -lblas with -L${OPENBLAS_DIR}/lib -lopenblas.
    4. Modify the compiler variables in the make.inc file "if required".
    5. Finally you can compile the project by running:
    cd ../
    make
    
  • Does it compile with flang-new: No
    Replacing the Fortran compiler in the make.inc file to flang-new results in being able to compile the Fortran files, but then getting a lot of linker errors due to a lot of undefined references.

Versions:

  • gcc version used: 9.3.0
  • gfortran version used: 9.3.0
  • flang-new, fir-dev branch, HEAD: fb8eb63
  • openmpi version used: 4.1.1
  • Architecture for compilation: aarch64

@banach-space banach-space added the apps Building Fortran applications with Flang - status + instructions label Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apps Building Fortran applications with Flang - status + instructions
Projects
None yet
Development

No branches or pull requests

2 participants