pokachopotun commented on issue #10128: Shared library dependent on mxnet
URL: 
https://github.com/apache/incubator-mxnet/issues/10128#issuecomment-374313941
 
 
   I hope this would be enough.
   //CMakeLists.txt
   project(test)
   if(COMMAND cmake_policy)
         cmake_policy(SET CMP0003 NEW)
       endif(COMMAND cmake_policy)
   if(NOT MSVC)
     set(UNITTEST_STATIC_LINK ON)
   endif()
   set(CPP_EXAMPLE_LIBS
     ${BEGIN_WHOLE_ARCHIVE} mxnet_static ${END_WHOLE_ARCHIVE}
     ${BEGIN_WHOLE_ARCHIVE} dmlc ${END_WHOLE_ARCHIVE}
     ${mxnet_LINKER_LIBS}
    )
   add_definitions(-lpthread -std=c++11)
   add_library(libexample SHARED lib.h lib.cpp)
   target_link_libraries(libexample ${CPP_EXAMPLE_LIBS} pthread)
   add_executable(test main.cpp)
   target_link_libraries( test libexample dl )

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


With regards,
Apache Git Services

Reply via email to