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

Elefunt #1452

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

Elefunt #1452

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

Comments

@Sezoir
Copy link
Collaborator

Sezoir commented Feb 9, 2022

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

@Sezoir
Copy link
Collaborator Author

Sezoir commented Feb 9, 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.

elefunt:

https://www.netlib.org/elefunt/

elefunt is a benchmark from the netlib repository.

Initial report for elefunt:

  • Minimum version of Fortran required using gfortran: F95

  • Running make CFLAGS=-DSP also results default compiling with F77

  • How to compile with gfortran:

    1. First you need to download the project. From what I can tell there is no easy download "button" for the repository. Instead, I had to use wget with a few parameters to ensure we download the correct files. This can be downloaded with:
    wget -r -np -nH -l1 -e robots=off -R master_counts2.html index.html http://www.netlib.org/elefunt
    cd elefunt
    

    The parameters given are used for the following reason: -r for recursive download; -e robots=off to not download the robot file; -R master_counts2.html index.html to exclude the unrelated "web" files; -l1 limits recursive search to 1 layer; -np stops ascending to the parent directory; -nh to not create a host directory.

    1. Now you can compile the project by running:
    make FC=gfortran CC=gcc CFLAGS=-DSP
    

    Correctly substituting the path to your GNU compiler if required.
    The flag definition given can either be -DSP or -DDP representing single precision vs double precision respectively. This is required in machar.c.

  • Does it compile with flang-new: Yes
    We can compile elefunt by running:

    make FC=flang-new CC=clang-12 CFLAGS="-DSP -Wno-return-type"
    

    We require the -Wno-return-type flag due to the rmachar function in machar.c not returning an explicit value (returns void) and clang defaulting to erroring at this warning type.

Versions:

  • gcc version used: 9.3.0
  • gfortran version used: 9.3.0
  • GNU f77 version used: 9.3.0
  • flang-new, fir-dev branch, HEAD: fb8eb63
  • clang-12: 12.0.0
  • 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