You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
** EDITED 9/23 for clarity **
It appears that not all versions of perl have the 'switch' module installed as a default, and I found it somewhat difficult to install the switch module on my system. 'Switch' is used in the .config script, located here:
Based on my reading it sounds like the 'given/when' syntax is preferred with new versions of perl.
With the aid of a ChatGPT, I was able to replace the switch statements with given/when which appears to work:
#!/usr/bin/perl
use feature 'switch';
if ($#ARGV == 0) {
$response = shift(@ARGV);
print("Configure HRLDAS: $response \n");
} else {
print "Please select from the following supported architectures: \n\n";
print " 1. Linux PGI compiler serial \n";
print " 2. Linux PGI compiler MPI \n";
print " 3. Linux intel compiler serial \n";
print " 4. Linux intel compiler MPI \n";
print " 5. Linux intel compiler MPI (NCAR/Derecho) \n";
print " 6. Linux gfortran/gcc compiler serial \n";
print " 7. Linux gfortran/gcc compiler MPI \n";
print " 8. Linux gfortran/gcc compiler MPI (NCAR/Derecho) \n";
print " 9. Linux gfortran/gcc compiler MPI (Docker container) \n";
print " 0. exit only \n";
printf "\nEnter selection [%d-%d] : ", 0, 9;
$response = <STDIN>;
chomp($response);
}
given ($response) {
when (1) {
# serial PGI
system "cp arch/user_build_options.pgi.serial user_build_options";
}
when (2) {
# MPI PGI
system "cp arch/user_build_options.pgi.mpi user_build_options";
}
when (3) {
# serial intel
system "cp arch/user_build_options.ifort.serial user_build_options";
}
when (4) {
# MPI intel
system "cp arch/user_build_options.ifort.mpi user_build_options";
}
when (5) {
# MPI intel (NCAR/Derecho)
system "cp arch/user_build_options.ifort.mpi.derecho user_build_options";
}
when (6) {
# serial GFORTRAN
system "cp arch/user_build_options.gfortran.serial user_build_options";
}
when (7) {
# MPI GFORTRAN
system "cp arch/user_build_options.gfortran.mpi user_build_options";
}
when (8) {
# MPI GFORTRAN (NCAR/Derecho)
system "cp arch/user_build_options.gfortran.mpi.derecho user_build_options";
}
when (9) {
# MPI GFORTRAN for Docker container
system "cp arch/user_build_options.gfortran.mpi.container user_build_options";
}
default {
print "no selection $response\n";
last;
}
}
print "The user_build_options file used for compiling source code has been successfully generated. \n";
print "Please check and change the software package path in the generated user_build_options file before compiling! \n";
The text was updated successfully, but these errors were encountered:
** EDITED 9/23 for clarity **
It appears that not all versions of perl have the 'switch' module installed as a default, and I found it somewhat difficult to install the switch module on my system. 'Switch' is used in the .config script, located here:
hrldas/hrldas/configure
Line 26 in e6853ef
Based on my reading it sounds like the 'given/when' syntax is preferred with new versions of perl.
With the aid of a ChatGPT, I was able to replace the switch statements with given/when which appears to work:
The text was updated successfully, but these errors were encountered: