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

Multiple errors during compilation #22

Open
ooptimum opened this issue May 12, 2022 · 2 comments
Open

Multiple errors during compilation #22

ooptimum opened this issue May 12, 2022 · 2 comments

Comments

@ooptimum
Copy link

ooptimum commented May 12, 2022

I'm just about to start using this library. For tests, I created a simple project and included the cgbn.h header file. While compiling I got an error saying that I should use gmp for now. This error happened due to the non-matching condition on line 67 of the cgbn.h file, because macro __CUDA_ARCH__ is not defined in code running on the host. So I was forced to declare macro __CUDA_ARCH__ explicitly before including the header file.

After that, the compilation progressed further, but I immediately got a few errors about undefined identifiers. Two of them are in padded_resolver.cu and one is in core_counting.cu.

I believe that line 250 of padded_resolver.сu should be read as uint32_t g, p, lor;, and line 266 as lor=mplor<LIMBS>(x);. But I'm not completely sure, because I have not yet understood the logic of the code and my assumption is based only on a guess that the code should look like this so that the error disappears. As for the core_counting.cu, on line 93 there is an undefined variable topctz. Perhaps the bottomctz variable should be returned instead?

However, the fact that test applications compile and run without errors makes me doubt that maybe I'm doing something wrong, since I immediately encountered the described errors? Am I missing something essential which should be done apart of just including the header file?

My environment is: Ubuntu 21.10, Cuda compilation tools 11.6.

@ooptimum
Copy link
Author

There is also a typo in the CONSTANT_TIME symbol in line 107 of cgbn_kuda.h. Now it's CONSANT_TIME.

@tie-pilot-qxw
Copy link

I also met the issue, and more errors occurred.:
`./include/cgbn/core/padded_resolver.cu(266): error: identifier "lor" is undefined
lor=mplor(x);
^

./include/cgbn/core/padded_resolver.cu(266): error: identifier "limbs" is undefined
lor=mplor(x);
^

./include/cgbn/core/core_counting.cu(93): error: identifier "topctz" is undefined
return umin(topctz, TPI);
^`
I think these are just typos, but I'm not sure why they were not corrected during testing.

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

No branches or pull requests

2 participants