Cannot Install the Development version on MacOS 10.15
Summary:
I am trying to install the development version on MacOS 10.15 to make use of your survival analysis.
Description:
During the build process, if I skip the update I get the following error In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/include/rstan/rstaninc.hpp:4: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/include/rstan/stan_fit.hpp:11:10: fatal error: 'stan/version.hpp' file not found #include <stan/version.hpp> ^~~~~~~~~~~~~~~~~~
If I try to update rstan (2.21.1 -> 2.21.2) it errors out again:
module.cpp:2:10: error: 'stan/model/model_base.hpp' file not found with
Reproducible Steps:
RStanARM Version:
2.21.1
R Version:
4.0.1
Operating System:
MacOS 10.15.6
Sorry you're getting an error.
If I try to update rstan (2.21.1 -> 2.21.2) it errors out again:
Hmm, rstan 2.21.2 is installed for me on MacOS 10.15.6 so we should be able to get this working. Do you have anything in the Makevars file? You can check by running file.edit("~/.R/Makevars").
Also which version of the StanHeaders package do you have?
StanHeader Version: ‘2.21.0.6’ Makevars file contents:
# The following statements are required to use the clang4 binary
CC=/usr/local/clang4/bin/clang -mmacosx-version-min=10.13 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
#CXX := /usr/local/clang4/bin/clang++ -mmacosx-version-min=10.13 -std=gnu++11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CXX11=$(CXX)
#CXX14=$(CXX)
CXX14 := /usr/local/clang4/bin/clang++ -mmacosx-version-min=10.13 -std=gnu++11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CXX17=$(CXX)
CXX1X=$(CXX)
LDFLAGS=-L"/usr/local/clang4/lib"
PKG_CPPFLAGS=-I/usr/local/clang4/include/c++/v1/
# End clang4 inclusion statements
Thanks, I think some of those lines in the Makevars file are outdated and are causing the problem. I'm on the same OS as you and in my Makevars file I just have these two lines:
CXX14FLAGS=-O3 -march=native -mtune=native
CXX14FLAGS += -arch x86_64 -ftemplate-depth-256
If you save a copy of what you currently have in Makevars (just in case) but then replace everything with just those two lines does it work?
I had to update R to 4.0.2, but that looks like it fixed the installation problem. However, R still doesn't find the stan_surv function.
Error: 'stan_surv' is not an exported object from 'namespace:rstanarm'
rstanarm version: 2.21.2
StanHeaders version: 2.21.0.6
rstan version: 2.21.2
Hmm, maybe you installed the master branch instead of the feature/survival branch?
If you install rstanarm from GitHub using the code here
https://github.com/stan-dev/rstanarm#development-version
then you can specify the branch you want by adding the argument ref="feature/survival".
So this is what I ran:
Sys.setenv(MAKEFLAGS = "-j4") # change 4 to however many cores you can/want to use to parallelize install
Sys.setenv("R_REMOTES_NO_ERRORS_FROM_WARNINGS" = "true")
remotes::install_github("stan-dev/rstanarm", ref="feature/survival", INSTALL_opts = "--no-multiarch", force = TRUE)
It appears to have installed without error, but now when I try to load the library I get the following error: Error: package or namespace load failed for ‘rstanarm’ in .doLoadActions(where, attach): error in load action .A.1 for package rstanarm: is(module, "character"): object 'm' not found
I am also getting several of these warning messages during the compilation.
In file included from stan_files/surv.hpp:18:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/include/rstan/rstaninc.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/include/rstan/stan_fit.hpp:22:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/RcppEigenForward.h:39:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/unsupported/Eigen/Polynomials:135:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/unsupported/Eigen/../../Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
It appears to have installed without error, but now when I try to load the library I get the following error: Error: package or namespace load failed for ‘rstanarm’ in .doLoadActions(where, attach): error in load action .A.1 for package rstanarm: is(module, "character"): object 'm' not found
Hmm, I'm not sure about that. @bgoodri any ideas how to fix this?
Any more thoughts?
I think those warnings are ok to ignore but this
It appears to have installed without error, but now when I try to load the library I get the following error: Error: package or namespace load failed for ‘rstanarm’ in .doLoadActions(where, attach): error in load action .A.1 for package rstanarm: is(module, "character"): object 'm' not found
is still mysterious to me. I don't get this error despite apparently having the same setup as you. @bgoodri Any ideas what's going on here?
It means the modules didn't get built somehow.
On Thu, Oct 8, 2020 at 2:52 PM Jonah Gabry [email protected] wrote:
I think those warnings are ok to ignore but this
It appears to have installed without error, but now when I try to load the library I get the following error: Error: package or namespace load failed for ‘rstanarm’ in .doLoadActions(where, attach): error in load action .A.1 for package rstanarm: is(module, "character"): object 'm' not found
is still mysterious to me. I don't get this error despite apparently having the same setup as you. @bgoodri https://github.com/bgoodri Any ideas what's going on here?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstanarm/issues/471#issuecomment-705758266, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKUJJWMZO2KTWJWVE2DSJYC63ANCNFSM4R5DFYKQ .
I think I have seen something similar on my Windows machine in the past. Perhaps if you have built the rstanarm version without stan_surv from source, and then you go to build the version with stan_surv from source, without making sure that the previous DLL file has been removed. Although I'm way beyond my understanding to be talking about this, since I don't even know whether a Mac generates a .dll and from a quick google it doesn't. But maybe something equivalent is happening on Mac -- the compiled version of the package without surv.stan isn't being removed from an earlier install from source. Just a wild guess, that might not even make sense.
On Fri, 9 Oct 2020 at 08:56, bgoodri [email protected] wrote:
It means the modules didn't get built somehow.
On Thu, Oct 8, 2020 at 2:52 PM Jonah Gabry [email protected] wrote:
I think those warnings are ok to ignore but this
It appears to have installed without error, but now when I try to load the library I get the following error: Error: package or namespace load failed for ‘rstanarm’ in .doLoadActions(where, attach): error in load action .A.1 for package rstanarm: is(module, "character"): object 'm' not found
is still mysterious to me. I don't get this error despite apparently having the same setup as you. @bgoodri https://github.com/bgoodri Any ideas what's going on here?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/stan-dev/rstanarm/issues/471#issuecomment-705758266 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAZ2XKUJJWMZO2KTWJWVE2DSJYC63ANCNFSM4R5DFYKQ
.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstanarm/issues/471#issuecomment-705844455, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVECTBPD4OABS2UCYVAQFTSJYYPXANCNFSM4R5DFYKQ .