Skip to content

Commit

Permalink
Clarify GTest usage for old and recent Ubuntu
Browse files Browse the repository at this point in the history
The latest Ubuntu now provides a compiled version of the libraries in
libgtest-dev starting with 18.10.
  • Loading branch information
keryell committed Oct 22, 2018
1 parent bcb218a commit 3ae142e
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/runtime_src/doc/toc/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,20 @@ Unit Testing XRT
We use GTest to do unit testing. The GTest package is installed by
running ``XRT/src/runtime_src/tools/scripts/xrtdeps.sh``.

The GTest package on CentOS/RHEL 7.5 provides the GTest libraries here:
* /usr/lib64/libgtest.so
* /usr/lib64/libgtest_main.so
The GTest package on CentOS/RHEL 7.5 provides the GTest libraries
here:

However, the GTest package on Ubuntu 16.04 provides source only!
* ``/usr/lib64/libgtest.so``
* ``/usr/lib64/libgtest_main.so``

To use GTest on Ubuntu 16.04 use:
In recent versions of Ubuntu, the GTest ``libgtest-dev`` package
provides the compiled libraries in

::
* ``/usr/lib/x86_64-linux-gnu/libgtest.a``
* ``/usr/lib/x86_64-linux-gnu/libgtest_main.a``

However, the GTest package on Ubuntu up to 18.04 provides source only!
So, to use GTest on older Ubuntu versions, use::

cd /usr/src/gtest
sudo cmake CMakeLists.txt
Expand All @@ -104,10 +109,9 @@ To use GTest on Ubuntu 16.04 use:
ls *gtest*

This will add GTest static library symbolic links here:
* /usr/lib/libgtest.a
* /usr/lib/libgtest_main.a

CMake will handle linking, finding etc. for you.
* ``/usr/lib/libgtest.a``
* ``/usr/lib/libgtest_main.a``

To add GTest support to a CMakeLists.txt use the following, and this is using
an example executable called 'xclbintest':
Expand Down

0 comments on commit 3ae142e

Please sign in to comment.