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

add custom easyblock for Flang #1729

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

Conversation

ocaisa
Copy link
Member

@ocaisa ocaisa commented May 15, 2019

No description provided.

easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
)
# Also copy over the libomp libraries
copy_file(
os.path.join(self.llvm_obj_dir, 'lib', 'libomp.%s' % shlib_ext),
Copy link
Member Author

@ocaisa ocaisa May 15, 2019

Choose a reason for hiding this comment

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

Bit dubious about whether this is enough, there are a number of libomp libraries in that directory but this is the only one that appears in the Flang Binary Release File List at https://github.com/flang-compiler/flang/releases

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm also concerned that an identical library (same source code) is created by Clang, are these compatible?

@ocaisa
Copy link
Member Author

ocaisa commented May 16, 2019

Regarding libomp here, this is a bit of a problem because since libomp appears for both clang and flang we have a name clash if we couple these. This is an issue because Flang looks like it is going to be always be a generation behind Clang, so if we make a toolchain we need to know that when we use Flang we get the libomp from Flang, and when we use Clang we get Clang's libomp.

We can mostly achieve this by aliasing flang with

flang -Wl,-rpath %(installdir)s/lib

And being careful that whenever we define a full LLVM toolchain that flang appears before clang (so the clang libomp is picked up by default).

The other option is to stick to a single LLVM version for a clang/flang toolchain and use the libomp from clang for flang as well. This asssumes that since they are the same code they must be compatible (be warned though, they are built with an LLVM fork for flang in the normal case, I have no idea what that means in practice).

@ocaisa
Copy link
Member Author

ocaisa commented May 16, 2019

@geimer Maybe you might know the implications of the libomp issue?

@boegel boegel added this to the 3.x milestone May 16, 2019
@geimer
Copy link
Contributor

geimer commented May 21, 2019

@ocaisa I haven't built flang myself yet. But from the description/instructions, it reads as if the build includes the full suite of compilers, and the flang folks only needed to tweak the compiler driver to support Fortran. That is, I would expect to have only one OpenMP runtime library used for all compilers. But I may be mistaken...

options += "-DCMAKE_CXX_COMPILER='%s' " % CXX
options += "-DCMAKE_Fortran_COMPILER='%s' " % FC
options += "-DLLVM_CONFIG='%s' " % LLVM_CONFIG
options += "-DFLANG_LIBOMP='%s' " % LIBOMP
Copy link
Member Author

Choose a reason for hiding this comment

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

If we added Clang as a dependency I think it would be possible to just point to that libomp at this point (and not build Flang libomp at all).

Copy link
Contributor

Choose a reason for hiding this comment

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

We would likely want Clang+Flang as a single entity, just like we just merged icc/ifort
It makes for a much improved user experience not to have to understand that both icc and ifort have to be loaded despite Lmods spider saying you only need one...

Copy link
Member Author

@ocaisa ocaisa Oct 10, 2019

Choose a reason for hiding this comment

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

For Flang, I don't think that is actually a good idea. Flang is (unfortunately) working off forked versions of Clang/LLVM.

This is likely to very soon be out of date anyway...though I admit to being confused by the whole thing: f18 was supposed to replace flang but it seems it will actually take over the name flang (see here). Once that get's a release then it is very likely that incorporating flang will become a whole lot easier...it is probably best to wait it out.

@boegel boegel changed the title Flang add custom easyblock for Flang May 21, 2019
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

@ocaisa license header is missing

easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved

def disable_sanitizer_tests(self):
# Not relevant for flang
pass
Copy link
Member

Choose a reason for hiding this comment

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

Also drop?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I need to override what is in the clang easyblock here which attempts to patch files in the runtime (these do not exist for Flang).

easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Show resolved Hide resolved
easybuild/easyblocks/f/flang.py Outdated Show resolved Hide resolved
@ocaisa ocaisa requested a review from boegel May 22, 2019 10:29
@ocaisa
Copy link
Member Author

ocaisa commented Oct 10, 2019

This is expected to be out of date in a few months, and a much simpler solution possible:
http://fortranwiki.org/fortran/show/Flang

By the beginning of 2020, F18 is expected to replace Flang as a complete implementation of Fortran 2018.

@boegel boegel modified the milestones: 3.x, 4.x Feb 20, 2020
@ocaisa
Copy link
Member Author

ocaisa commented Apr 28, 2020

F18 has now become flang (see https://github.com/flang-compiler/f18) and can be built as an LLVM package in the normal way, this can be closed once it is included in an LLVM release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants