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

bump to latest hdf5 version and windows fortran support w/flang #217

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
100850f
bump to latest hdf5 version and also add test for windows fortran usi…
Krande Apr 16, 2024
15f7ce9
MNT: Re-rendered with conda-build 24.3.0, conda-smithy 3.34.1, and co…
Apr 16, 2024
66591a3
do not use flang as a compiler (sets to v5 of flang)
Krande Apr 16, 2024
08faf42
MNT: Re-rendered with conda-build 24.3.0, conda-smithy 3.34.1, and co…
Apr 16, 2024
69f3cb0
add patch to solve failing fortran tests
Krande Apr 18, 2024
cb9214f
MNT: Re-rendered with conda-build 24.3.0, conda-smithy 3.34.1, and co…
Apr 18, 2024
4a837f1
Merge remote-tracking branch 'refs/remotes/upstream/main' into pr-lat…
Krande Jul 31, 2024
49e471d
test flang 19.1.0.rc
Krande Jul 31, 2024
0ad9ed1
MNT: Re-rendered with conda-build 24.5.1, conda-smithy 3.37.1, and co…
Jul 31, 2024
db55550
add fortran flang rc to build config
Krande Jul 31, 2024
9776497
MNT: Re-rendered with conda-build 24.5.1, conda-smithy 3.37.1, and co…
Jul 31, 2024
74b1f59
add manual override
Krande Aug 3, 2024
aad938e
let compiler activation do its job
h-vetinari Aug 4, 2024
d8b88aa
DEBUG: temporarily vendor flang compiler activation
h-vetinari Aug 4, 2024
7ddc20b
CMake doesn't like backslashes
h-vetinari Aug 4, 2024
b7665e0
this fixes the hdf5 configuration, but it fails with no such file or …
Krande Aug 4, 2024
23bbdf0
bump to 1.14.4.3 version
Krande Aug 10, 2024
a4676cb
try setting openmpi linux cpu count to 3
Krande Aug 10, 2024
3ca7f88
try setting openmpi mpiexec linux cpu count to 3 and revert clang bui…
Krande Aug 10, 2024
6610ff6
Merge remote-tracking branch 'origin/main' into pr-latest-hdf5
Krande Oct 12, 2024
e267132
sync with main and test with latest flang
Krande Oct 12, 2024
a5c6d50
MNT: Re-rendered with conda-build 24.9.0, conda-smithy 3.42.1, and co…
Oct 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-osx.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion .ci_support/win_64_mpiimpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ c_compiler:
c_stdlib:
- vs
channel_sources:
- conda-forge
- conda-forge/label/llvm_rc,conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- vs2019
fortran_compiler:
- flang
fortran_compiler_version:
- '19'
hdf5:
- 1.14.3
libaec:
Expand Down
6 changes: 5 additions & 1 deletion .ci_support/win_64_mpinompi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ c_compiler:
c_stdlib:
- vs
channel_sources:
- conda-forge
- conda-forge/label/llvm_rc,conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- vs2019
fortran_compiler:
- flang
fortran_compiler_version:
- '19'
hdf5:
- 1.14.3
libaec:
Expand Down
33 changes: 29 additions & 4 deletions azure-pipelines.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 88 additions & 0 deletions recipe/bld-flang.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
@echo on
setlocal EnableDelayedExpansion

mkdir build
cd build

REM set clanglibdir=%CONDA_PREFIX:\=/%/lib/clang/19/lib/windows
REM copy "%clanglibdir%\clang_rt.builtins-x86_64.lib" "%LIBRARY_LIB%\clang_rt.builtins.lib"

:: Set environment variables.
set HDF5_EXT_ZLIB=zlib.lib

:: temporarily vendor flang compiler activation
set "FC=flang-new"
set "CC=clang-cl"
set "CXX=clang-cl"

:: need to read clang version for path to compiler-rt
FOR /F "tokens=* USEBACKQ" %%F IN (`clang.exe -dumpversion`) DO (
SET "CLANG_VER=%%F"
)
set "FFLAGS=-D_CRT_SECURE_NO_WARNINGS -D_MT -D_DLL --target=x86_64-pc-windows-msvc"
set "LDFLAGS=--target=x86_64-pc-windows-msvc -fms-runtime-lib=dll -fuse-ld=lld"
set "LDFLAGS=%LDFLAGS% -Wl,-defaultlib:%BUILD_PREFIX%/Library/lib/clang/!CLANG_VER:~0,2!/lib/windows/clang_rt.builtins-x86_64.lib"


set "CXXFLAGS=%CXXFLAGS% -LTCG"
if "%mpi%"=="impi" (
:: cmake generates syntax errors if there are backslashes in paths
set _LIBRARY=%LIBRARY_PREFIX:\=/%
set "CMAKE_ARGS=!CMAKE_ARGS! -D MPI_C_ADDITIONAL_INCLUDE_DIRS:PATH=!_LIBRARY!/include"
set "CMAKE_ARGS=!CMAKE_ARGS! -D MPI_CXX_ADDITIONAL_INCLUDE_DIRS:PATH=!_LIBRARY!/include"
set "CMAKE_ARGS=!CMAKE_ARGS! -D MPI_C_LIB_NAMES=IMPI"
set "CMAKE_ARGS=!CMAKE_ARGS! -D MPI_CXX_LIB_NAMES=IMPI"
set "CMAKE_ARGS=!CMAKE_ARGS! -D MPI_IMPI_LIBRARY:PATH=!_LIBRARY!/lib/impi.lib"
set "CMAKE_ARGS=!CMAKE_ARGS! -D MPI_ASSUME_NO_BUILTIN_MPI=ON"
set "CMAKE_ARGS=!CMAKE_ARGS! -D MPI_SKIP_COMPILER_WRAPPER=ON"
set "CMAKE_ARGS=!CMAKE_ARGS! -D MPI_SKIP_GUESSING=ON"
set "CMAKE_ARGS=!CMAKE_ARGS! -D HDF5_ENABLE_PARALLEL:BOOL=ON"
)

echo "CMAKE_ARGS=!CMAKE_ARGS!"

:: Configure step.
cmake -G "Ninja" ^
!CMAKE_ARGS! ^
-D CMAKE_BUILD_TYPE:STRING=RELEASE ^
-D CMAKE_PREFIX_PATH:PATH=%LIBRARY_PREFIX% ^
-D CMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^
-D CMAKE_Fortran_COMPILER:STRING=%FC% ^
-D HDF5_BUILD_CPP_LIB:BOOL=ON ^
-D CMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON ^
-D BUILD_SHARED_LIBS:BOOL=ON ^
-D BUILD_STATIC_LIBS:BOOL=OFF ^
-D ONLY_SHARED_LIBS:BOOL=ON ^
-D HDF5_BUILD_HL_LIB:BOOL=ON ^
-D HDF5_BUILD_TOOLS:BOOL=ON ^
-D HDF5_BUILD_FORTRAN:BOOL=ON ^
-D HDF5_BUILD_HL_GIF_TOOLS:BOOL=ON ^
-D HDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON ^
-D HDF5_ENABLE_THREADSAFE:BOOL=ON ^
-D HDF5_ENABLE_ROS3_VFD:BOOL=ON ^
-D HDF5_ENABLE_SZIP_SUPPORT=ON ^
-D ALLOW_UNSUPPORTED:BOOL=ON ^
%SRC_DIR%

if errorlevel 1 (
dir CMakeFiles
type CMakeFiles\CMakeOutput.log
type CMakeFiles\CMakeError.log
type CMakeFiles\CMakeConfigureLog.yaml
exit /b 1
)

:: Build C libraries and tools.
ninja
if errorlevel 1 exit 1

:: Install step.
ninja install
if errorlevel 1 exit 1

:: Remove extraneous COPYING file that gets installed automatically
:: https://github.com/conda-forge/hdf5-feedstock/issues/87
del /f %PREFIX%\Library\COPYING
if errorlevel 1 exit 1
del /f %PREFIX%\Library\RELEASE.txt
if errorlevel 1 exit 1
10 changes: 9 additions & 1 deletion recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ mpi:
- nompi
- impi # [win]
- mpich # [unix]
- openmpi # [unix]
- openmpi # [unix]

channel_sources:
- conda-forge/label/llvm_rc,conda-forge # [win]

fortran_compiler: # [win]
- flang # [win]
fortran_compiler_version: # [win]
- '19' # [win]
4 changes: 3 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ source:
- patches/0002-run-host-H5detect-when-cross-compiling.patch # [osx and build_platform != target_platform]
# Fix operator= (https://github.com/HDFGroup/hdf5/pull/4473)
- patches/ea760136.patch
- patches/fix_flang_flags.patch # [win]

build:
number: {{ build }}
string: {{ mpi_prefix }}_h{{ PKG_HASH }}_{{ build }}
script: '{{ RECIPE_DIR}}/bld-flang.bat' # [win]
run_exports:
- {{ pin_subpackage('hdf5', max_pin='x.x.x') }} {{ build_pin }}

Expand All @@ -67,7 +69,7 @@ requirements:
- {{ compiler('c') }}
- {{ stdlib('c') }}
- {{ compiler('cxx') }}
- {{ compiler('fortran') }} # [not win]
- {{ compiler('fortran') }}
- cmake # [win]
- automake # [not win]
- autoconf # [not win]
Expand Down
25 changes: 25 additions & 0 deletions recipe/patches/fix_flang_flags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Subject: [PATCH] fix flang flags
---
Index: config/cmake/ConfigureChecks.cmake
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
--- a/config/cmake/ConfigureChecks.cmake (revision 4041d6f34ffa4630cfb60ce1f42b6cb9ab715a6b)
+++ b/config/cmake/ConfigureChecks.cmake (date 1713426546921)
@@ -61,7 +61,13 @@
if (WIN32 AND NOT MINGW)
if (NOT UNIX)
set (WINDOWS 1)
- set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1")
+ # IF CMAKE_Fortran_COMPILER contains
+ if (CMAKE_Fortran_COMPILER MATCHES "flang")
+ message(STATUS "Using flang-new compiler")
+ set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
+ else ()
+ set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1")
+ endif ()
if (MSVC)
set (${HDF_PREFIX}_HAVE_VISUAL_STUDIO 1)
endif ()
Loading