Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Add Intel openmp as a submodule and build for x86 architectures (#8730)
Browse files Browse the repository at this point in the history
* Refreshed branch intel_openmp

* Disable Intel OpenMP local build for Windows until a Windows user can fix

* Ignore 3rdparty license headers
  • Loading branch information
cjolivier01 authored and piiswrong committed Nov 22, 2017
1 parent a0031ac commit 1264313
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "cub"]
path = cub
url = https://github.com/dmlc/cub
[submodule "3rdparty/openmp"]
path = 3rdparty/openmp
url = https://github.com/llvm-mirror/openmp
1 change: 1 addition & 0 deletions 3rdparty/openmp
Submodule openmp added at 37c721
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build/private/local_config.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/build/private/local_config.cmake)
endif()

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules;${CMAKE_MODULE_PATH}")


if(MSVC)
set(SYSTEM_ARCHITECTURE x86_64)
else()
EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE SYSTEM_ARCHITECTURE)
endif()

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules;${CMAKE_MODULE_PATH}")

SET(EXTRA_OPERATORS "" CACHE PATH "EXTRA OPERATORS PATH")

Expand Down Expand Up @@ -263,11 +266,13 @@ endif()
# ---[ OpenMP
if(USE_OPENMP)
find_package(OpenMP REQUIRED)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/openmp/CMakeLists.txt)
# This should build on Windows, but there's some problem and I don;t have a Windows box, so
# could a Windows user please fix?
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openmp/CMakeLists.txt AND SYSTEM_ARCHITECTURE STREQUAL "x86_64" AND NOT MSVC)
# Intel/llvm OpenMP: https://github.com/llvm-mirror/openmp
set(OPENMP_STANDALONE_BUILD TRUE)
set(LIBOMP_ENABLE_SHARED FALSE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/openmp)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openmp)
list(REMOVE_ITEM mxnet_LINKER_LIBS iomp5)
list(APPEND mxnet_LINKER_LIBS omp)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
1. Fast R-CNN - For details, see example/rcnn/LICENSE
2. Faster R-CNN - For details, see example/rcnn/LICENSE
3. tree_lstm - For details, see example/gluon/tree_lstm/LICENSE
4. OpenMP - For details, see 3rdparty/openmp/LICENSE.txt


========================================================================
Expand Down
1 change: 1 addition & 0 deletions tools/license_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
'dmlc-core/',
'mshadow/',
'nnvm',
'3rdparty',
'ps-lite',
'src/operator/mkl/',
'src/operator/contrib/ctc_include/']
Expand Down

0 comments on commit 1264313

Please sign in to comment.