Skip to content

Commit 2ac1d8f

Browse files
committed
fix parallel in cmake
1 parent 7d2afb5 commit 2ac1d8f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

3rdparty/CMakeLists.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
add_subdirectory(googletest)
22

3-
set(DNNL_BUILD_EXAMPLES OFF CACHE BOOL "Build examples")
4-
set(DNNL_BUILD_TESTS OFF CACHE BOOL "Build tests")
5-
set(DNNL_CPU_RUNTIME "OMP" CACHE STRING "CPU runtime")
6-
set(DNNL_GRAPH_DISABLE ON CACHE BOOL "Disable dnnl graph")
7-
set(CMAKE_BUILD_PARALLEL_LEVEL 2 CACHE STRING "Parallel build level")
3+
set(DNNL_BUILD_EXAMPLES OFF)
4+
set(DNNL_BUILD_TESTS OFF)
5+
set(DNNL_CPU_RUNTIME "OMP")
6+
set(DNNL_GRAPH_DISABLE ON)
87
set(DNNL_GRAPH_BUILD_TESTS OFF)
98
set(DNNL_GRAPH_BUILD_EXAMPLES OFF)
109

11-
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
12-
set(DNNL_ARCH_OPT_FLAGS "-O2" CACHE STRING "Architecture optimization flags")
10+
if(UNIX AND NOT APPLE)
11+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -j2")
12+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -j2")
1313
endif()
1414

1515
add_subdirectory(oneDNN)
1616

17+
if(UNIX AND NOT APPLE)
18+
set(CMAKE_C_FLAGS "")
19+
set(CMAKE_CXX_FLAGS "")
20+
endif()
21+
1722
# Unified TBB Configuration
1823
option(TBB_TEST "Build TBB tests" OFF)
1924
option(TBB_EXAMPLES "Build TBB examples" OFF)

0 commit comments

Comments
 (0)