Closed nathanieldarling closed 9 months ago
Hi n-darl, Thank you for reporting this issue and including the error messages.
The error seems to be that the keyword "register" is not allowed by your compiler:
././src/load.cpp:1281:2: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
the code looks like this:
register struct tab *p;
Reason it is there: socsim is mostly quite old C code. "register" instructs/suggests old compilers to store the variable on the register, which is faster than RAM.
To use it with newer compilers I had to change a lot of similar stuff. But my compiler on Windows didn't warn me about "register", so I didn't remove it. Rcpp on Mac uses a different compiler, it throws an error.
From what I have read (e.g. here: https://stackoverflow.com/questions/3207018/register-keyword-in-c "Nonetheless some implementations still allow it and either ignore it (MSVC, ICC) or use it as an optimization hint (GCC)", "According to Herb Sutter, register is "exactly as meaningful as whitespace" and has no effect on the semantics of a C++ program."), we can just remove the keyword "register" without any ill effects. Then it should work.
All the other warnings should also be handled by me. I will do this someday in the future! There are many warnings that sprintf is deprecated and that we should use braces around subobjects when initializing them. I will put this on my todo-list.
I removed the "register" keywords and created a new release: https://github.com/MPIDR/rsocsim/releases/tag/v1.5.9
You can try to run the installation again.
(I still don't understand why it worked on my test-mac before...) Unfortunately I don't have a Mac at hand now, so I can't test whether it works on Mac or not. So please report back if it does or doesn't. Thank you!
Hi Tom,
This now seems to be working -thanks very much!
best wishes,
Nathaniel
On Wed, Aug 16, 2023 at 11:05 AM Tom Theile @.***> wrote:
I removed the "register" keywords and created a new release: https://github.com/MPIDR/rsocsim/releases/tag/v1.5.9
You can try to run the installation again.
(I still don't understand why it worked on my test-mac before...) Unfortunately I don't have a Mac at hand now, so I can't test whether it works on Mac or not. So please report back if it does or doesn't. Thank you!
— Reply to this email directly, view it on GitHub https://github.com/MPIDR/rsocsim/issues/11#issuecomment-1680323584, or unsubscribe https://github.com/notifications/unsubscribe-auth/A55TNV4OZ5U5ARU247Q33VTXVSLOHANCNFSM6AAAAAA3SELMQA . You are receiving this because you authored the thread.Message ID: @.***>
Hi! I had socsim working on my mac after installing it earlier this year, though found it was often crashing and causing R to abort. I have tried installing the latest version of R, and reinstalled dev tools and checked xcode/ rccp are installed, but when I run the line devtools::install_github("MPIDR/rsocsim") I get an error (it's very long so only pasting the last part of it below).
Have you got advice on how best to fix this? Am I better returning to an earlier version of R or is there a different issue? Any advice would be much appreciated. Thanks!