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
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

if [ $? -ne 0 ];then
exit 1
fi
Expand Down Expand Up @@ -214,7 +214,7 @@ BuildJsonCPP()
if [ $? -ne 0 ];then
exit 1
fi
make
make -j4
if [ $? -ne 0 ];then
exit 1
fi
Expand Down Expand Up @@ -255,7 +255,7 @@ BuildBoost()
fi
echo "build boost static #####################"
pwd
./b2 cflags=-fPIC cxxflags=-fPIC --with-atomic --with-thread --with-system --with-chrono --with-date_time --with-log --with-regex --with-serialization --with-filesystem --with-locale --with-iostreams threading=multi link=static release install --prefix=${install_lib_dir}
./b2 -j10 cflags=-fPIC cxxflags=-fPIC --with-atomic --with-thread --with-system --with-chrono --with-date_time --with-log --with-regex --with-serialization --with-filesystem --with-locale --with-iostreams threading=multi link=static release install --prefix=${install_lib_dir}
if [ $? -ne 0 ];then
exit 1
fi
Expand All @@ -269,7 +269,7 @@ BuildRocketMQClient()
else
cmake .. -DRUN_UNIT_TEST=ON
fi
make
make -j4
if [ $? -ne 0 ];then
exit 1
fi
Expand Down Expand Up @@ -307,7 +307,7 @@ BuildGoogleTest()
if [ $? -ne 0 ];then
exit 1
fi
make
make -j4
if [ $? -ne 0 ];then
exit 1
fi
Expand Down