-
Notifications
You must be signed in to change notification settings - Fork 6.8k
CMake build misses some parameters #17943
Comments
hi i can successfully build mxnet cpp on linux operating system ,never tried windows op. |
Hi, |
Did you check out the https://github.com/apache/incubator-mxnet/blob/master/CMakeLists.txt#L479 3rdparty/googletest submodule? |
Yes. The https://github.com/apache/incubator-mxnet/blob/56e79853ad5cf98baf84454eb595c7658bef6ee6/CMakeLists.txt#L487 looks for GTest module. However, FindGTest.cmake module needs to know how to link your project with GTest: statically, dynamically. That's why I suggest to add options on Windows to specify the GTest library type. |
Do you want to open a PR based on your suggestion? |
Yes, I'm sure adding the suggested lines improve the build experience on Windows. I've seen the problem since version 1.3.0 according to my personal notes. On Windows, installing DLL's separately is uncommon, so you have to specify the library type at build time. |
Ok, please CC me in your PR. Thank you |
Description
When CMake is used to build the MXNet 1.6.0 on Windows, some errors are generated pertaining to missing options.
Error Message
CMake Error at {build_path}/cmake-3.15/Modules/FindGTest.cmake:209 (add_library):
To Reproduce
Just build the MXNet v1.6.0 project on Windows 8.1 (version is irrelevant). The CMake generates errors related to GTest options.
What have you tried to solve it?
Reading the CMake scripts helped find the cause. Two options are missing from the main CMakeList.txt file of the project. The CMake script needs to specify how to link with GTest library as shared/static/object or whatever. Just add the following two lines to CMakeList.txt @ line 472:
The text was updated successfully, but these errors were encountered: