1: reduce python whl package size
2: unify api link logic on all OS
3: add option: MGE_WINDOWS_BUILD_WITH_STATIC_CRT
--- default OFF
--- if build CRT(vc runtime) with STATIC with megengine.dll
some CRT api will crash, for example, flush, so if you
build with static megengine, and do not want to install CRT
you can set MGE_WINDOWS_BUILD_WITH_STATIC_CRT TRUE
--- how to install CRT:
https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-160
install VC_redist.x64.exe
4: rename megengine_export to megengine_shared(only export needed symbols ),
caused by runtime symbols conflict with pytorch
GitOrigin-RevId: 93d8d80f29
as some reason: some version of trt/cudnn need
-Wl,--whole-archive attribute to fix cuda issue,
target A(CMAKE OBJECT,eg megbrain/megdnn): -Wl,--whole-archive depend on trt/cudnn
target B(SHARED LIBS,eg libmegengine.so) --> A with `PUBLIC` depends
target C(SHARED LIBS,eg _impertive.so) --> B with `PUBLIC` depends,
then ld will force link fatbin section into C, which will be undesired
what`s more, attribute PUBLIC/PRIVATE do not take effect
to OBJECT library(megbrain/megdnn)
what`s more, megengine/megengine_export have to PUBLIC for
mgb/imperative target, as SRC/include depends
so we pull cudalib depend from megbrain/megdnn to
megengine/megengine_export on linux os, to finall
target at windows os, for example lar on windows
GitOrigin-RevId: b278a69e1c