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

Changing how Config.pl looks for the HDF5 high-level fortran library. #1934

Merged
merged 2 commits into from
Dec 10, 2023
Merged
Changes from all commits
Commits
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
16 changes: 13 additions & 3 deletions arch/Config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
$sw_time = "" ; # name of a timer to time fortran compiles, e.g. timex or time
$sw_ifort_r8 = 0 ;
$sw_hdf5 = "-lhdf5_hl -lhdf5";
$sw_hdf5_hl_fortran="-lhdf5_hl_fortran";
$sw_zlib = "-lz";
$sw_dep_lib_path = "";
$sw_gpfs_path = "";
Expand Down Expand Up @@ -349,6 +350,15 @@
$sw_ctsm_mkfile_path = $ENV{WRF_CTSM_MKFILE};
}

if ( $sw_hdf5_path ) {
opendir(my $dh, "$sw_hdf5_path/lib");
($hl) = grep(/hdf5hl_fortran/i, readdir $dh);
closedir($dh);
if ($hl ne "") {
$sw_hdf5_hl_fortran="-lhdf5hl_fortran";
}
}

# parse the configure.wrf file

$validresponse = 0 ;
Expand Down Expand Up @@ -453,6 +463,7 @@
} else {
$sw_terrain_and_landuse =" -DLANDREAD_STUB=1" ;
}

open CONFIGURE_DEFAULTS, "cat ./arch/configure.defaults |" ;
$latchon = 0 ;
while ( <CONFIGURE_DEFAULTS> )
Expand Down Expand Up @@ -732,7 +743,7 @@
}

if ( $sw_hdf5_path )
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz: ;
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib $sw_hdf5_hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz: ;
$_ =~ s:CONFIGURE_HDF5_FLAG:-DHDF5: ;
}
else
Expand Down Expand Up @@ -1120,7 +1131,7 @@
}

if ( $sw_hdf5_path )
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz: ;
{ $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib $sw_hdf5_hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz: ;
$_ =~ s:CONFIGURE_HDF5_FLAG:-DHDF5: ;
}
else
Expand Down Expand Up @@ -1200,4 +1211,3 @@
printf "Configuration successful! \n" ;
printf "------------------------------------------------------------------------\n" ;