Ignore:
Timestamp:
Apr 8, 2024, 10:51:53 AM (6 weeks ago)
Author:
abarral
Message:

fix XIOS compilation
add make_j arg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install_amaury/install_lmdz.sh

    r4891 r4893  
    7979    opt_cosp=""
    8080
     81    make_j=8
     82
    8183    # Check if on a Mac
    8284    if [[ $(uname) = "Darwin" ]]; then
     
    140142
    141143        -arch_dir   where to find the arch files (default <$arch_dir>)
     144
     145        -make_j     number of processes to parallelize installations (default <$make_j>)
    142146
    143147........fin
     
    173177            "-arch_dir") arch_dir=$2; shift; shift;;
    174178            "-veget") veget=$2; shift; shift;;
     179            "-make_j") make_j=$2; shift; shift;;
    175180            *)  bash install_lmdz.sh -h; exit 1
    176181        esac
     
    312317    # Copy arch to different components
    313318    # TODO check that this doesn't error if the source and destination are the same
    314     for dir in "IOIPSL" "ORCHIDEE" "LMDZ"; do
     319    for dir in "IOIPSL" "ORCHIDEE" "LMDZ" "XIOS"; do
    315320        \cp -f "$arch_dir/arch-$arch.fcm" "$MODEL/modipsl/modeles/$dir/arch"
    316321        \cp -f "$arch_dir/arch-$arch.path" "$MODEL/modipsl/modeles/$dir/arch"
     
    319324    # TODO TEMP compat w/ old orch version - make a proper case later
    320325    sed -i'' -e "s/-I//" -e "s/-L//" "$MODEL/modipsl/modeles/ORCHIDEE/arch/arch-$arch.path"  # /!\ we only replace first occurence on purpose
     326
     327    # Adapt for XIOS, which uses different naming conventions
     328    # TODO >:c ugly fdefault-real-8 fix
     329    sed -i'' -e "s/%COMPILER/%FCOMPILER/" -e "s/%LINK/%LINKER/" -e "s/-fdefault-real-8//" "$MODEL/modipsl/modeles/XIOS/arch/arch-$arch.fcm"
    321330}
    322331
     
    425434    if [[ $with_xios = 1 ]]; then
    426435        cd "$MODEL/modipsl/modeles"
    427         xioslog="$(pwd)/xios.log"
     436        xioslog="$(pwd)/XIOS/xios.log"
    428437        echo "##########################################################"
    429438        echo "Compiling XIOS (log $xioslog) $(date)"
     
    445454
    446455        cd XIOS
    447         if ! ./make_xios --arch "$arch" --job 8 --arch_path "$arch_dir" > "$xioslog" 2>&1; then
     456        if ! ./make_xios --arch "$arch" --job 8 > "$xioslog" 2>&1; then
    448457            echo "XIOS compilation failed, exiting"; exit 1
    449458        fi
     
    451460        echo "Compiled XIOS $(date)"
    452461    fi
     462
     463    XIOS_LIBDIR_="$MODEL/modipsl/modeles/XIOS/lib"
     464    XIOS_INCDIR_="$MODEL/modipsl/modeles/XIOS/inc"
    453465}
    454466
     
    458470    elif [[ $veget = "CMIP6" ]]; then
    459471        veget_version=orchidee2.0
    460         orchidee_rev=6592
    461472    else # specific orchidee revision newer than CMIP6, on 2_1 or 2_2 branches
    462473        veget_version=orchidee2.1
    463         orchidee_rev="$veget"
    464474        if [[ $veget -lt 4465 ]]; then
    465475            echo 'ORCHIDEE version must be >=4465, exiting'
     
    510520        local varenv="IOIPSL_LIBDIR_=$IOIPSL_LIBDIR_ IOIPSL_INCDIR_=$IOIPSL_INCDIR_ ORCHPATH=$ORCHPATH"
    511521        if [[ $parallel = "none" ]]; then
    512             echo "$varenv ./makeorchidee_fcm $xios_orchid $opt_orc -parallel none -arch $arch -j 8" > compile.sh
     522            echo "$varenv ./makeorchidee_fcm $xios_orchid $opt_orc -parallel none -arch $arch -j $make_j" > compile.sh
    513523        else
    514524            if [[ ! -d src_parallel ]]; then
     
    516526            fi
    517527            {
    518                 echo "$varenv ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc -parallel $parallel -arch $arch"
    519                 echo "$varenv ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel $parallel -arch $arch"
     528                echo "$varenv ./makeorchidee_fcm -j $make_j -clean $xios_orchid $opt_orc -parallel $parallel -arch $arch"
     529                echo "$varenv ./makeorchidee_fcm -j $make_j $xios_orchid $opt_orc -parallel $parallel -arch $arch"
    520530            } > compile.sh
    521531        fi
     
    576586
    577587    # Compile
    578     local varenv="IOIPSL_LIBDIR_=$IOIPSL_LIBDIR_ IOIPSL_INCDIR_=$IOIPSL_INCDIR_ ORCH_LIBDIR_=$ORCH_LIBDIR_ ORCHPATH=$ORCHPATH"
    579     makelmdz="makelmdz_fcm $optim_debug -arch $arch -j 8"
     588    local varenv="IOIPSL_LIBDIR_=$IOIPSL_LIBDIR_ IOIPSL_INCDIR_=$IOIPSL_INCDIR_ ORCH_LIBDIR_=$ORCH_LIBDIR_ ORCHPATH=$ORCHPATH XIOS_INCDIR_=$XIOS_INCDIR_ XIOS_LIBDIR_=$XIOS_LIBDIR_"
     589    makelmdz="makelmdz_fcm $optim_debug -arch $arch -j $make_j"
    580590    if [[ $parallel = "none" ]]; then
    581591        echo "$varenv ./$makelmdz $opt_rad $opt_cosp -d ${grid_resolution} -v $veget_version gcm " > compile.sh
     
    603613
    604614    if [[ $bench = "tuto" ]]; then
    605         myget Training/tutorial.tar; tar xf tutorial.tar; cd TUTORIAL
     615        myget "Training/tutorial.tar"; tar xf tutorial.tar; cd TUTORIAL
    606616        ./init.sh
    607617    elif [[ $bench = 1 ]]; then
     
    810820install_netcdf
    811821install_IOIPSL
    812 #install_XIOS  # TODO disabled for now, did not decide which flags/arch to use for compile
     822install_XIOS
    813823compile_orchidee
    814824compile_lmdz
Note: See TracChangeset for help on using the changeset viewer.