samskalicky commented on pull request #19016: URL: https://github.com/apache/incubator-mxnet/pull/19016#issuecomment-709412770
> If the user install mxnet via pip, only the header files in `mxnet/include` and the python files in `mxnet/python` are downloaded. Then if the user wants to use the custom operator, the user must additionally download `lib_api.cc` of the specific mxnet version. I think it is more convenient if the custom operator only depends on the header file. Hi @ZiyueHuang thanks for that feedback. Initially I was thinking the same way, we only had the `lib_api.h` file for MXNet versions 1.6 and 1.7. But in 1.8 we realized that the single `lib_api.h` approach severely limited how the user had to construct their custom library. Since at that time the `lib_api.h` actually included function definitions, not just declarations, it was causing duplicate symbol errors if the file was included in multiple places. So in 1.8 we split the code in `lib_api.h` into `lib_api.cc` so that the header file only included declarations and all definitions were in `lib_api.cc`. This allows users more flexibility to organize their code in multiple files. The pip wheel is organized as the easy path to install in order to run Python programs using MXNet. But any C/C++ compilation for MXNet requires cloning the whole repo. Building a library for custom ops only requires the `lib_api.cc/h` files, so its an improvement in that direction. Maybe we could consider bundling the `lib_api.cc` file in the pip wheel too. ---------------------------------------------------------------- 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]
