Skip to content

Commit

Permalink
#4252: boost 1.84.0 as submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
vtangTT committed May 29, 2024
1 parent c97d664 commit 464e04b
Show file tree
Hide file tree
Showing 30 changed files with 145 additions and 4 deletions.
75 changes: 75 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,78 @@
[submodule "tt_metal/third_party/tt_llk_blackhole"]
path = tt_metal/third_party/tt_llk_blackhole
url = https://github.com/tenstorrent/tt-llk-bh.git
[submodule "tt_metal/third_party/boost/interprocess"]
path = tt_metal/third_party/boost/interprocess
url = https://github.com/boostorg/interprocess.git
[submodule "tt_metal/third_party/boost/core"]
path = tt_metal/third_party/boost/core
url = https://github.com/boostorg/core.git
[submodule "tt_metal/third_party/boost/format"]
path = tt_metal/third_party/boost/format
url = https://github.com/boostorg/format.git
[submodule "tt_metal/third_party/boost/align"]
path = tt_metal/third_party/boost/align
url = https://github.com/boostorg/align.git
[submodule "tt_metal/third_party/boost/container_hash"]
path = tt_metal/third_party/boost/container_hash
url = https://github.com/boostorg/container_hash.git
[submodule "tt_metal/third_party/boost/assert"]
path = tt_metal/third_party/boost/assert
url = https://github.com/boostorg/assert.git
[submodule "tt_metal/third_party/boost/config"]
path = tt_metal/third_party/boost/config
url = https://github.com/boostorg/config.git
[submodule "tt_metal/third_party/boost/detail"]
path = tt_metal/third_party/boost/detail
url = https://github.com/boostorg/detail.git
[submodule "tt_metal/third_party/boost/integer"]
path = tt_metal/third_party/boost/integer
url = https://github.com/boostorg/integer.git
[submodule "tt_metal/third_party/boost/intrusive"]
path = tt_metal/third_party/boost/intrusive
url = https://github.com/boostorg/intrusive.git
[submodule "tt_metal/third_party/boost/move"]
path = tt_metal/third_party/boost/move
url = https://github.com/boostorg/move.git
[submodule "tt_metal/third_party/boost/optional"]
path = tt_metal/third_party/boost/optional
url = https://github.com/boostorg/optional.git
[submodule "tt_metal/third_party/boost/smart_ptr"]
path = tt_metal/third_party/boost/smart_ptr
url = https://github.com/boostorg/smart_ptr.git
[submodule "tt_metal/third_party/boost/static_assert"]
path = tt_metal/third_party/boost/static_assert
url = https://github.com/boostorg/static_assert.git
[submodule "tt_metal/third_party/boost/throw_exception"]
path = tt_metal/third_party/boost/throw_exception
url = https://github.com/boostorg/throw_exception.git
[submodule "tt_metal/third_party/boost/type_traits"]
path = tt_metal/third_party/boost/type_traits
url = https://github.com/boostorg/type_traits.git
[submodule "tt_metal/third_party/boost/unordered"]
path = tt_metal/third_party/boost/unordered
url = https://github.com/boostorg/unordered.git
[submodule "tt_metal/third_party/boost/utility"]
path = tt_metal/third_party/boost/utility
url = https://github.com/boostorg/utility.git
[submodule "tt_metal/third_party/boost/winapi"]
path = tt_metal/third_party/boost/winapi
url = https://github.com/boostorg/winapi.git
[submodule "tt_metal/third_party/boost/predef"]
path = tt_metal/third_party/boost/predef
url = https://github.com/boostorg/predef.git
[submodule "tt_metal/third_party/boost/mp11"]
path = tt_metal/third_party/boost/mp11
url = https://github.com/boostorg/mp11.git
[submodule "tt_metal/third_party/boost/io"]
path = tt_metal/third_party/boost/io
url = https://github.com/boostorg/io.git
[submodule "tt_metal/third_party/boost/preprocessor"]
path = tt_metal/third_party/boost/preprocessor
url = https://github.com/boostorg/preprocessor.git
[submodule "tt_metal/third_party/boost/describe"]
path = tt_metal/third_party/boost/describe
url = https://github.com/boostorg/describe.git
[submodule "tt_metal/third_party/boost/container"]
path = tt_metal/third_party/boost/container
url = https://github.com/boostorg/container.git
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CHECK_COMPILERS()
############################################################################################################################
# Find all required libraries to build
############################################################################################################################
find_package(Boost REQUIRED COMPONENTS thread filesystem system regex)
# find_package(Boost REQUIRED COMPONENTS thread filesystem system regex)
find_package(GTest REQUIRED)
find_package (Python3 COMPONENTS Interpreter Development)

Expand Down Expand Up @@ -85,8 +85,8 @@ set(CMAKE_INSTALL_DATAROOTDIR "${CMAKE_BINARY_DIR}/tmp/share")
############################################################################################################################
add_library(metal_common_libs INTERFACE)
target_link_libraries(metal_common_libs INTERFACE
dl z pthread atomic stdc++ # system libraries
Boost::thread Boost::filesystem Boost::system Boost::regex hwloc # hwloc has no cmake support, find_package won't find it
dl z pthread atomic stdc++ hwloc # system libraries; hwloc has no cmake support, find_package won't find it
Boost::interprocess Boost::format Boost::core Boost::container_hash Boost::align
)

# Note on flags:
Expand Down Expand Up @@ -146,6 +146,8 @@ target_precompile_headers(pch_pybinds INTERFACE
############################################################################################################################
# Build subdirectories
############################################################################################################################
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tt_metal/third_party/boost)

if($ENV{ENABLE_TRACY})
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/tracy.cmake)
endif()
Expand Down
4 changes: 3 additions & 1 deletion cmake/umd_device.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ if($ENV{ENABLE_TRACY})
endif()

# MUST have the RPATH set, or else can't find the tracy lib
set(LDFLAGS_ "-L${CMAKE_BINARY_DIR}/lib -L/usr/local/lib -Wl,-rpath,${CMAKE_BINARY_DIR}/lib -Wl,-rpath,/usr/local/lib ${CONFIG_LDFLAGS} -ldl -lz -lboost_thread -lboost_filesystem -lboost_system -lboost_regex -lpthread -latomic -lhwloc -lstdc++")
# set(LDFLAGS_ "-L${CMAKE_BINARY_DIR}/lib -L/usr/local/lib -Wl,-rpath,${CMAKE_BINARY_DIR}/lib -Wl,-rpath,/usr/local/lib ${CONFIG_LDFLAGS} -ldl -lz -lboost_thread -lboost_filesystem -lboost_system -lboost_regex -lpthread -latomic -lhwloc -lstdc++")
set(LDFLAGS_ "-L${CMAKE_BINARY_DIR}/lib -L/usr/local/lib -Wl,-rpath,${CMAKE_BINARY_DIR}/lib -Wl,-rpath,/usr/local/lib ${CONFIG_LDFLAGS} -ldl -lz -lumd_boost -lpthread -latomic -lhwloc -lstdc++")
set(SHARED_LIB_FLAGS_ "-shared -fPIC")
set(STATIC_LIB_FLAGS_ "-fPIC")

Expand Down Expand Up @@ -56,6 +57,7 @@ ExternalProject_Add(
LDFLAGS=${LDFLAGS_}
CXXFLAGS=${CMAKE_CXX_FLAGS_}
)
add_dependencies(umd_device umd_boost)
if($ENV{ENABLE_TRACY})
add_dependencies(umd_device TracyClient)
endif()
Expand Down
34 changes: 34 additions & 0 deletions tt_metal/third_party/boost/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/align)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/assert)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/config)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/container)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/container_hash)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/core)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/describe)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/detail)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/format)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/integer)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/interprocess)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/intrusive)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/io)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/move)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mp11)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/optional)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/predef)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/preprocessor)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/smart_ptr)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/static_assert)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/throw_exception)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/type_traits)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/unordered)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/utility)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/winapi)

add_library(umd_boost SHARED ${CMAKE_CURRENT_SOURCE_DIR}/dummy.cpp)
target_link_libraries(umd_boost PUBLIC boost_interprocess)
set_target_properties(umd_boost PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
)
set_target_properties(boost_container PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
)
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/align
Submodule align added at 5ad7df
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/assert
Submodule assert added at 9067f0
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/config
Submodule config added at cbeca5
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/container
Submodule container added at 22357b
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/container_hash
Submodule container_hash added at 48a306
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/core
Submodule core added at 7cbbb0
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/describe
Submodule describe added at c89e4d
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/detail
Submodule detail added at 845567
3 changes: 3 additions & 0 deletions tt_metal/third_party/boost/dummy.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// SPDX-FileCopyrightText: © 2023 Tenstorrent Inc.
//
// SPDX-License-Identifier: Apache-2.0
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/format
Submodule format added at 78ef37
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/integer
Submodule integer added at e7ed99
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/interprocess
Submodule interprocess added at a0c5a8
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/intrusive
Submodule intrusive added at 1014e9
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/io
Submodule io added at 342e4c
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/move
Submodule move added at f1fbb4
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/mp11
Submodule mp11 added at 391e23
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/optional
Submodule optional added at c60db2
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/predef
Submodule predef added at 0fdfb4
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/preprocessor
Submodule preprocessor added at 667e87
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/smart_ptr
Submodule smart_ptr added at 763c7f
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/static_assert
Submodule static_assert added at ba72d3
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/throw_exception
Submodule throw_exception added at 152b36
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/type_traits
Submodule type_traits added at 89f501
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/unordered
Submodule unordered added at f49360
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/utility
Submodule utility added at 217f73
1 change: 1 addition & 0 deletions tt_metal/third_party/boost/winapi
Submodule winapi added at 39396b

0 comments on commit 464e04b

Please sign in to comment.