Skip to content

Commit

Permalink
limit number of threads when compiling KMC (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
karasikov authored Dec 15, 2021
1 parent 43ed600 commit a1e41fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion metagraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
if(result)
message(FATAL_ERROR "CMake step for KMC failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build . --config Release -- -j
include(ProcessorCount)
ProcessorCount(N)
if(N EQUAL 0)
set(N 1)
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build . --config Release -- -j${N}
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/KMC
)
Expand Down

0 comments on commit a1e41fb

Please sign in to comment.