Changeset 645ec47


Ignore:
Timestamp:
11/15/2023 05:24:22 PM (6 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, trunk
Children:
3c43655
Parents:
1352172
git-author:
Pierre Labastie <pierre.labastie@…> (11/15/2023 05:04:05 PM)
git-committer:
Pierre Labastie <pierre.labastie@…> (11/15/2023 05:24:22 PM)
Message:

Reorganize advanced options in Config.in

  • Put parallelization menu first
  • Fix the logic for variable definitions in this menu
  • change jhalfs to reflect the separation of optimization and parallelization
  • validate new variables
  • remove MAKEFLAGS from the validation of optimize variables
  • also remove the black list, which has not been used in years.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Config.in

    r1352172 r645ec47  
    772772depends on !BOOK_BLFS
    773773
     774    #--- Parallelism
     775    menu "Parallelism settings"
     776    if HAVE_NPROC
     777        config ALL_CORES
     778        bool "Use all cores as in new books (say n for old books)"
     779        default y
     780        help
     781              Use book instructions as written for parallelism since version
     782              r12.0-87 included. If you answer no, then jhalfs will fall back
     783              to a static number of cores, defined below. If you answer y, and
     784              your system supports it, you'll be asked for a cpu set to use.
     785                 There is no detection of book version. If the book version
     786              is lower than r12.0-87, say no!
     787
     788        if ALL_CORES && HAVE_CGROUP
     789            config CPUSET
     790            string "set of cpus to use, or 'all' for all cpus"
     791            default "all"
     792            help
     793                 See "List format" in cpuset(7). Choosing cpus depend
     794                 on the topology of your processors. Sometimes two
     795                 hyperthreads on the same core are numbered consecutively.
     796                 For example for using all cores and no hyperthreading on
     797                 a Haswell, use "0,2,4,6". Other brands may have a different
     798                 topology, and may require e.g. "0-3" to use the first 4 cores.
     799                 If not sure, keep the default.
     800        endif
     801
     802    endif # HAVE_NPROC
     803    if !HAVE_NPROC
     804        config ALL_CORES
     805        bool
     806        default n
     807    endif
     808
     809    config    N_PARALLEL
     810        int "Number of parallel `make' jobs"
     811        depends on !ALL_CORES
     812        default 1
     813        help
     814            #-- The usual recommandation is (number of CPU cores)+1
     815            #   Do not set for meaningful SBU calculations.
     816
     817    config    REALSBU
     818        bool    "Build Binutils pass1 without parallelism (Real SBU)"
     819        default    n
     820        help
     821           #-- Use -j1 in make invokation for Binutils pass1 to
     822           #   get a valid SBU value.
     823    endmenu # parallelism
     824
     825    #--- Optimizations
     826    config    CONFIG_OPTIMIZE
     827        bool    "Optimization"
     828        default    n
     829        help
     830            #   Opens a menu for various optimization settings:
     831            #   Actual optimization flags MUST be defined in ./optimize/*
     832            #   before activating this option.
     833            #
     834            # WARNING: The use of build optimizations may lead to build issues.
     835            #   If the system doesn't work as expected, please rebuild
     836            #   without optimizations before asking for support.
     837    menu    "Optimization settings"
     838        depends on CONFIG_OPTIMIZE
     839
     840    choice
     841        prompt "Optimization level"
     842        default OPT_1
     843        help
     844            #-- Optimization values are set in optimize/* files
     845
     846        config    OPT_1
     847            bool    "Final system only"
     848
     849        config    OPT_2
     850            bool    "Both temp tools and final system"
     851
     852    endchoice
     853
     854    endmenu # Optimization settings
     855    config    OPTIMIZE
     856        int
     857        default    "0"    if !CONFIG_OPTIMIZE
     858        default    "1"    if OPT_1
     859        default    "2"    if OPT_2
     860
     861    #--- End Optimizations
     862
    774863    config    REPORT
    775864        bool "Create SBU and disk usage report"
     
    817906
    818907    #--- End ICA
    819 
    820     #--- Optimizations
    821     config    CONFIG_OPTIMIZE
    822         bool    "Optimization"
    823         default    n
    824         help
    825             #   Opens a menu for various optimization settings:
    826             #   Actual optimization flags MUST be defined in ./optimize/*
    827             #   before activating this option.
    828             #
    829             # WARNING: The use of build optimizations may lead to build issues.
    830             #   If the system doesn't work as expected, please rebuild
    831             #   without optimizations before asking for support.
    832     menu    "Optimization settings"
    833         depends on CONFIG_OPTIMIZE
    834 
    835     choice
    836         prompt "Optimization level"
    837         default OPT_1
    838         help
    839             #-- Optimization values are set in optimize/* files
    840 
    841         config    OPT_1
    842             bool    "Final system only"
    843 
    844         config    OPT_2
    845             bool    "Both temp tools and final system"
    846 
    847     endchoice
    848 
    849     endmenu # Optimization settings
    850     config    OPTIMIZE
    851         int
    852         default    "0"    if !CONFIG_OPTIMIZE
    853         default    "1"    if OPT_1
    854         default    "2"    if OPT_2
    855 
    856     #--- End Optimizations
    857     #--- Parallelism
    858     menu "Parallelism settings"
    859     if HAVE_NPROC
    860         config ALL_CORES
    861         bool "Use all cores as in the book"
    862         default y
    863         help
    864               Use book instructions as written for parallelism. If you
    865               answer no, then jhalfs will fall back to a static number of
    866               cores, defined below. If you answer y, and your system
    867               supports it, you'll be asked for a cpu set to use.
    868 
    869         if HAVE_CGROUP
    870             config CPUSET
    871             string "set of cpus to use, or 'all' for all cpus"
    872             default "all"
    873             help
    874                  See "List format" in cpuset(7). Choosing cpus depend
    875                  on the topology of your processors. Sometimes two
    876                  hyperthreads on the same core are numbered consecutively.
    877                  For example for using all cores and no hyperthreading on
    878                  a Haswell, use "0,2,4,6". Other brands may have a different
    879                  topology, and may require e.g. "0-3" to use the first 4 cores.
    880                  If not sure, keep the default.
    881         endif
    882         if !HAVE_CGROUP
    883             config CPUSET
    884             string
    885             default "all"
    886         endif
    887 
    888     endif # HAVE_NPROC
    889     if !HAVE_NPROC
    890         config ALL_CORES
    891         bool
    892         default n
    893     endif
    894 
    895     config    N_PARALLEL
    896         int "Number of parallel `make' jobs"
    897         depends on !ALL_CORES
    898         default 1
    899         help
    900             #-- The usual recommandation is (number of CPU cores)+1
    901             #   Do not set for meaningful SBU calculations.
    902 
    903     config    REALSBU
    904         bool    "Build Binutls pass1 without parallelism (Real SBU)"
    905         depends on ALL_CORES != 1
    906         default    n
    907         help
    908            #-- Use -j1 in make invokation for Binutils pass1 to
    909            #   get a valid SBU value.
    910     endmenu # parallelism
    911 
    912908
    913909    #-- Internal Settings
  • common/libs/func_validate_configs.sh

    r1352172 r645ec47  
    3636
    3737  # Full list of books settings
    38   local -r   lfs_PARAM_LIST="$LFS_book   $GENERAL_common $LFS_build $LFS_system  $ADVANCED_chroot N_PARALLEL REALSBU SAVE_CH5 $ADVANCED_common"
     38  local -r   lfs_PARAM_LIST="$LFS_book   $GENERAL_common $LFS_build $LFS_system  $ADVANCED_chroot ALL_CORES CPUSET N_PARALLEL REALSBU SAVE_CH5 $ADVANCED_common"
    3939#  local -r  blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
    4040
     
    134134      RETRYDOWNLOADCNT) [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    135135      DOWNLOADTIMEOUT)  [[ "$GETPKG" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    136       N_PARALLEL)       [[ "$OPTIMIZE" -gt "0" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    137       REALSBU)          [[ "$OPTIMIZE" = "2" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     136      CPUSET)           [[ "$HAVE_CGROUP" = "y" ]] && [[ "$ALL_CORES" = "y" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
     137      N_PARALLEL)       [[ "$ALL_CORES" = "n" ]] && echo -e "`eval echo $PARAM_VALS`" ;;
    138138
    139139      # Envars that requires some validation
  • jhalfs

    r1352172 r645ec47  
    176176UNICODE=${UNICODE:=n}
    177177LOCAL=${LOCAL:=n}
     178ALL_CORES=${ALL_CORES:=n}
    178179REALSBU=${REALSBU:=n}
    179180SAVE_CH5=${SAVE_CH5:=n}
     
    288289  # optimize configurations
    289290  load_file optimize/opt_config 'Loading optimization config'
    290   # The number of parallel jobs is taken from configuration now
     291  # Validate optimize settings, if required
     292  validate_opt_settings
     293fi
     294# Parallelization is outside optimization, because it is now in the book
     295if [[ "$ALL_CORES" = "n" ]]; then
    291296  # shellcheck disable=SC2034
    292297  JH_MAKEFLAGS="-j${N_PARALLEL}"
    293   # Validate optimize settings, if required
    294   validate_opt_settings
    295298fi
    296299#
  • optimize/optimize_functions

    r1352172 r645ec47  
    1717  echo -e "asking for support.${OFF}\n"
    1818
    19   echo -e "MAKEFLAGS: ${L_arrow}${BOLD}${JH_MAKEFLAGS}${OFF}${R_arrow}"
    20   [ -n "$JH_MAKEFLAGS" ] && \
    21   echo -e "BLACK_LIST: ${L_arrow}${BOLD}${BLACK_LIST}${OFF}${R_arrow}\n"
     19#  [ -n "$JH_MAKEFLAGS" ] && \
     20#  echo -e "BLACK_LIST: ${L_arrow}${BOLD}${BLACK_LIST}${OFF}${R_arrow}\n"
    2221
    2322  echo -e "DEF_OPT_MODE: ${L_arrow}${BOLD}${DEF_OPT_MODE}${OFF}${R_arrow}\n"
Note: See TracChangeset for help on using the changeset viewer.