Error while building cpptest through Visual Studio 16 2019

I was able to successfully build tvm’s shared library and runtime library. However while building cpptest, the build failed in Visual Studio 16 2019 stating missing libraries: pthread and dl

This is the error log I get:

4>lld-link : warning : ignoring unknown argument '-fuse-ld=lld'
4>lld-link : error : could not open 'pthread.lib': no such file or directory
4>lld-link : error : could not open 'dl.lib': no such file or directory
4>Done building project "cpptest.vcxproj" -- FAILED.
========== Build: 3 succeeded, 1 failed, 4 up-to-date, 0 skipped ==========

These libraries are being linked to cpptest as mentioned in the CMakeLists.txt: target_link_libraries(cpptest PRIVATE ${TVM_TEST_LIBRARY_NAME} GTest::GTest GTest::Main GTest::gmock pthread dl)

How do I resolve the build error, do I need to download these libraries for them to be linked?

likely due to the fact of gtest issue, you can try to skip cpptest as they are not necessary for daily usage

@tqchen, thanks for your reply. Looks like these libraries are meant for linux based systems and hence the build failed in windows, we could add differentiation for libraries to be used in CMakeLists.txt based on platforms/OS.

I am able to successfully build cpptest in linux, will use linux builds for further developments.

1 Like