Also, upgrade to CMake 3.13.
The commit also contains significant refactors, as otherwise it is not
possible to properly export target `megengine` to
MegEngine-targets.cmake:
1. Optionally use system provided Flatbuffers.
2. Optionally use system provided MKL-DNN (Tested with Debian).
3. Refactor megbrain and megdnn targets into object libraries.
4. Set different path in BUILD_INTERFACE and INSTALL_INTERFACE of
various target_include_directories.
5. Specify PUBLIC/PRIVATE on various target_link_libraries.
GitOrigin-RevId: df118a879e
Removed the `access()` call before `dlopen()`.
It was copy-pasted from the opencl-stub, does not make sense here, and
prevents `dlopen()` from loading `libcuda.so` from non-default path.
Updated the name of the library providing CUDA Driver API on different
platforms, these are harvested from the following file in a CUDA
install:
samples/6_Advanced/matrixMulDynlinkJIT/cuda_drvapi_dynlink.c
GitOrigin-RevId: ed43cab8c8