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

stream #1474

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

stream #1474

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 stream 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.

stream:

https://www.cs.virginia.edu/stream/
https://www.cs.virginia.edu/stream/FTP/Code/

Initial report for stream:

  • Minimum version of Fortran required using gfortran: F95
  • How to compile with gfortran:
    1. First you can download the project by running in bash:
    wget -r -np -nH -l3 -R "index.html*" https://www.cs.virginia.edu/stream/FTP/Code/
    cd stream/FTP/Code
    
    The parameters given are used for the following: -r for recursive download; -R "index.html*" to exclude the unrelated "web" files; -l3 limits recursive search to 3 layers; -np stops ascending to the parent directory; -nh to not create a host directory.
    2. Now you can compile the project by running:
    make FF=gfortran
    
  • Does it compile with flang-new: Yes
    You can compile stream, but requires a slight hack, as well as a build of PGMATH. I use classic flang to get a build of PGMATH. To compile:
    1. In mysecond.c file, change the function name mysecond_ to _QPmysecond.
    2. Now you can compile with flang-new with:
    make FF=flang-new CC=clang-12 FFLAGS="-L/path/to/flang/runtime/build/lib -lpgmath"
    
    Where the path to your PGMATH build lib directory is correctly modified.
    An important note for the compilation step is the change in mysecond.c code of mysecond_. In theory we should not need to change this, however we do not currently include the ExternalNameConversion pass in the pass pipeline definition in the driver. We should not require this workaround once the pass is included in the default pass pipeline. Without it, the linker ends up not being able to find the mysecond_ subroutine in stream.f.

Versions:

  • gcc version used: 9.3.0
  • gfortran version used: 9.3.0
  • flang-new, fir-dev branch, HEAD: fb8eb63
  • clang-12: 12.0.0
  • pgmath built from classic flang, HEAD: e7dedbf9200e740bf38b37892597498fd7dcbb41
  • 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