-
-
Notifications
You must be signed in to change notification settings - Fork 59
bump to latest hdf5 version and windows fortran support w/flang #217
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
base: main
Are you sure you want to change the base?
Conversation
@conda-forge-admin, please rerender |
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
…nda-forge-pinning 2024.04.16.09.40.08
@conda-forge-admin, please rerender |
…nda-forge-pinning 2024.04.16.09.40.08
Hey @h-vetinari, I tried flang-new here in hopes of compiling HDF5 with fortran enabled on windows. Unfortunately it fails during the configuration :( Any ideas where I ought to start looking? (I have posted a question about this on the flang-compiler slack channel also).
Based on
I had hopes that this could work given that it seems LLVM flang compiles HDF5 on linux. |
@conda-forge-admin, please rerender |
…nda-forge-pinning 2024.04.18.09.07.49
Okay, here's another update. Regarding the flang windows error. It seems the previous reported error was a simple CMake config forcing invalid flang comands. I added a patch for that which seems to work. The error we're seeing now is
And by closer inspection of the
it seems this might be related to llvm/llvm-project#77282. |
Hey, here's a small update. Once llvm/llvm-project#89403 is fixed it might be possible to compile HDF5 with fortran enabled on Windows using LLVM FLang. Related to HDFGroup/hdf5#4419 I'll just convert this PR to a draft for now (pending fix for LLVM flang). |
…est-hdf5 # Conflicts: # .ci_support/osx_64_mpimpich.yaml # .ci_support/osx_64_mpinompi.yaml # .ci_support/osx_64_mpiopenmpi.yaml # recipe/bld.bat # recipe/conda_build_config.yaml # recipe/meta.yaml
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( For recipe/meta.yaml:
|
@conda-forge-admin, please rerender |
…nda-forge-pinning 2024.10.12.05.36.28
@conda-forge-admin, please rerender |
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipe/meta.yaml:
For recipe/meta.yaml:
|
Hey @h-vetinari and @mjklemm. I thought I would revisit this. Seeing as the HDF5 configuration still fails on the kinds check (see #217 (comment) for reference) on windows. @mjklemm Did you manage to compile hdf5 on windows using a locally compiled version of flang? If so I might want to test compiling it for myself just to see what we're doing differently in our conda-forge build. I thought I would simply skip this check by simply hardcoding the supported real and integers by flang. By doing something like this I managed to finish the configuration step, and start compiling! if (CMAKE_Fortran_COMPILER MATCHES "flang")
message(STATUS "PROG_OUTPUT=${PROG_OUTPUT}. Force override with \"1,4,8;4,8,16;33;3;3;4;1,4,8;\"")
set(PROG_OUTPUT "1,4,8;4,8,16;33;3;3;4;1,4,8;")
else ()
# Convert the string to a list of strings by replacing the carriage return with a semicolon
string (REGEX REPLACE "[\r\n]+" ";" PROG_OUTPUT "${PROG_OUTPUT}")
endif () It runs for a bit until the compilation fails due to [401/3074] Building C object fortran\src\CMakeFiles\hdf5_f90cstub-shared.dir\H5_f.c.obj
FAILED: fortran/src/CMakeFiles/hdf5_f90cstub-shared.dir/H5_f.c.obj
%BUILD_PREFIX%\Library\bin\clang-cl.exe /nologo -DH5_BUILT_AS_DYNAMIC_LIB -D_BIND_TO_CURRENT_VCLIBS_VERSION=1 -D_CONSOLE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -Dhdf5_f90cstub_shared_EXPORTS -I%SRC_DIR%\src -I%SRC_DIR%\src\H5FDsubfiling -I%SRC_DIR%\build\src -I%SRC_DIR%\build\fortran -I%SRC_DIR%\build\fortran\shared -I%PREFIX%\Library\include -w /DWIN32 /D_WINDOWS /O2 /Ob2 /DNDEBUG -MD -Wall -Warray-bounds -Wcast-qual -Wconversion -Wdouble-promotion -Wextra -Wformat=2 -Wframe-larger-than=16384 -Wimplicit-fallthrough -Wnull-dereference -Wunused-const-variable -Wwrite-strings -Wpedantic -Wvolatile-register-var -Wno-c++-compat /W3 /wd4100 /wd4706 /wd4127 /showIncludes /Fofortran\src\CMakeFiles\hdf5_f90cstub-shared.dir\H5_f.c.obj /Fdfortran\src\CMakeFiles\hdf5_f90cstub-shared.dir\ -c -- %SRC_DIR%\fortran\src\H5_f.c
%SRC_DIR%\fortran\src\H5_f.c(187,16): error: use of undeclared identifier 'real_C_LONG_DOUBLE_f'
187 | if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(float)) {
| ^
%SRC_DIR%\fortran\src\H5_f.c(191,21): error: use of undeclared identifier 'real_C_LONG_DOUBLE_f'
191 | else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(double)) {
| ^
%SRC_DIR%\fortran\src\H5_f.c(196,21): error: use of undeclared identifier 'real_C_LONG_DOUBLE_f'
196 | else if (sizeof(real_C_LONG_DOUBLE_f) == sizeof(long double)) {
| ^
3 errors generated.
[402/3074] Building C object fortran\src\CMakeFiles\hdf5_f90cstub-shared.dir\H5Af.c.obj
[403/3074] Building C object fortran\src\CMakeFiles\hdf5_f90cstub-shared.dir\H5Df.c.obj
ninja: build stopped: subcommand failed.
Update: Okay, I think I solved it. Or at least I managed to get past the error message by adding the following to #ifndef real_C_LONG_DOUBLE_f
#define real_C_LONG_DOUBLE_f long double
#endif The next error is related to BIND(C) statements. Hm, are BIND(C) not supported by flang on windows?
Or maybe it's BIND(C) and the use of passing argument by value like so? subroutine mysub(x) bind(c)
integer, value :: x ! x is passed by value, not by reference
end subroutine mysub |
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( I do have some suggestions for making it better though... For recipe/meta.yaml:
This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/13397952320. Examine the logs at this URL for more detail. |
The |
@h-vetinari Yup, it looks like it. I can raise an issue over at the llvm-project to see if it is on their radar. In the meantime to progress development on windows fortran support for hdf5 I opened #237 where I try to use the latest m2w64 libs. It looks quite promising from the local tests I did. |
@h-vetinari Seems like this is already fixed in the flang main branch (hopefully on track for v20). See llvm/llvm-project#114035 (comment). I'll try to test this asap. If it works, then we can consider issueing a pre-release of flang v20 on a non-main conda-forge label. |
This is a nontrivial effort (not extreme either, but it needs a strong reason to do it). I probably won't get around to doing it, but if you want, you can do the following:
You can expect this process to take at least a week (not work hours, but iterations to get things building and waiting for CI). I can help out if you're stuck somewhere, but that's about as much as I can promise for now. |
Hey @h-vetinari, I revisited the HDF5 fortran compilation on windows recently. I compiled the latest LLVM Flang from the main branch to see what is fixed and what is not. As it turns out, LLVM Flang does not seem to be quite ready for the fortran compilation of HDF5 quite yet. See my latest comment -> llvm/llvm-project#114035 (comment). On the plus side, the So from what I can tell, Flang v20 at the moment should pass the cmake configuration step, but it will most likely fail compiling the full HDF5 code base. |
…est-hdf5 # Conflicts: # .azure-pipelines/azure-pipelines-linux.yml # .azure-pipelines/azure-pipelines-osx.yml # .azure-pipelines/azure-pipelines-win.yml # .ci_support/linux_64_mpimpich.yaml # .ci_support/linux_64_mpinompi.yaml # .ci_support/linux_64_mpiopenmpi.yaml # .ci_support/linux_aarch64_mpimpich.yaml # .ci_support/linux_aarch64_mpinompi.yaml # .ci_support/linux_aarch64_mpiopenmpi.yaml # .ci_support/linux_ppc64le_mpimpich.yaml # .ci_support/linux_ppc64le_mpinompi.yaml # .ci_support/linux_ppc64le_mpiopenmpi.yaml # .ci_support/osx_64_mpimpich.yaml # .ci_support/osx_64_mpinompi.yaml # .ci_support/osx_64_mpiopenmpi.yaml # .ci_support/osx_arm64_mpimpich.yaml # .ci_support/osx_arm64_mpinompi.yaml # .ci_support/osx_arm64_mpiopenmpi.yaml # .scripts/build_steps.sh # .scripts/run_osx_build.sh # .scripts/run_win_build.bat # README.md # azure-pipelines.yml # recipe/conda_build_config.yaml # recipe/meta.yaml
@conda-forge-admin, please rerender |
I thought I might give fortran support for windows a try here as well (seeing as we've had some success in adding fortran support on windows using flang in mumps, mgis, mfront).
However, it failed locally in my initial attempts on windows with
Fortran compiler requires either intrinsic functions SIZEOF or STORAGE_SIZE
If that is not a quick fix, I can take the fortran support out and put it in a different PR.
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)