-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Failing to link on Windows with RTools44 #620
Comments
I can replicate this linker error on the Windows machine in my office. |
Are you able to run the above with the flag Would CRAN allow you to add the flag |
CRAN does not allow suppressing compiler warnings in released packages, but I can do it for a test build. See the installation log here, which was run with |
Inlining the two internal namespaced functions used by |
I locally isolated the problem to be the 3 lambdas in csr_matrix_times_vector's reverse pass. We think the issue might be that the mangled names of the anonymous types being generated is too long (they are all conspicuously longer than 256 characters, and Windows has all sorts of weird max length conditions) @SteveBronder is still thinking about solutions |
@bgoodri I'm still reviewing it, but Steve's code changes in stan-dev/math#3048 should resolve this (I tested an earlier version of them with my own Windows machine) Unfortunately they rely on some other changes in the Math lib beyond where SH is, namely stan-dev/math#2971, so it isn't just a one-file cherry pick |
Merging multiple PRs into StanHeaders is fine as long as they are mostly additional to StanHeaders 2.32.x rather than backwards uncompatible. The main thing is that we only have a week before the development R becomes the stable R and may need to beat that deadline by a few days in order to have a binary rstanarm built for Windows when the release happens. |
Did someone have to do something else (besides merging those two PRs) to get it to link on Windows? I am still getting the same error even after putting those two PRs into a provisional StanHeaders. |
I did not. The last time I had access to a Windows box to test I was using an older version of the patch than the one that got merged -- it had the same signatures for the lambdas, but the math inside was wrong at the time. We were assuming (perhaps too optimistically?) that this wouldn't affect linking... |
Some of the mangled names are longer than 256 characters, although it still is complaining about some that have shorter mangled names than that. |
This is definitely still happening, and still goes away if you comment out the reverse_pass_callback lambdas. |
@SteveBronder how difficult would it be to avoid using lambdas at all in the csr reverse pass? |
Not hard. I can make a PR for that tmrw |
@bgoodri was this resolved by the latest Math changes? I've still failed to re-create this with a simpler example to try to report upstream |
Yes |
Summary:
The rstanarm package does not link correctly on the next R for Windows.
Description:
It is some combination of LTO and RTools44 but possibly also
csr_matrix_times_vector
. @SteveBronder ?Reproducible Steps:
Try to install rstanarm with the RTools44 toolchain and you get at the end:
RStanARM Version:
2.32.1
R Version:
4.4.0 alpha (2024-03-31 r86238 ucrt)
Operating System:
Windows only.
The text was updated successfully, but these errors were encountered: