Skip to content
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

Cannot find Thrust Headers on Windows #594

Closed
zalo opened this issue Nov 7, 2023 · 5 comments · Fixed by #595
Closed

Cannot find Thrust Headers on Windows #594

zalo opened this issue Nov 7, 2023 · 5 comments · Fixed by #595

Comments

@zalo
Copy link
Contributor

zalo commented Nov 7, 2023

@pca006132 Following up the issue here #591 (comment) and on your troubleshooting message from here #591 (comment)

In the CMake Logs, it seems like it's just printing:
thrust_ROOT:
without any directory, which is odd, because CMake auto-fills in
THRUST_DIR:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/lib/cmake/thrust
which I can verify has thrust libraries and CMake Tools.

I also have a v12.3 of CUDA, which also doesn't work.

For reference, the contents of THRUST_DIR:
image

@zalo zalo changed the title Thrust Build Error Cannot find Thrust Headers on Windows Nov 7, 2023
@pca006132
Copy link
Collaborator

oh sorry, can you change it from thrust_ROOT to THRUST_ROOT, I mixed up the case requirements...

@zalo
Copy link
Contributor Author

zalo commented Nov 7, 2023

THRUST_ROOT

Good catch, but it's still nothing, actually!

THRUST_ROOT:

Could this be due to the fact that it's trying to use the thrust that is already on my system rather than redownload it for manifold? Can I force CMake or somesuch to download the Thrust that it's expecting?

@pca006132
Copy link
Collaborator

No, this should be supported. I will try to look into this in details today.

@pca006132
Copy link
Collaborator

Can you please try this and see if this works?

diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt
index a67f6af..c59fb28 100644
--- a/src/utilities/CMakeLists.txt
+++ b/src/utilities/CMakeLists.txt
@@ -92,9 +92,10 @@ target_include_directories(${PROJECT_NAME} INTERFACE
     ${thrust_SOURCE_DIR}/dependencies/libcudacxx/include
 )
 else()
+message(_THRUST_INCLUDE_DIR: ${_THRUST_INCLUDE_DIR})
 target_include_directories(${PROJECT_NAME} INTERFACE
-    ${THRUST_ROOT}
-    ${THRUST_ROOT}/dependencies/libcudacxx/include
+    ${_THRUST_INCLUDE_DIR}
+    ${_THRUST_INCLUDE_DIR}/dependencies/libcudacxx/include
 )
 endif()

@zalo
Copy link
Contributor Author

zalo commented Nov 7, 2023

Can you please try this and see if this works?

diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt
index a67f6af..c59fb28 100644
--- a/src/utilities/CMakeLists.txt
+++ b/src/utilities/CMakeLists.txt
@@ -92,9 +92,10 @@ target_include_directories(${PROJECT_NAME} INTERFACE
     ${thrust_SOURCE_DIR}/dependencies/libcudacxx/include
 )
 else()
+message(_THRUST_INCLUDE_DIR: ${_THRUST_INCLUDE_DIR})
 target_include_directories(${PROJECT_NAME} INTERFACE
-    ${THRUST_ROOT}
-    ${THRUST_ROOT}/dependencies/libcudacxx/include
+    ${_THRUST_INCLUDE_DIR}
+    ${_THRUST_INCLUDE_DIR}/dependencies/libcudacxx/include
 )
 endif()

Hah, that did indeed fix it! The library builds flawlessly now 😎

Excellent intuition! I wonder why THRUST_ROOT isn't getting set in my case...

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 a pull request may close this issue.

2 participants