Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
edd5efb5
There was an error fetching the commit references. Please try again later.
Commit
edd5efb5
authored
5 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Improved build script to count physical cores on all NUMA nodes
parent
a4ff26e4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build
+6
-2
6 additions, 2 deletions
build
with
6 additions
and
2 deletions
build
+
6
−
2
View file @
edd5efb5
...
@@ -206,18 +206,22 @@ if [[ ${CMAKE_ONLY} == "yes" ]]; then
...
@@ -206,18 +206,22 @@ if [[ ${CMAKE_ONLY} == "yes" ]]; then
exit
0
exit
0
fi
fi
# get the number of physical cores present on the system, even with multiple NUMA nodes
# see https://unix.stackexchange.com/a/279354
SYSTEM_CORES
=
$
(
lscpu
--
all
--
parse
=
CORE
,
SOCKET
|
grep
-
Ev
"
^#
"
|
sort
-
u
|
wc
-
l
)
if
[[
"
$make
"
==
"
make
"
]];
then
if
[[
"
$make
"
==
"
make
"
]];
then
if
[[
-
n
$
{
BUILD_JOBS
}
]];
then
if
[[
-
n
$
{
BUILD_JOBS
}
]];
then
# override $MAKEFLAGS from parent environment
# override $MAKEFLAGS from parent environment
export
MAKEFLAGS
=-
j
$
{
BUILD_JOBS
}
export
MAKEFLAGS
=-
j
$
{
BUILD_JOBS
}
elif
[[
-
z
$
{
MAKEFLAGS
}
]];
then
elif
[[
-
z
$
{
MAKEFLAGS
}
]];
then
# $BUILD_JOBS and $MAKEFLAGS are not set => set default value
# $BUILD_JOBS and $MAKEFLAGS are not set => set default value
BUILD_JOBS
=
$
(
grep
"
core id
"
/
proc
/
cpuinfo
|
sort
-
u
|
wc
-
l
)
BUILD_JOBS
=
$
SYSTEM_CORES
export
MAKEFLAGS
=-
j
$
{
BUILD_JOBS
}
export
MAKEFLAGS
=-
j
$
{
BUILD_JOBS
}
fi
fi
else
else
if
[[
-
z
$
{
BUILD_JOBS
}
]];
then
if
[[
-
z
$
{
BUILD_JOBS
}
]];
then
BUILD_JOBS
=
$
(
grep
"
core id
"
/
proc
/
cpuinfo
|
sort
-
u
|
wc
-
l
)
BUILD_JOBS
=
$
SYSTEM_CORES
fi
fi
make
=
"
$make -j$BUILD_JOBS
"
make
=
"
$make -j$BUILD_JOBS
"
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment