-
Notifications
You must be signed in to change notification settings - Fork 10
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 support for flang #220
Comments
At the moment we have a couple issues. One, we need to update HDF5 as 1.10 has no idea what flang is. We've held on to 1.10 for now only because of the odd But, we know GEOS is happy with hdf5 1.14 from spack, so let's just update for testing. However, I just tried to build HDF5 1.14.4.3 and I believe I hit the same bug as @mjklemm did in llvm/llvm-project#89403. (Indeed, I was about to file a bug in llvm-compiler but, well, I was beaten by a good 3 months!) This code was added in HDFGroup/hdf5#4246 by @derobins via @brtnfld ad by the time stamp, I'm guessing this is in 1.14.4 range, so I'll back off to 1.14.3 before this code got in. |
I have a patch for this ready hopefully soon. I was more work than anticipated, but the patch seems to now work for Linux. The Windows part is still in the works. PS: Don't try this yet, it's still in the works. I can ping here, once it's ready for a test. |
Thanks! Note with 1.14.3:
I search a bit and I find something on the hdf5 site by a developer of the name, huh, @mjklemm : HDFGroup/hdf5#4419 So, yeah, I'm definitely late to this party! 😄 |
Note: I'm also using autotools for HDF5 (for...historical reasons more than anything else) so I might be missing errors that CMake would find in different ways. |
I have a patch for that, too. Problem is that Flang reports that it supports FP16 and BF16 types, which it does for regular arithmetics, but it does not provide all the intrinsic. SPACING being one of them. I have a hacks patch that disables the tests in HDF5. Let me know if you'd like to get it and I will see how I can best provide it. Logged at LLVM as llvm/llvm-project#83894. |
There are other issues with flang and HDF5, |
Adding a comment here about a doc by @jeffhammond saying how he's built HDF5 with flang: https://github.com/jeffhammond/HPCInfo/blob/master/docs/NetCFD_HDF5_Flang.md I'll need to give that a try at some point. |
I'll note my effort is the same as AMD folks did two weeks ago. |
Did all the Fortran HDF5 tests pass? |
Haven't had a chance to test on my end yet. Other fires being put out at the moment. Whee! |
@brtnfld Good news, bad news. First, I built flang-new as of yesterday:
With that and with HDF5 1.14.4.3 and using the "comment out
I see So I guess two things:
|
I did check and I can do a |
Do you have the same issue if you use mpich (compiled with flang) instead of openmpi? |
Hmm. That is a good question. Let me try and see! (Need to brush up on my "how to build mpich"... 😄 ) |
Update: I built MPICH but it didn't build Still, my guess is HDF5 doesn't yet require that, so I'll move forward for now. |
Update again! MPICH got past the place that Open MPI failed on, so I guess I'm going to try |
Correct, |
Update as of 2024-Oct-23. Built new flang-new and for HDF5, still need to comment out the |
Okay, with some hacks to hdf5 and esmf, they build. But a test of MAPL showed a change in flang-new behavior, see llvm/llvm-project#113487 It's like flang OpenMP has...changed. I'll see what they say... |
Hey @mathomp4, we're also looking into building hdf5 using flang over at conda-forge/hdf5-feedstock#217 (however in that PR we're focusing mainly on windows). Just wondering if you have managed to successfully compile hdf5 using flang on linux? And if so, didn't you run into this issue? [444/3074] Building Fortran object fortran\src\CMakeFiles\hdf5_fortran-shared.dir\H5VLff.F90.obj
FAILED: fortran/src/CMakeFiles/hdf5_fortran-shared.dir/H5VLff.F90.obj mod/shared/h5vl.mod
%BUILD_PREFIX%\Library\bin\flang-new.exe -I%SRC_DIR%\fortran\src -I%SRC_DIR%\fortran\src -I%SRC_DIR%\build\mod\shared -I%SRC_DIR%\build\fortran -I%SRC_DIR%\build\fortran\src -I%SRC_DIR%\src -I%SRC_DIR%\src\H5FDsubfiling -I%SRC_DIR%\build\src -I%PREFIX%\Library\include -D_CRT_SECURE_NO_WARNINGS -D_MT -D_DLL --target=x86_64-pc-windows-msvc -fms-runtime-lib=dll -module-dirmod\shared -ffixed-line-length-72 -o fortran\src\CMakeFiles\hdf5_fortran-shared.dir\H5VLff.F90.obj -c fortran\src\CMakeFiles\hdf5_fortran-shared.dir\H5VLff.F90-pp.f90
error: loc("D:\\bld\\hdf5_1730135420238\\work\\fortran\\src\\H5VLff.F90":456:32): C:\bld\flang-split_1725521580766\work\flang\lib\Optimizer\CodeGen\Target.cpp:102: not yet implemented: passing VALUE BIND(C) derived type for this target
LLVM ERROR: aborting
|
@Krande Huh. That is a new error to me. I'm still disabling all the |
Interesting. I'll try to compile HDF5 on linux too using the same changes I made to the source code and see if that turns out differently. For reference I was using HDF5 v1.14.5 and flang v19.1.2. I see you mentioned that you were running the latest flang from main. I'll probably give that a go as well. Which HDF5 version did you compile? |
@Krande It would have been HDF5 1.14.5 as well. But this was, as you say, flang 20.0.0git of whatever it calls the version from git (as of last week). Note that I'm not quite good enough at autotools or whatever to figure out how to fix the few files I need to correctly in source. From what I see, the changes I make are to files generated during the build. So sadly |
Due to successes by @tclune in looking at flang + GFE (with a shoutout to @rouson), we should work on getting flang supported in Baselibs.
Current progress:
The text was updated successfully, but these errors were encountered: