Make cpptest build on Ubuntu (#2798)
authorAlexander Pivovarov <apivovarov@gmail.com>
Tue, 12 Mar 2019 23:11:50 +0000 (16:11 -0700)
committerTianqi Chen <tqchen@users.noreply.github.com>
Tue, 12 Mar 2019 23:11:50 +0000 (16:11 -0700)
CMakeLists.txt
docs/contribute/pull_request.rst

index 494afbdff792e31fba28f085cf28d88c3f9c26ed..e3a38923509249df61772037f4e27b62a35f9403 100644 (file)
@@ -232,7 +232,7 @@ if(GTEST_LIB)
     add_executable(${__execname} ${__srcpath})
     list(APPEND TEST_EXECS ${__execname})
     target_link_libraries(${__execname}
-      tvm ${GTEST_LIB} pthread)
+      tvm ${GTEST_LIB} pthread dl)
     set_target_properties(${__execname} PROPERTIES EXCLUDE_FROM_ALL 1)
     set_target_properties(${__execname} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
   endforeach()
index 58a9cd205fdab3e7d14dcd9d2ea9b273e3d08e6d..d05fd0d2b2e98026e1302a69b3428c55822012f8 100644 (file)
@@ -62,14 +62,15 @@ C++
   TVM_ROOT=`pwd`
 
   # you need to install google test first, gtest will be installed to $TVM_ROOT/lib
+  apt-get install -y libgtest-dev
   CACHE_PREFIX=. make -f 3rdparty/dmlc-core/scripts/packages.mk gtest
 
   mkdir build
   cd build
-  GTEST_LIB=$TVM_ROOT/lib cmake ..
-  make cpptest -j
+  GTEST_LIB=$TVM_ROOT/lib cmake -DUSE_LLVM=ON ..
+  make cpptest -j$(nproc)
   for test in *_test; do
-    ./$test || exit -1
+    ./$test
   done
 
 Python