-
Notifications
You must be signed in to change notification settings - Fork 99
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
Enable Flang-RT for all Flang builders. #333
base: main
Are you sure you want to change the base?
Conversation
@gkistanova The get the buildsbots green after pushing llvm/llvm-project#110217, pushing this PR and restarting the buildbot master would be time-critical. Is it possible to schedule these things together so we can minimize the time the buildbots are failing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Meinersbur ,
I'm checking updated builder configurations for flang-runtime-cuda-gcc
and flang-runtime-cuda-clang
locally on users/meinersbur/flang_runtime
branch. My review is for these builders.
In additional, I have noticed the following build error for flang-runtime-cuda-gcc
builder with these changes:
[1/14] Generating ../../../../include/flang/__fortran_builtins.mod
FAILED:include/flang/__fortran_builtins.mod /home/buildbot/worker/temp/build-flang-runtime-gcc/include/flang/__fortran_builtins.mod
cd /home/buildbot/worker/temp/build-flang-runtime-gcc/tools/flang/tools/f18 && /usr/bin/cmake -E make_directory /home/buildbot/worker/temp/build-flang-runtime-gcc/include/flang && /home/buildbot/worker/temp/build-flang-runtime-gcc/bin/flang -cpp -fsyntax-only -module-dir /home/buildbot/worker/temp/build-flang-runtime-gcc/include/flang /home/buildbot/worker/temp/llvm-project/flang/module/__fortran_builtins.f90
Error creating directory "/home/buildbot/worker/temp/build-flang-runtime-gcc/include/flang".
ninja: build stopped: subcommand failed.
it gets failed because that folder was already exist. The step has passed after I removed the directory. Not sure, but possible because of the changes.
}, | ||
targets = ["FortranRuntime"], | ||
src_to_build_dir = "flang/runtime", | ||
targets = ["flang_rt"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be "flang-rt" instead of "flang_rt"
cmake --build . --target flang_rt
ninja: error: unknown target 'flang_rt', did you mean 'flang-rt'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, ... and no. Both targets should exist. flang-rt
for all non-EXCLUDE_FROM_ALL artifacts, flang_rt
for only the artifact called flang_rt
(usually libflang_rt.a
) which corresponds to the old FortranRuntime
. I don't know why it does not exist.
Anyway, changing it to flang-rt
.
targets = ["FortranRuntime"], | ||
src_to_build_dir = "flang/runtime", | ||
targets = ["flang_rt"], | ||
src_to_build_dir = "flang-rt", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line must be removed. There is no llvm-project/flang-rt
project's folder. Should be used default (llvm).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I misunderstood the purpose of this paramters. I assumed it was the CMake build directory.
For runtimes it should be runtimes
, which corresponds to https://github.com/llvm/llvm-project/blob/main/runtimes/CMakeLists.txt. It contains the boilerplate for an out-of-source build of any runtime project like flang-rt, like llvm/CMakeLists.txt
is for all LLVM_ENABLE_PROJECTS
.
Just in case, the cmake/build commands for 'flang-runtime-cuda-gcc' and 'flang-runtime-cuda-clang' I used for checking:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for trying out. I currently don't understand why depends_on_projects
does not work, it should derive it automatically. This line tells the LLVMBuildFactory that flang-rt
should be put into enable_runtimes
: https://github.com/Meinersbur/llvm-zorg/blob/0db03958adf4c6c96d94d625b30959482b079954/zorg/buildbot/process/factory.py#L15
Did you apply it? How did you test the configuration? In the past I did it by seeting up my own buildbot master, but that requires some effort.
It seems that I underestimated the effort. Since @gkistanova also did not respond to ensure a timely application of both patches, I will keep the old way to build the runtime unless LLVM_ENABLE_RUNTIMES=flang-rt
is passed. This way the buildbots can be updated iteratively.
it gets failed because that folder was already exist. The step has passed after I removed the directory. Not sure, but possible because of the changes.
The command should not fail if the directory already exists, as by its documentation. Maybe a permission problem?
}, | ||
targets = ["FortranRuntime"], | ||
src_to_build_dir = "flang/runtime", | ||
targets = ["flang_rt"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, ... and no. Both targets should exist. flang-rt
for all non-EXCLUDE_FROM_ALL artifacts, flang_rt
for only the artifact called flang_rt
(usually libflang_rt.a
) which corresponds to the old FortranRuntime
. I don't know why it does not exist.
Anyway, changing it to flang-rt
.
targets = ["FortranRuntime"], | ||
src_to_build_dir = "flang/runtime", | ||
targets = ["flang_rt"], | ||
src_to_build_dir = "flang-rt", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I misunderstood the purpose of this paramters. I assumed it was the CMake build directory.
For runtimes it should be runtimes
, which corresponds to https://github.com/llvm/llvm-project/blob/main/runtimes/CMakeLists.txt. It contains the boilerplate for an out-of-source build of any runtime project like flang-rt, like llvm/CMakeLists.txt
is for all LLVM_ENABLE_PROJECTS
.
It is less effort than it used to be: https://llvm.org/docs/HowToAddABuilder.html#testing-a-builder-config-locally. |
@DavidSpickett Thanks, that will be helpful. 😎 |
I didn't apply your buildbot patch. I jet took the expanded cmake/build commands from the appropriate builds for I didn't check
It didn't look like a permission problem, but possible. I'm just letting you know about the seen problems, just in case. |
With the change in |
Modify all build configurations that build Flang to also build Flang-RT. Flang-RT is the runtime component of Flang that is refactored into its own runtime project in llvm/llvm-project#110217.
The following classes of builder are affected:
Builders with
LLVM_ENABLE_PROJECTS=flang
and runningcheck-flang
: AddingLLVM_ENABLE_RUNTIMES=flang-rt
andcheck-flang-rt
. These builders would continue to be green after [Flang] LLVM_ENABLE_RUNTIMES=flang-rt llvm-project#110217 even without this PR, just testing less.Clang builders with
checkout_flang=True
: Automatically addflang-rt
todepends_on_projects
which also addsLLVM_ENABLE_PROJECTS
withenable_runtimes="auto".
These builders would continue to be green after [Flang] LLVM_ENABLE_RUNTIMES=flang-rt llvm-project#110217 even without this PR, just testing less.Clang builders with
checkout_flang=True
andrunTestSuite=True
: Running the the test-suite with Flang requires Flang-RT, so these builders would start failing with [Flang] LLVM_ENABLE_RUNTIMES=flang-rt llvm-project#110217 without this PR.linaro-flang-aarch64-out-of-tree: Has its own build factory that would require larger changes to also check/run Flang-RT. Should stay green even after [Flang] LLVM_ENABLE_RUNTIMES=flang-rt llvm-project#110217.
flang-runtime-cuda-gcc: Only compiles but does not run check. Used to be a
flang/runtime
out-of-tree build. Runtime-only builds of Flang-RT needs the path toflang
. I do not know where/whether this can be found on the workers so changing it to a bootstrap build. More important to keep the buildbots green.flang-runtime-cuda-clang: Staged build of first compiling LLVM+Clang, then Flang out-of-tree. With this PR also building Flang in-tree and Flang-RT as runtime-only build. Building both Flang and Flang-RT out-of-tree would require another stage, but "linaro-flang-aarch64-out-of-tree" is already testing the Flang out-of-tree build.