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 2019/03/11 02:38:37 UTC

[GitHub] [incubator-mxnet] hengdos commented on issue #13870: [C++] Linking static library (error or bug?) to load python trained model

hengdos commented on issue #13870: [C++] Linking static library (error or bug?) to load python trained model
URL: https://github.com/apache/incubator-mxnet/issues/13870#issuecomment-471385323
 
 
   > @hengdos I was trying to reproduce this issue on Mac and Ubuntu. But I was not able to invoke 'make' while building the 'transformer' with statically linked libraries. Can you please ensure that CMakelist.txt for static library is correct?
   > I will try it again as well.
   
   @leleamol hi, I have tested the following CMakelist.txt for static library on macOS Mojave 10.14.3.
   
   ```
   cmake_minimum_required(VERSION 3.9)  
   
   set (CMAKE_CXX_STANDARD 11)
   
   add_executable(transformer
           main.cc
   )
   
   target_link_libraries(transformer
           ${PROJECT_SOURCE_DIR}/lib/libmxnet.a
           ${PROJECT_SOURCE_DIR}/lib/libdmlc.a
           ${PROJECT_SOURCE_DIR}/lib/libnnvm.a
   )
   
   target_include_directories(transformer PUBLIC
           ${PROJECT_SOURCE_DIR}/include
   )
   ```
   
   The output is like this:
   ```shell
   $ ./transformer 
   net-symbol.json ... 954 bytes
   net-0000.params ... 164 bytes
   Assertion failed: (pred_hnd), function main, file /Users/heng/Projects/lrcplus/main.cc, line 101.
   [1]    30126 abort      ./transformer
   ```
   
   Thanks for your reply.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services