1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MAKEOPTS doesn't work in make.conf

Discussion in 'Installation and Maintenance of Ports or Packages' started by kenorb, Nov 9, 2010.

  1. kenorb

    kenorb New Member

    Messages:
    330
    Likes Received:
    0
    I've added following lines into make.conf
    Code:
    MAKEOPTS="-j8"
    
    But it doesn't work.

    Tested on:
    Code:
    > sudo portupgrade -f mtr
    
    Code:
    > sudo portupgrade -f sl
    
    Why?
    It's a bug or feature?

    P.S. Could find anything in: man make.conf
     
  2. graudeejs

    graudeejs Member

    Messages:
    4,594
    Likes Received:
    0
  3. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    6
    Because it's a Linux option.
     
  4. graudeejs

    graudeejs Member

    Messages:
    4,594
    Likes Received:
    0
    I thought I've heard about this option, but wasn't sure.
    Now I remember, I've been using it myself on GNU/Linux Gentoo :)
     
  5. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,203
    Likes Received:
    14
    In FreeBSD's /etc/make.conf that would be
    Code:
    MAKE_JOBS_NUMBER=8
    
    At least for ports, I don't think that affects other source.
     
  6. kenorb

    kenorb New Member

    Messages:
    330
    Likes Received:
    0
    Code:
    > man make.conf | less +/MAKE_JOBS_NUMBER
    Pattern not found  (press RETURN)
    
    Why is not documented or where it's?
     
  7. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    6
    Read /usr/ports/Mk/bsd.port.mk.
     
  8. kenorb

    kenorb New Member

    Messages:
    330
    Likes Received:
    0
    Following posts in this forum point to that variable:
    http://forums.freebsd.org/showthread.php?p=1886#post1886
    http://forums.freebsd.org/showthread.php?p=17289#post17289
    http://forums.freebsd.org/showthread.php?p=96467#post96467 (it kind of works?)
    http://forums.freebsd.org/showthread.php?p=100851#post100851
    http://forums.freebsd.org/showthread.php?p=107599#post107599
    http://forums.freebsd.org/showthread.php?p=10561#post10561 (even to MAKEOPT)

    And found thousands of examples in Google.

    How it's possible that it doesn't work and even that half of the people have it in make.conf?
    They all are wrong?
     
  9. kenorb

    kenorb New Member

    Messages:
    330
    Likes Received:
    0
    Code:
    # Multiple make jobs support
    .if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
    _MAKE_JOBS=             #
    .else
    .if defined(MAKE_JOBS_SAFE) || defined(FORCE_MAKE_JOBS)
    MAKE_JOBS_NUMBER?=      `${SYSCTL} -n kern.smp.cpus`
    _MAKE_JOBS?=            -j${MAKE_JOBS_NUMBER}
    .if defined(FORCE_MAKE_JOBS) && !defined(MAKE_JOBS_SAFE)
    BUILD_FAIL_MESSAGE+=    "You have chosen to use multiple make jobs (parallelization) for all ports.  This port was not tested for this setting.  Please remove FORCE_MAKE_
    JOBS and retry the build before reporting the failure to the maintainer."
    .endif
    .endif
    .endif
    
    That mean you need to define MAKE_JOBS_SAFE or FORCE_MAKE_JOBS, to define MAKE_JOBS_NUMBER?
     
  10. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,392
    Likes Received:
    6
    Why don't you just read the remarks?

    Code:
    ##
    # MAKE_JOBS_SAFE
    #                               - This port can safely be built on multiple cpus in parallel.
    #                                 The make will be invoked with -jX parameter where X equals
    #                                 number of cores present in the system.
    # MAKE_JOBS_UNSAFE
    #                               - Disallow multiple jobs even when user set a global override.
    #                                 To be used with known bad ports.
    # DISABLE_MAKE_JOBS
    #                               - Set to disable the multiple jobs feature.  User settable.
    # FORCE_MAKE_JOBS
    #                               - Force all ports to be built with multiple jobs, except ports
    #                                 that are explicitly marked MAKE_JOBS_UNSAFE.  User settable.
    # MAKE_JOBS_NUMBER
    #                               - Override the number of make jobs to be used.  User settable.
    
     
  11. kenorb

    kenorb New Member

    Messages:
    330
    Likes Received:
    0
  12. graudeejs

    graudeejs Member

    Messages:
    4,594
    Likes Received:
    0
    Linuxis has deep roots
     
  13. ckester

    ckester New Member

    Messages:
    288
    Likes Received:
    0
    Yep. Linuxisms are like kudzu.

    Or English Ivy, if you're a Pacific Northwesterner like me. Forever climbing up the trunks of our trees and threatening to bring them down with all its extra weight. You should yank it out wherever you find it!

    We must all be vigilant in order to preserve our ecosystems. Use only native plants ... and native BSD commands.

    ;)