Skip to content

Nvtx: fix recipe and add v3.2.1 #27583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

phwissmann
Copy link
Contributor

@phwissmann phwissmann commented Jun 2, 2025

Summary

Changes to recipe: *nvtx/3.2.1

Motivation

Add missing packaging of header "nvtx3/nvtx3.hpp" which is the main cpp entrypoint as described in
https://nvidia.github.io/NVTX/doxygen-cpp/index.html
Add version 3.2.1


nvtx for cpp provides the "nvtx3/nvtx3.hpp" header as well
@phwissmann phwissmann changed the title Nvtx/fix and add v3.2.1 Nvtx: fix recipe and add v3.2.1 Jun 12, 2025
@SoShiny
Copy link

SoShiny commented Jun 23, 2025

In case you want to add a test for the .hpp header being copied:

diff --git a/recipes/nvtx/all/test_package/CMakeLists.txt b/recipes/nvtx/all/test_package/CMakeLists.txt
index f9d181212..85a03bfa3 100644
--- a/recipes/nvtx/all/test_package/CMakeLists.txt
+++ b/recipes/nvtx/all/test_package/CMakeLists.txt
@@ -1,8 +1,11 @@
 cmake_minimum_required(VERSION 3.15)
-project(test_package LANGUAGES C)
+project(test_package LANGUAGES C CXX)

 find_package(nvtx REQUIRED CONFIG)

 add_executable(${PROJECT_NAME} test_package.c)
 target_link_libraries(${PROJECT_NAME} PRIVATE nvtx::nvtx)
 target_compile_features(${PROJECT_NAME} PRIVATE c_std_99)
+
+add_executable(${PROJECT_NAME}_cxx test_package.cpp)
+target_link_libraries(${PROJECT_NAME}_cxx PRIVATE nvtx::nvtx)
diff --git a/recipes/nvtx/all/test_package/conanfile.py b/recipes/nvtx/all/test_package/conanfile.py
index 0a6bc6871..c9d8782b7 100644
--- a/recipes/nvtx/all/test_package/conanfile.py
+++ b/recipes/nvtx/all/test_package/conanfile.py
@@ -24,3 +24,5 @@ class TestPackageConan(ConanFile):
         if can_run(self):
             bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
             self.run(bin_path, env="conanrun")
+            bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package_cxx")
+            self.run(bin_path, env="conanrun")
diff --git a/recipes/nvtx/all/test_package/test_package.cpp b/recipes/nvtx/all/test_package/test_package.cpp
new file mode 100644
index 000000000..bdfbec516
--- /dev/null
+++ b/recipes/nvtx/all/test_package/test_package.cpp
@@ -0,0 +1,10 @@
+#include <stdlib.h>
+#include <nvtx3/nvtx3.hpp>
+
+int main()
+{
+    nvtxInitialize(NULL);
+    nvtxRangeId_t main_range = nvtxRangeStartA("main");
+    nvtxRangeEnd(main_range);
+    return EXIT_SUCCESS;
+}

@phwissmann
Copy link
Contributor Author

Added. Makes sense. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants