Skip to content

Commit

Permalink
#0: fetch gtest via CPM
Browse files Browse the repository at this point in the history
  • Loading branch information
TT-billteng committed Jun 10, 2024
1 parent b5fa3d2 commit 6a749d9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
9 changes: 0 additions & 9 deletions .github/actions/install-metal-dev-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ runs:
tar -xvf doxygen-1.9.6.linux.bin.tar.gz
cd doxygen-1.9.6
sudo make install
- name: Install gtest
shell: bash
run: |
curl -L "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz" -o v1.13.0.tar.gz
tar -xvf v1.13.0.tar.gz
cd googletest-1.13.0
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON .
make
sudo make install
- name: Install Clang-17
shell: bash
run: |
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@ CHECK_COMPILERS()
# Find all required libraries to build
############################################################################################################################
include(${PROJECT_SOURCE_DIR}/cmake/CPM_boost.cmake)
find_package(GTest REQUIRED)
find_package (Python3 COMPONENTS Interpreter Development)
find_library(NUMA_LIBRARY NAMES numa)
if (NOT NUMA_LIBRARY)
message(FATAL_ERROR "NUMA library not found")
endif()

CPMAddPackage(
NAME googletest
GITHUB_REPOSITORY google/googletest
GIT_TAG release-1.12.1
VERSION 1.12.1
OPTIONS "INSTALL_GTEST ON" "gtest_force_shared_crt ON"
)


############################################################################################################################
# Setting build type flags
# Will default to assert build, unless CONFIG env variable is set or manually set -DCMAKE_BUILD_TYPE
Expand Down
2 changes: 0 additions & 2 deletions INSTALLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,3 @@ sudo apt install git git-lfs cmake=3.16.3-1ubuntu1.20.04.1 pandoc libtbb-dev lib
```

2. Download and install [Doxygen](https://www.doxygen.nl/download.html), (v1.9 or higher, but less than v1.10)

3. Download and install [gtest](https://github.com/google/googletest) from source (v1.13)
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

enable_testing()
add_library(test_common_libs INTERFACE)
target_link_libraries(test_common_libs INTERFACE pthread stdc++fs GTest::GTest GTest::Main)
target_link_libraries(test_common_libs INTERFACE pthread stdc++fs gtest gtest_main)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tt_metal/tt_metal)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tt_eager)
Expand Down

0 comments on commit 6a749d9

Please sign in to comment.