Skip to content

Fix using only one CPU core when compiling with Unix Makefiles#873

Closed
tangtang666 wants to merge 2 commits intoopencv:4.xfrom
tangtang666:4.x
Closed

Fix using only one CPU core when compiling with Unix Makefiles#873
tangtang666 wants to merge 2 commits intoopencv:4.xfrom
tangtang666:4.x

Conversation

@tangtang666
Copy link

No description provided.

setup.py Outdated
def main():
os.chdir(os.path.dirname(os.path.abspath(__file__)))

parallel_level = int(multiprocessing.cpu_count() / 2)

Choose a reason for hiding this comment

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

multiprocessing.cpu_count() = 1

then

parallel_level = 0

subprocess.check_call("patch -p0 < patches/patchOpenEXR", shell=True)
if sys.platform.startswith("linux"):
# add environ MAKEFLAGS = cpu_core_num/2
os.environ['MAKEFLAGS'] = '-j ' + str(parallel_level)

Choose a reason for hiding this comment

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

What if there is already MAKEFLAGS with own value?

@asmorkalov asmorkalov closed this Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants