Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support muti-thread compile in build.sh #127

Merged
merged 3 commits into from
Aug 1, 2019
Merged

Conversation

chuenfaiy
Copy link
Contributor

What is the purpose of the change

to speed up compilation

Brief changelog

Added the parameter -j for make in build.sh

Verifying this change

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when a cross-module dependency exists.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@ShannonDing ShannonDing changed the title build.sh中为make增加了多线程编译参数 Support muti-thread compile in build.sh Apr 8, 2019
@ShannonDing ShannonDing added the enhancement New feature or request label Apr 8, 2019
build.sh Outdated
@@ -176,7 +176,7 @@ BuildLibevent()
if [ $? -ne 0 ];then
exit 1
fi
make
make -j
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use make -j ${NUM_CORE},
and let get NUM_CORE automatically.

build.sh Outdated
@@ -214,7 +214,7 @@ BuildJsonCPP()
if [ $? -ne 0 ];then
exit 1
fi
make
make -j
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please Uniform amendment to make -j4 ?

-j [jobs], --jobs[=jobs]
Specifies the number of jobs (commands) to run simultaneously. If there is more than one -j option, the last one is effective.If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously.

@jonnxu
Copy link
Contributor

jonnxu commented Jul 24, 2019

@chuenfaiy

build.sh Outdated
@@ -176,7 +176,7 @@ BuildLibevent()
if [ $? -ne 0 ];then
exit 1
fi
make
make -j4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's define a variable to set the num of cpus like:

NUM_CPUS=4
...

make -j $NUM_CPUS

So that if some one's machine has 16 cores, he/she can specify this simply.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

Copy link
Contributor

@jovany-wang jovany-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM.

@jonnxu jonnxu added this to the 1.2.3 milestone Aug 1, 2019
@jonnxu jonnxu merged commit 88aae5a into apache:master Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants