tt-umd: init 0.9.6 (#494239)

This commit is contained in:
Gaétan Lepage
2026-06-05 21:23:51 +00:00
committed by GitHub
6 changed files with 253 additions and 0 deletions
@@ -0,0 +1,20 @@
--- a/CMakeLists.txt 2026-02-25 19:30:35.568736249 -0800
+++ b/CMakeLists.txt 2026-02-25 19:31:26.709567839 -0800
@@ -124,6 +124,17 @@
DESTINATION ${INSTALL_CONFIGDIR}
)
+ write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
+ VERSION 4.3.11
+ COMPATIBILITY SameMajorVersion
+ )
+
+ install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/nanobench"
+ )
+
# Install headers
install(FILES src/include/nanobench.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
else()
+4
View File
@@ -36,6 +36,10 @@ stdenv.mkDerivation (finalAttrs: {
url = "https://github.com/martinus/nanobench/pull/98/commits/17a1f0b598a09d399dd492c72bca5b48ad76c794.patch";
hash = "sha256-2lOD63qN7gywUQxrdSRVyddpzcQjjeWOrA3hqu7x+CY=";
})
# Drop when https://github.com/martinus/nanobench/pull/134 is merged
# This is a slice of what that PR provides, it makes it possible for packages to do "find_package"
./fix-cmake-find_package.patch
];
nativeBuildInputs = [ cmake ];
@@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3c7ca3..927e11c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,8 +41,9 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.23)
INTERFACE
FILE_SET api
TYPE HEADERS
- BASE_DIRS ${CMAKE_INSTALL_INCLUDEDIR}
- FILES ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/tt-logger.hpp
+ BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include
+ FILES
+ include/${PROJECT_NAME}/tt-logger.hpp
)
endif()
+64
View File
@@ -0,0 +1,64 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchurl,
cmake,
ninja,
pkg-config,
fmt_11,
spdlog,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "tt-logger";
version = "1.1.9";
__structuredAttrs = true;
strictDeps = true;
src = fetchFromGitHub {
owner = "tenstorrent";
repo = "tt-logger";
tag = "v${finalAttrs.version}";
hash = "sha256-Vd/FwjcNZWh/FnP5CwXO4UQtKTq/6GhRSppCYJMj9d4=";
};
cpm = fetchurl {
url = "https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.40.2/CPM.cmake";
hash = "sha256-yM3DLAOBZTjOInge1ylk3IZLKjSjENO3EEgSpcotg10=";
};
patches = [
# https://github.com/tenstorrent/tt-logger/pull/27
./fix-install.patch
];
postPatch = ''
cp $cpm cmake/CPM.cmake
'';
nativeBuildInputs = [
cmake
ninja
pkg-config
];
buildInputs = [
fmt_11
spdlog
];
cmakeFlags = [
(lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true)
(lib.cmakeBool "CPM_USE_LOCAL_PACKAGES_ONLY" true)
(lib.cmakeBool "CPM_LOCAL_PACKAGES_ONLY" true)
(lib.cmakeBool "TT_LOGGER_INSTALL" true)
];
meta = {
description = "Flexible and performant C++ logging library for Tenstorrent projects";
homepage = "https://github.com/tenstorrent/tt-logger";
maintainers = with lib.maintainers; [ RossComputerGuy ];
license = with lib.licenses; [ asl20 ];
platforms = lib.platforms.linux;
};
})
+35
View File
@@ -0,0 +1,35 @@
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 96d71990..1db71f88 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -43,6 +43,7 @@ CPMAddPackage(
"YAML_CPP_BUILD_TESTS OFF"
"YAML_CPP_BUILD_TOOLS OFF"
"YAML_BUILD_SHARED_LIBS OFF"
+ FIND_PACKAGE_ARGUMENTS GLOBAL
)
if(yaml-cpp_ADDED)
@@ -146,7 +147,13 @@ CPMAddPackage(
####################################################################################################################
# tt-logger
####################################################################################################################
-CPMAddPackage(NAME tt-logger GITHUB_REPOSITORY tenstorrent/tt-logger VERSION 1.1.8 SYSTEM YES)
+CPMAddPackage(
+ NAME tt-logger
+ GITHUB_REPOSITORY tenstorrent/tt-logger
+ VERSION 1.1.8
+ SYSTEM YES
+ FIND_PACKAGE_ARGUMENTS GLOBAL
+)
####################################################################################################################
# cxxopts
@@ -159,6 +166,7 @@ CPMAddPackage(
SYSTEM YES
OPTIONS
"CMAKE_MESSAGE_LOG_LEVEL NOTICE"
+ FIND_PACKAGE_ARGUMENTS GLOBAL
)
####################################################################################################################
+114
View File
@@ -0,0 +1,114 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchurl,
cmake,
ninja,
pkg-config,
gtest,
yaml-cpp,
fmt,
nanobench,
spdlog,
tt-logger,
cxxopts,
hwloc,
python3,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "tt-umd";
version = "0.9.6";
__structuredAttrs = true;
strictDeps = true;
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "tenstorrent";
repo = "tt-umd";
tag = "v${finalAttrs.version}";
hash = "sha256-3IrgsKRaJP/rEXiMvi2LnzS9n2+Giu5d05RohzRgPw4=";
};
cpm = fetchurl {
url = "https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.40.2/CPM.cmake";
hash = "sha256-yM3DLAOBZTjOInge1ylk3IZLKjSjENO3EEgSpcotg10=";
};
patches = [
# https://github.com/tenstorrent/tt-umd/pull/2187
./fix-targets.patch
];
postPatch = ''
cp $cpm cmake/CPM.cmake
'';
nativeBuildInputs = [
cmake
ninja
pkg-config
python3
];
buildInputs = [
fmt
yaml-cpp
nanobench
spdlog
tt-logger
cxxopts
python3.pkgs.nanobind
hwloc
gtest
];
cmakeFlags = [
(lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true)
(lib.cmakeBool "CPM_USE_LOCAL_PACKAGES_ONLY" true)
(lib.cmakeBool "CPM_LOCAL_PACKAGES_ONLY" true)
(lib.cmakeFeature "umd_asio_SOURCE_DIR" (
builtins.toString (fetchFromGitHub {
owner = "chriskohlhoff";
repo = "asio";
tag = "asio-1-30-2";
hash = "sha256-g+ZPKBUhBGlgvce8uTkuR983unD2kbQKgoddko7x+fk=";
})
))
(lib.cmakeBool "TT_UMD_BUILD_TESTS" finalAttrs.doCheck)
(lib.cmakeBool "TT_UMD_BUILD_STATIC" stdenv.hostPlatform.isStatic)
(lib.cmakeBool "TT_UMD_BUILD_PYTHON" true)
(lib.cmakeFeature "nanobind_DIR" "${python3.pkgs.nanobind}/${python3.sitePackages}/nanobind/cmake")
];
postInstall = ''
mkdir -p $out/${python3.sitePackages}
mv $out/tt_umd $out/${python3.sitePackages}/tt_umd
rm $out/libtt-umd.so.*
mkdir -p $out/${python3.sitePackages}/tt_umd-${finalAttrs.version}.dist-info
cat > $out/${python3.sitePackages}/tt_umd-${finalAttrs.version}.dist-info/METADATA <<EOF
Metadata-Version: 2.1
Name: tt-umd
Version: ${finalAttrs.version}
EOF
'';
nativeCheckInputs = [
gtest
];
doCheck = true;
meta = {
description = "User-Mode Driver for Tenstorrent hardware";
homepage = "https://github.com/tenstorrent/tt-umd";
maintainers = with lib.maintainers; [ RossComputerGuy ];
license = with lib.licenses; [ asl20 ];
platforms = lib.platforms.linux;
};
})