-
Notifications
You must be signed in to change notification settings - Fork 160
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
Conversation
build.sh
Outdated
@@ -176,7 +176,7 @@ BuildLibevent() | |||
if [ $? -ne 0 ];then | |||
exit 1 | |||
fi | |||
make | |||
make -j |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
build.sh
Outdated
@@ -176,7 +176,7 @@ BuildLibevent() | |||
if [ $? -ne 0 ];then | |||
exit 1 | |||
fi | |||
make | |||
make -j4 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks LGTM.
What is the purpose of the change
to speed up compilation
Brief changelog
Added the parameter
-j
for make inbuild.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
.[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.