mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-11 17:29:30 +08:00
packages.nvhpcPackages.hdf5: fix
This commit is contained in:
@@ -105,8 +105,11 @@ inputs: rec
|
||||
{
|
||||
stdenv = inputs.pkgs.callPackage ./nvhpc/stdenv.nix { src = inputs.topInputs.self.src.nvhpc; };
|
||||
fmt = (inputs.pkgs.fmt.override { inherit (final) stdenv; }).overrideAttrs { doCheck = false; };
|
||||
hdf5 = inputs.pkgs.hdf5.override
|
||||
{ inherit (final) stdenv; cppSupport = false; fortranSupport = true; enableShared = false; enableStatic = true; };
|
||||
hdf5 = (inputs.pkgs.hdf5-fortran.override { inherit (final) stdenv; cppSupport = false; }).overrideAttrs (prev:
|
||||
{
|
||||
patches = prev.patches or [] ++ [ ./nvhpc/hdf5.patch ];
|
||||
cmakeFlags = prev.cmakeFlags ++ [ "-DHDF5_ENABLE_NONSTANDARD_FEATURE_FLOAT16=OFF" ];
|
||||
});
|
||||
mpi = inputs.pkgs.callPackage ./nvhpc/mpi.nix
|
||||
{ inherit (final) stdenv; src = inputs.topInputs.self.src.nvhpc.mpi; };
|
||||
});
|
||||
|
||||
69
packages/nvhpc/hdf5.patch
Normal file
69
packages/nvhpc/hdf5.patch
Normal file
@@ -0,0 +1,69 @@
|
||||
From 09bc016321faca145169fcd0b5a9f871c1b40a6d Mon Sep 17 00:00:00 2001
|
||||
From: Luke Robison <108305344+lrbison@users.noreply.github.com>
|
||||
Date: Fri, 11 Apr 2025 14:24:09 -0500
|
||||
Subject: [PATCH] Fortran configury: Ensure F08 real_kinds are actually valid
|
||||
kinds (#5401)
|
||||
|
||||
Issue: https://github.com/HDFGroup/hdf5/issues/5090
|
||||
---
|
||||
m4/aclocal_fc.f90 | 24 ++++++++++++++++--------
|
||||
1 file changed, 16 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90
|
||||
index 9e0dc1d14e8..40d380724fd 100644
|
||||
--- a/m4/aclocal_fc.f90
|
||||
+++ b/m4/aclocal_fc.f90
|
||||
@@ -183,8 +183,11 @@ END PROGRAM FC_AVAIL_KINDS
|
||||
PROGRAM FC08_AVAIL_KINDS
|
||||
USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT, integer_kinds, real_kinds, logical_kinds
|
||||
IMPLICIT NONE
|
||||
- INTEGER :: ik, jk, k, max_decimal_prec
|
||||
+ INTEGER :: ik, jk, k, kk, max_decimal_prec
|
||||
INTEGER :: num_rkinds, num_ikinds, num_lkinds
|
||||
+ LOGICAL :: found_rkinds( 1:SIZE(real_kinds) )
|
||||
+ CHARACTER(LEN=1) :: sep
|
||||
+
|
||||
|
||||
! Find integer KINDs
|
||||
|
||||
@@ -203,28 +206,33 @@ PROGRAM FC08_AVAIL_KINDS
|
||||
|
||||
num_rkinds = SIZE(real_kinds)
|
||||
|
||||
+ ! some compilers (ACfL 24) reported REAL=16 kind, but refused to
|
||||
+ ! compile with it. Verify the kind can be selected in SELECTED_REAL_KIND.
|
||||
+ found_rkinds(:) = .FALSE.
|
||||
max_decimal_prec = 1
|
||||
|
||||
prec: DO ik = 2, 36
|
||||
exp: DO jk = 1, 700
|
||||
k = SELECTED_REAL_KIND(ik,jk)
|
||||
IF(k.LT.0) EXIT exp
|
||||
+ DO kk = 1,num_rkinds
|
||||
+ IF (real_kinds(kk) == k) found_rkinds(kk) = .TRUE.
|
||||
+ ENDDO
|
||||
max_decimal_prec = ik
|
||||
ENDDO exp
|
||||
ENDDO prec
|
||||
|
||||
+ sep = ""
|
||||
DO k = 1, num_rkinds
|
||||
- WRITE(stdout,'(I0)', ADVANCE='NO') real_kinds(k)
|
||||
- IF(k.NE.num_rkinds)THEN
|
||||
- WRITE(stdout,'(A)',ADVANCE='NO') ','
|
||||
- ELSE
|
||||
- WRITE(stdout,'()')
|
||||
- ENDIF
|
||||
+ IF(.NOT. found_rkinds(k)) CYCLE
|
||||
+ WRITE(stdout,'(A,I0)', ADVANCE='NO') TRIM(sep), real_kinds(k)
|
||||
+ sep = ","
|
||||
ENDDO
|
||||
+ WRITE(stdout,'()')
|
||||
|
||||
WRITE(stdout,'(I0)') max_decimal_prec
|
||||
WRITE(stdout,'(I0)') num_ikinds
|
||||
- WRITE(stdout,'(I0)') num_rkinds
|
||||
+ WRITE(stdout,'(I0)') COUNT(found_rkinds)
|
||||
|
||||
! Find logical KINDs
|
||||
|
||||
Reference in New Issue
Block a user