-
Notifications
You must be signed in to change notification settings - Fork 156
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
[BUG]: example.cu does not compile docs.rapids.ai/api/libcuproj, nvcc 12.6 name followed by "::" must be a class or namespace name #1500
Comments
Hi @wblangdon! Thanks for submitting this issue - our team has been notified and we'll get back to you as soon as we can! |
Hi @wblangdon , can you try adding Since you aren't building RMM with cmake, this isn't defined automatically for you. There may be other things missing (including configured RMM headers). We should perhaps have some standalone examples with their own CMakeLists.txt. |
I added -DLIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE as the first option ../cuspatial/cpp/cuproj/include/cuproj/vec_2d.hpp(42): error: bad attribute argument substitution Full output in example_fails2.bat.txt |
OK, there's obviously an error in the example code. If you just change all instances of I will fix the docs for the next release. |
I recommend using the example code in the readme in branch-25.02. |
Just a quick comment: |
Many thanks. I have got example.cu to compile (see attached zip fileexample.zip using namespace std; #include <cuproj/error.hpp> #include <thrust/device_vector.h> #include <proj.h> #include int main() { using T = float; cuproj::vec_2d sydney{-33.858700, 151.214000}; // Sydney, NSW, Australia // Convert the coordinates. Works the same with a vector of many coordinates. //Check answer (based on wgs_to_utm_test.cu run_cuproj_test) |
This fixes libcuproj documentation example inconsistencies raised in #1500. It removes the (outdated) example from the doxygen `main_page` and replaces it with a link to the readme. It also makes the type definitions simpler in the README example and makes the Test code match the example. Authors: - Mark Harris (https://github.com/harrism) - Michael Wang (https://github.com/isVoid) Approvers: - Michael Wang (https://github.com/isVoid) URL: #1503
@wblangdon can we close this? |
Sorry for my earlier lack of precision. Here the new example still fails to compile. example.cu(21): error: this declaration has no storage class or type specifier example.cu(21): error: variable "proj" has already been defined (previous definition at line 14) example.cu(21): error: expected a ";" 3 errors detected in the compilation of "example.cu". Compilation script, example.cu and nvcc output should be in the attached zip file. Many thanks |
@wblangdon I'm sorry, but your example is not a valid C or C++ program. You need to put the code inside a function. I recommend calling it |
I see now that your latest post is intended (I think) to show that the example in the readme does not compile out of the box. I didn't intend it to be a standalone example. Clearly the includes should not be at the same scope as the statements to be executed. Your previous post demonstrated that the code works if put in a function, so I'll close this. |
Good point but using auto proj (rather than auto* proj) is not resolved by putting code inside main(). That is, if I put the example code inside a function I still get one compilation error: example.cu(23): error: expression must have class type but it has type "cuproj::projection<cuproj::vec_2d, cuproj::vec_2d::value_type> *" (aka "cuproj::projection<cuproj::vec_2d, float> *") 1 error detected in the compilation of "example.cu". All being well new example attachedexample_r1.11.zip |
Version
cuspatial-branch-24.12
On which installation method(s) does this occur?
Source
Describe the issue
The CUDA example on
https://docs.rapids.ai/api/libcuproj/stable/index.html
fails to compile with nvcc V12.6.68
The first, of 85:-(, errors is
../cuspatial/include/rmm/mr/device/device_memory_resource.hpp(312): error: name followed by "::" must be a class or namespace name
friend void get_property(device_memory_resource const&, cuda::mr::device_accessible) noexcept {}
Command lines:
setenv PATH /opt/cuda/cuda-12.6/bin/:"$PATH"
setenv LD_LIBRARY_PATH /opt/cuda/cuda-12.6/lib64:"$LD_LIBRARY_PATH"
nvcc --version
nvcc
-I../cuspatial/cpp/cuproj/include
-I../cuspatial/include
-arch=all
-c example.cu -o example.cu.o
I guess I am missing an #include ?
All being well full output is attached
example_fails.bat.txt
Minimum reproducible example
Relevant log output
Environment details
Other/Misc.
No response
The text was updated successfully, but these errors were encountered: