[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17751: Fix MKL static link & default to static link on unix

2020-03-03 Thread GitBox
leezu commented on a change in pull request #17751: Fix MKL static link & 
default to static link on unix
URL: https://github.com/apache/incubator-mxnet/pull/17751#discussion_r387342850
 
 

 ##
 File path: CMakeLists.txt
 ##
 @@ -442,8 +440,11 @@ if(USE_OPENMP)
 if(OPENMP_FOUND)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} 
${OpenMP_EXE_LINKER_FLAGS}")
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} 
${OpenMP_EXE_LINKER_FLAGS}")
+  if(NOT BLAS STREQUAL "MKL")
+# Linker flags for Intel OMP are already set in case MKL is used. Only 
set if not MKL
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} 
${OpenMP_EXE_LINKER_FLAGS}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} 
${OpenMP_EXE_LINKER_FLAGS}")
+  endif()
 
 Review comment:
   FYI @cjolivier01, based on this, clang won't add omp.
   
   ```
   ubuntu@ip-172-31-24-41:~/mxnet/build$ ldd libmxnet.so | grep omp
   libiomp5.so => /usr/local/lib/libiomp5.so (0x7f982da3d000)
   ```


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


With regards,
Apache Git Services


[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17751: Fix MKL static link & default to static link on unix

2020-03-03 Thread GitBox
leezu commented on a change in pull request #17751: Fix MKL static link & 
default to static link on unix
URL: https://github.com/apache/incubator-mxnet/pull/17751#discussion_r387342850
 
 

 ##
 File path: CMakeLists.txt
 ##
 @@ -442,8 +440,11 @@ if(USE_OPENMP)
 if(OPENMP_FOUND)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} 
${OpenMP_EXE_LINKER_FLAGS}")
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} 
${OpenMP_EXE_LINKER_FLAGS}")
+  if(NOT BLAS STREQUAL "MKL")
+# Linker flags for Intel OMP are already set in case MKL is used. Only 
set if not MKL
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} 
${OpenMP_EXE_LINKER_FLAGS}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} 
${OpenMP_EXE_LINKER_FLAGS}")
+  endif()
 
 Review comment:
   FYI @cjolivier01, based on this, clang won't add omp.
   
   ```
   ubuntu@ip-172-31-24-41:~/mxnet/build$ ldd libmxnet.so | grep omp
   libiomp5.so => /usr/local/lib/libiomp5.so (0x7f982da3d000)
   ```


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


With regards,
Apache Git Services