Skip to content

Builds on 1 CPU #36

@yurivict

Description

@yurivict

The build should allow to be configured to work with multiple CPUs. There are -parallel [<jobs>] and -j [<jobs>] cmake arguments.

I've added this patch to the FreeBSD port as a workaround:

--- setup.py.orig       2023-05-25 10:49:17 UTC
+++ setup.py
@@ -248,7 +248,7 @@ class CMakeBuild(build_ext):
                              '-DWITH_LIBXML=OFF',
                          ]
                          )
-              self.spawn(['cmake', '--build', '.', '--target', 'install'] + build_args)
+              self.spawn(['cmake', '--build', '.', '-j', os.getenv('FREEBSD_MAKE_JOBS'), '--target', 'install'] + build_args)
               os.chdir(cwd)
             DEP_DIR = dep_inst_dir

@@ -297,7 +297,7 @@ class CMakeBuild(build_ext):
         os.chdir(build_temp)
         self.spawn(['cmake', SRC_DIR] + cmake_args)
         if not self.dry_run:
-            self.spawn(['cmake', '--build', '.', '--target', 'binding_python_lib'] + build_args)
+            self.spawn(['cmake', '--build', '.', '-j', os.getenv('FREEBSD_MAKE_JOBS'), '--target', 'binding_python_lib'] + build_args)

             # at this point the build should be complete, and we have all the files 
             # neeed in the temp build_folder

You can make it work in a similar way but with checking if the environment variable exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions