samskalicky commented on a change in pull request #18904:
URL: https://github.com/apache/incubator-mxnet/pull/18904#discussion_r472659420



##########
File path: CMakeLists.txt
##########
@@ -708,18 +708,18 @@ endif()
 target_compile_definitions(mxnet PUBLIC 
DMLC_LOG_FATAL_THROW=$<BOOL:${LOG_FATAL_THROW}>)
 
 # extension libraries (custom operators, custom subgraphs) are built by default
-add_library(customop_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op/gemm_lib.cc)
-add_library(transposecsr_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op/transposecsr_lib.cc)
-add_library(transposerowsp_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op/transposerowsp_lib.cc)
-add_library(subgraph_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_subgraph/subgraph_lib.cc)
-add_library(pass_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_pass/pass_lib.cc)
+add_library(customop_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op/gemm_lib.cc 
${CMAKE_CURRENT_SOURCE_DIR}/src/lib_api.cc)
+add_library(transposecsr_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op/transposecsr_lib.cc
 ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_api.cc)
+add_library(transposerowsp_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op/transposerowsp_lib.cc
 ${CMAKE_CURRENT_SOURCE_DIR}/src/lib_api.cc)
+add_library(subgraph_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_subgraph/subgraph_lib.cc 
${CMAKE_CURRENT_SOURCE_DIR}/src/lib_api.cc)
+add_library(pass_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_pass/pass_lib.cc 
${CMAKE_CURRENT_SOURCE_DIR}/src/lib_api.cc)
 target_include_directories(customop_lib PUBLIC 
${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet)
 target_include_directories(transposecsr_lib PUBLIC 
${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet)
 target_include_directories(transposerowsp_lib PUBLIC 
${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet)
 target_include_directories(subgraph_lib PUBLIC 
${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet)
 target_include_directories(pass_lib PUBLIC 
${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet)
 if(USE_CUDA)
-  add_library(customop_gpu_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op/relu_lib.cu)
+  add_library(customop_gpu_lib SHARED 
${CMAKE_CURRENT_SOURCE_DIR}/example/extensions/lib_custom_op/relu_lib.cu 
${CMAKE_CURRENT_SOURCE_DIR}/src/lib_api.cc)

Review comment:
       @ptrendx @DickJC123 can you guys help with this windows linking error 
when compiling with CUDA?
   ```
   [2020-08-18T07:32:25.378Z] cmd.exe /C "cd . && "C:\Program 
Files\CMake\bin\cmake.exe" -E vs_link_dll 
--intdir=CMakeFiles\customop_gpu_lib.dir 
--rc=C:\PROGRA~2\WI3CF2~1\10\bin\100162~1.0\x64\rc.exe 
--mt=C:\PROGRA~2\WI3CF2~1\10\bin\100162~1.0\x64\mt.exe --manifests  -- 
C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\link.exe
 /nologo 
CMakeFiles\customop_gpu_lib.dir\example\extensions\lib_custom_op\relu_lib.cu.obj
 CMakeFiles\customop_gpu_lib.dir\src\lib_api.cc.obj  
/out:libcustomop_gpu_lib.dll /implib:customop_gpu_lib.lib 
/pdb:libcustomop_gpu_lib.pdb /dll /version:0.0 /machine:x64  /INCREMENTAL:NO 
/OPT:REF /OPT:ICF -LIBPATH:C:\PROGRA~1\NVIDIA~2\CUDA\v10.2\lib\x64 
cudadevrt.lib  cudart_static.lib  cudadevrt.lib  cudart_static.lib  
kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib 
oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
   [2020-08-18T07:32:25.378Z] LINK: command 
"C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\link.exe
 /nologo 
CMakeFiles\customop_gpu_lib.dir\example\extensions\lib_custom_op\relu_lib.cu.obj
 CMakeFiles\customop_gpu_lib.dir\src\lib_api.cc.obj 
/out:libcustomop_gpu_lib.dll /implib:customop_gpu_lib.lib 
/pdb:libcustomop_gpu_lib.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO 
/OPT:REF /OPT:ICF -LIBPATH:C:\PROGRA~1\NVIDIA~2\CUDA\v10.2\lib\x64 
cudadevrt.lib cudart_static.lib cudadevrt.lib cudart_static.lib kernel32.lib 
user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
comdlg32.lib advapi32.lib /MANIFEST 
/MANIFESTFILE:libcustomop_gpu_lib.dll.manifest" failed (exit code 1120) with 
the following output:
   [2020-08-18T07:32:25.378Z] lib_api.cc.obj : error LNK2038: mismatch detected 
for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 
'MD_DynamicRelease' in relu_lib.cu.obj
   ```
   
https://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-18904/17/pipeline
   
   The gist is:
   ```
   lib_api.cc.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': 
   value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in 
relu_lib.cu.obj
   ```
   But I have no idea why one file would be compiled differently in the same 
set of sources here. The other non-GPU libraries (customop_lib, subgraph_lib, 
etc) seem to compile/link fine.




----------------------------------------------------------------
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:
[email protected]


Reply via email to