I tried to follow Testing instructions on https://docs.tvm.ai/contribute/pull_request.html#testing
I used Ubuntu 18.04.1 LTS
I installed
googletest-release-1.8.1
cmake version 3.10.2
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
cloned tvm 92a0048907bebfbf7b9a0f1e9c68a28c97866595
git clone --recursive https://github.com/dmlc/tvm
after that I run
cd tvm
# assume you are in tvm source root
TVM_ROOT=`pwd`
# you need to install google test first, gtest will be installed to $TVM_ROOT/lib
CACHE_PREFIX=. make -f 3rdparty/dmlc-core/scripts/packages.mk gtest
mkdir build
cd build
GTEST_LIB=$TVM_ROOT/lib cmake ..
make cpptest -j1 VERBOSE=1
Error:
/usr/bin/cmake -H/home/dlc/tvm -B/home/dlc/tvm/build --check-build-system CMakeFiles/Makefile.cmake 0
make -f CMakeFiles/Makefile2 cpptest
make[1]: Entering directory '/home/dlc/tvm/build'
/usr/bin/cmake -H/home/dlc/tvm -B/home/dlc/tvm/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/dlc/tvm/build/CMakeFiles 78
make -f CMakeFiles/Makefile2 CMakeFiles/cpptest.dir/all
make[2]: Entering directory '/home/dlc/tvm/build'
make -f CMakeFiles/tvm.dir/build.make CMakeFiles/tvm.dir/depend
make[3]: Entering directory '/home/dlc/tvm/build'
cd /home/dlc/tvm/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/dlc/tvm /home/dlc/tvm /home/dlc/tvm/build /home/dlc/tvm/build /home/dlc/tvm/build/CMakeFiles/tvm.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/home/dlc/tvm/build'
make -f CMakeFiles/tvm.dir/build.make CMakeFiles/tvm.dir/build
make[3]: Entering directory '/home/dlc/tvm/build'
make[3]: Nothing to be done for 'CMakeFiles/tvm.dir/build'.
make[3]: Leaving directory '/home/dlc/tvm/build'
[ 88%] Built target tvm
make -f CMakeFiles/pattern_match_test.dir/build.make CMakeFiles/pattern_match_test.dir/depend
make[3]: Entering directory '/home/dlc/tvm/build'
cd /home/dlc/tvm/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/dlc/tvm /home/dlc/tvm /home/dlc/tvm/build /home/dlc/tvm/build /home/dlc/tvm/build/CMakeFiles/pattern_match_test.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/home/dlc/tvm/build'
make -f CMakeFiles/pattern_match_test.dir/build.make CMakeFiles/pattern_match_test.dir/build
make[3]: Entering directory '/home/dlc/tvm/build'
[ 88%] Linking CXX executable pattern_match_test
/usr/bin/cmake -E cmake_link_script CMakeFiles/pattern_match_test.dir/link.txt --verbose=1
/usr/bin/c++ -faligned-new -O2 -Wall -fPIC -fvisibility=hidden -std=c++11 -rdynamic CMakeFiles/pattern_match_test.dir/tests/cpp/pattern_match_test.cc.o -o pattern_match_test -Wl,-rpath,/home/dlc/tvm/build libtvm.so /usr/local/lib/libgtest.a -lpthread
CMakeFiles/pattern_match_test.dir/tests/cpp/pattern_match_test.cc.o: In function `_GLOBAL__sub_I_pattern_match_test.cc':
pattern_match_test.cc:(.text.startup+0xae): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
pattern_match_test.cc:(.text.startup+0xf7): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
libtvm.so: undefined reference to `dlopen'
libtvm.so: undefined reference to `dlclose'
libtvm.so: undefined reference to `dlerror'
libtvm.so: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
CMakeFiles/pattern_match_test.dir/build.make:96: recipe for target 'pattern_match_test' failed
make[3]: *** [pattern_match_test] Error 1
make[3]: Leaving directory '/home/dlc/tvm/build'
CMakeFiles/Makefile2:778: recipe for target 'CMakeFiles/pattern_match_test.dir/all' failed
make[2]: *** [CMakeFiles/pattern_match_test.dir/all] Error 2
make[2]: Leaving directory '/home/dlc/tvm/build'
CMakeFiles/Makefile2:120: recipe for target 'CMakeFiles/cpptest.dir/rule' failed
make[1]: *** [CMakeFiles/cpptest.dir/rule] Error 2
make[1]: Leaving directory '/home/dlc/tvm/build'
Makefile:177: recipe for target 'cpptest' failed
make: *** [cpptest] Error 2