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

brms - missing a compiler? #1

Open
jooh opened this issue Feb 11, 2021 · 4 comments
Open

brms - missing a compiler? #1

jooh opened this issue Feb 11, 2021 · 4 comments

Comments

@jooh
Copy link

jooh commented Feb 11, 2021

From this issue in the main repo

Just to log this -
With neuroconda R on the CBU setup, I think this error means that a wrong/missing GNU compiler is being pointed to? i.e. unrecognized command line option ?-std=gnu++14?

R Package: brms
Code from this tutorial: https://github.com/paul-buerkner/brms

> library(brms)
Loading required package: Rcpp
Registered S3 method overwritten by 'xts':
  method     from
  as.zoo.xts zoo 
Loading 'brms' package (version 2.10.0). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').
> fit1 <- brm(count ~ zAge + zBase * Trt + (1|patient), 
+             data = epilepsy, family = poisson())
Compiling the C++ model
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! g++: error: unrecognized command line option ?-std=gnu++14?
make: *** [/imaging/local/software/miniconda/envs/neuroconda_2_0/lib/R/etc/Makeconf:175: file437b1d17f5e1.o] Error 1
In addition: Warning message:
In system(cmd, intern = !verbose) :
  running command '/imaging/local/software/miniconda/envs/neuroconda_2_0/lib/R/bin/R CMD SHLIB file437b1d17f5e1.cpp 2> file437b1d17f5e1.cpp.err.txt' had status 1
Error in sink(type = "output") : invalid connection

@ethanknights

@jooh
Copy link
Author

jooh commented Feb 11, 2021

@ayaby had a similar problem, which turned out to be caused by compile flags set in ~/.R/Makevars. Do you want to try renaming that to Makevars.bak or similar and see if things work (both in Neuroconda and CBU central R)?

@ethanknights
Copy link

ethanknights commented Feb 11, 2021

Thanks - Renaming that file did indeed fix brms in neuroconda R.
Incase of use to someone (or probably me) in the future, Makevar contains text from Alex:

CXX14 = g++ -std=c++1y
CXX14FLAGS = -O3 -Wno-unused-variable -Wno-unused-function -fPIC

cp ~/.R/Makevars ~/.R/Makevars.bak

Note I couldn't test this using the CBU's R (module load R/3.6.3) as I find the rstan package fails to install. Installing rstan produces many errors to the tune of:

/home/ek03/R/x86_64-pc-linux-gnu-library/3.6/StanHeaders/include/stan/math/prim/scal/meta/require_generics.hpp:448:33: error: expected type-specifier before ?require_any_not_t?
 using require_any_not_eigen_t = require_any_not_t<is_eigen<Types>...>;

I expect my Makevar still isn't totally correct. This occurred either with ~/.R/Makevars.bak or ~/.R/Makevars , and other R versions.
Anyway I'll close this issue (for my purposes now, it seems a waste of space/effort to rebuild outside of neuroconda).
Edit: I cant close issue as I didn't make this version!

@jooh
Copy link
Author

jooh commented Feb 11, 2021

Incase of use to someone (or probably me) in the future, Makevar contains text from Alex:

Ah, in that case, paging @JAQuent - are the compile flags key for keeping something running? If so, could we find some flags that play nicely both with native R and conda R?

Going to leave this open for now just in case messing with this file breaks things for native R. It would be good to coexist.

@JAQuent
Copy link

JAQuent commented Feb 15, 2021

Hey, I found that makevar file while debugging and it worked for me without deeper understanding of why it worked.

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

3 participants