You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mxnet.apache.org by Dick Carter <di...@apache.org> on 2020/08/28 23:37:18 UTC
Why is im2rec ever built with static mxnet lib?
In CMakeLists.txt, the recipe for building im2rec includes the lines:
if(MSVC)
target_link_libraries(im2rec mxnet)
else()
target_link_libraries(im2rec ${BEGIN_WHOLE_ARCHIVE} mxnet_static ${END_WHOLE_ARCHIVE})
endif()
Is there some requirement on unix or windows that forces the choice of static-vs-dynamic linking to mxnet? Is the motivation for static linking that in general one prefers a more portable binary (even at the expense of a 2GB executable)? Should there be a flag to let the user select the build approach?
Re: Why is im2rec ever built with static mxnet lib?
Posted by Leonard Lausen <la...@apache.org>.
There is no particular reason for this. The divergence between msvc and
non-msvc has been removed in master and static / dynamic linkage depends
on MXNET_BUILD_SHARED_LIBS option.
See https://github.com/apache/incubator-mxnet/blob/48c21988cdcde9721cb44804b775d8f0edfcb6cc/CMakeLists.txt#L797-L802
Dick Carter <di...@apache.org> writes:
> In CMakeLists.txt, the recipe for building im2rec includes the lines:
>
> if(MSVC)
> target_link_libraries(im2rec mxnet)
> else()
> target_link_libraries(im2rec ${BEGIN_WHOLE_ARCHIVE} mxnet_static ${END_WHOLE_ARCHIVE})
> endif()
>
> Is there some requirement on unix or windows that forces the choice of static-vs-dynamic linking to mxnet? Is the motivation for static linking that in general one prefers a more portable binary (even at the expense of a 2GB executable)? Should there be a flag to let the user select the build approach?