Changeset 5398 for BOL/script_install
- Timestamp:
- Dec 9, 2024, 3:50:19 PM (7 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install/install_lmdz.sh
r5387 r5398 365 365 366 366 function download_modipsl_tar { 367 if [[ $clean_install = 1 ]]; then rm -rf "$MODEL"; fi 367 if [[ $clean_install = 1 ]]; then 368 local ans 369 echo "$MODEL already exists. Do you want to erase it and proceed (Y/n) ? You can also rerun with \`-noclean\` to only recompile the necessary components." 370 read -r ans 371 ans="${ans,,}" # to lowercase 372 if [[ $ans != "y" ]]; then exit 0; fi 373 rm -rf "$MODEL" 374 fi 368 375 369 376 mkdir -p "$MODEL" … … 411 418 412 419 # load env 413 # shellcheck disable=SC1090414 420 if [[ -f $default_env_path ]]; then source "$default_env_path"; fi 415 421 416 422 local mpi_file # can't be done before as it depends on sourcing the env 417 set +e # install_lmdz must be able to run without mpi 418 mpi_file=$(readlink -e -f "$(which mpif90)") 419 path_mpi=$(dirname "$mpi_file") 420 root_mpi=$(dirname "$path_mpi") 421 set -e 423 if [[ $parallel != "none" ]]; then 424 if [[ $(which "mpif90") = "" ]]; then 425 echo "STOP: parallel=$parallel but <mpif90> could not be found"; exit 1 426 fi 427 mpi_file=$(readlink -e -f "$(which mpif90)") 428 path_mpi=$(dirname "$mpi_file") 429 root_mpi=$(dirname "$path_mpi") 430 fi 422 431 } 423 432 … … 523 532 fi 524 533 534 # add exported netcdf path to .env if not already the case. This ensures we always use the same netcdf library as during the first install. 535 if [[ $(nf-config --prefix) = "" || $(nc-config --prefix) = "" ]]; then 536 echo "STOP: missing nf-config or nc-config in \$PATH"; exit 1 537 fi 538 local nc_path nf_path env_msg env_msg_tail 539 nc_path=$(nc-config --prefix) 540 nf_path=$(nf-config --prefix) 541 env_msg="export PATH=\"$nc_path/bin:\$PATH\"" 542 if [[ $nf_path != "$nc_path" ]]; then 543 env_msg="export PATH=\"$nf_path/bin:$env_msg\"" 544 fi 545 env_msg_tail="# netcdf bin path auto-added by install_lmdz.sh" 546 env_msg="$env_msg $env_msg_tail" 547 if ! < "$default_env_path" grep -q "$env_msg"; then 548 sed -i "1s@^@$env_msg\n@" "$default_env_path" 549 fi 550 551 # Test if netcdf works fine on a simple program 525 552 cat >test_netcdf90.f90 <<EOF 526 553 use netcdf … … 911 938 echo "ulimit -s unlimited" >> bench.sh 912 939 fi 913 if which mpirun &> /dev/null; then940 if [[ $(which "mpirun") != "" ]]; then 914 941 echo "mpirun -np 2 gcm.e &> listing" >> bench.sh 915 942 elif grep -q "Adastra" /etc/motd; then … … 1050 1077 1051 1078 function wrapper_run_all() { 1079 # This is a wrapper to catch any "unexpected" error due to set -e and avoid abrupt stoppage which may confuse the user 1052 1080 set_default_params 1053 1081 read_cmdline_args "$@"
Note: See TracChangeset
for help on using the changeset viewer.