You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/11/22 22:38:58 UTC

[GitHub] piiswrong closed pull request #8730: Add Intel openmp as a submodule and build for x86 architectures

piiswrong closed pull request #8730: Add Intel openmp as a submodule and build for x86 architectures
URL: https://github.com/apache/incubator-mxnet/pull/8730
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.gitmodules b/.gitmodules
index 7a76cbaf78..f9b2ab68f4 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -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
diff --git a/3rdparty/openmp b/3rdparty/openmp
new file mode 160000
index 0000000000..37c72127e9
--- /dev/null
+++ b/3rdparty/openmp
@@ -0,0 +1 @@
+Subproject commit 37c72127e90360a020f351f18d9cccfc30e5145a
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6bb814182..dd17917154 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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")
 
@@ -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}")
diff --git a/LICENSE b/LICENSE
index 01dfcf4679..4173ec8045 100644
--- a/LICENSE
+++ b/LICENSE
@@ -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
 
 
     ========================================================================
diff --git a/tools/license_header.py b/tools/license_header.py
index e26fd2beca..29538d13da 100644
--- a/tools/license_header.py
+++ b/tools/license_header.py
@@ -61,6 +61,7 @@
                'dmlc-core/',
                'mshadow/',
                'nnvm',
+               '3rdparty',   
                'ps-lite',
                'src/operator/mkl/',
                'src/operator/contrib/ctc_include/']


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services