-
Notifications
You must be signed in to change notification settings - Fork 12
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
Linker error for one of the examples, not others #49
Comments
Hmm, that’s odd — it seems to be working in the unit tests? https://github.com/brenhinkeller/StaticTools.jl/actions/runs/4973322569/jobs/8899099933
|
All the test pass, also for (StaticCompiler), and thus I believe this is intentional:
I'm no Linux Mint if it matters, did I need to install any dependencies (other than for Ubuntu/Debian)? |
I debugged this and the cause is complex. A. Int32(1) # Why, i.e. why isn't Int64 returned to col? to silence return type error. B. |
Oh, that’s because the return type of the function has to be stable to be static-compilable, and all the functions that call the C stdlib (i.e., `printf`, `free`, etc.) return Int32 (i.e. C int) by convention
|
I'll look at it more, but that's not the issue I think. I believe A. wasn't the problem, just what I discovered along the way, B. reinterpret line is. I already sped up a pi benchmark 5x, but I can't submit since timing relies on StaticTools... and without it the startup-overhead is too great. You're welcome to see the code here, that I've butchered up, it now compiles (but gets wrong value, strangely no longer compiles if I uncomment latter loop):
If this line: -2.0f0 / fma(i, i, -1.0) is changed to use 1.0f0 as it should then the compile fails. Also |
I get same error for other code I'm working on (and did likely work at some point), so I checked examples here to see if an install problem. All examples in other repo work, and all here up to this one.
The text was updated successfully, but these errors were encountered: