File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,15 @@ def add_libraries_to_sli(paths: Union[str, Sequence[str]]):
71
71
72
72
73
73
class NESTBuilder (Builder ):
74
- r"""Compile, build and install the NEST C++ code and NEST extension module."""
74
+ r"""Compile, build and install the NEST C++ code and NEST extension module.
75
+
76
+ Options:
77
+ ``max_n_compiler_processes``: limit the maximum number of processes used for compilation. Used for ``-j`` compiler parameter.
78
+ """
75
79
76
80
_default_options = {
77
- "nest_path" : None
81
+ "nest_path" : None ,
82
+ "max_n_compiler_processes" : 4
78
83
}
79
84
80
85
def __init__ (self , options : Optional [Mapping [str , Any ]] = None ):
@@ -130,9 +135,11 @@ def build(self) -> None:
130
135
except AttributeError :
131
136
n_cpu = os .cpu_count ()
132
137
138
+ n_compiler_processes = min (n_cpu , self .get_option ("max_n_compiler_processes" ))
139
+
133
140
nest_config_path = f"-Dwith-nest={ os .path .join (nest_path , 'bin' , 'nest-config' )} "
134
141
cmake_cmd = ['cmake' , nest_config_path , install_prefix , '.' ]
135
- make_all_cmd = ['make' , f'-j{ n_cpu } ' , 'all' ]
142
+ make_all_cmd = ['make' , f'-j{ n_compiler_processes } ' , 'all' ]
136
143
make_install_cmd = ['make' , 'install' ]
137
144
138
145
# remove CMakeCache.txt if exists
You can’t perform that action at this time.
0 commit comments