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

please drop dependency (Imports) on V8 #831

Closed
makoshark opened this issue Aug 19, 2020 · 33 comments
Closed

please drop dependency (Imports) on V8 #831

makoshark opened this issue Aug 19, 2020 · 33 comments

Comments

@makoshark
Copy link

makoshark commented Aug 19, 2020

The current version of rstan includes a non-critical dependency on the V8 Javascript engine which is extremely difficult to install on some some systems. libv8 is available in most common Linux distributions but cannot be installed from within R and is very difficult to build from source.

My lab runs rstan from a shared HPC super-computer where we do not have root/admin access. Installing the dependencies for the V8 package is extremely tricky because V8 itself does not release source and NodeJS (the most common distribution of V8) does not build a shared library version by default. Even when you build the shared library, it does not provide the required libv8.so etc, so you need to create symlinks by hand (I had to look at the source code for the Debian package to figure this out).

This is all extremely frustrating because rstan does not actually use Javascript for anything essential. The only place that the v8() function is called when trying to download the nightly version of stan3 compiled to Javascript in a beta version of the function. This is also problematic because it assumes Internet access (we also don't have this in the HPC system).

Basically, this dependency brings very little value while making the software difficult or impossible to install for those of us that do not have root or admin access on the research computing systems we rely on to use Stan.

@makoshark makoshark changed the title please drop dependency on V8 please drop dependency (Imports) on V8 Aug 19, 2020
@makoshark
Copy link
Author

For those that are in a similar situation, I've got a patched branch here that removes the dependency and the code that calls it and makes no other changes. You can install it with: install_github("makoshark/rstan", ref="develop", subdir="rstan/rstan") with the devtools library.

I understand that this is not a real long-term solution but it will at least allow you to install the current version on systems that make installing V8 difficult or impossible..

@SteveBronder
Copy link
Contributor

Apologies you had to rummage through all this! But also do keep in mind the next version of the stan compiler needs v8. The new compiler is written in Ocaml and for R integration reasons is transpiled to javascript so rstan will need to use v8 in the future. v8 is currently used so we can have users test out Stan models and report back if their model doesn't work. That can be frustrating for users but the user reports have been very useful to us to make sure the new compiler is up to speed.

@makoshark
Copy link
Author

Hopefully somebody can work out something for people running Stan on machines without root before the Stan3 compiler is released.

A big challenge is that V8 upstream doesn't actually release buildable source so different distro have found a variety of ways or providing libv8. What Debian and Ubuntu do is just symlink NodeJS's libnode.so so some looking for symbols in a variety of places might be helpful.

I've been a Debian/Ubuntu developer for two decades and worked professionally doing this kind of integration/packaging and I failed to get an adequate libv8 installed from source despite several hours of trying. I know this isn't a problem in Stan, but it's a reality that the new dependency is going to cause for Stan users.

@riddell-stan
Copy link

The other interfaces (CmdStan,CmdStanR,CmdStanPy,PyStan) use stanc3 without requiring javascript. Will the use of javascript be dropped in the future, once stanc3 is verified as working on all models?

@jgabry
Copy link
Member

jgabry commented Aug 31, 2020

@riddell-stan I hope so, but I don't know if @bgoodri has any alternative to using the javascript version of stanc3 if RStan needs to be on CRAN. @bgoodri can clarify further, but if I recall correctly CRAN can't handle the OCAML stuff.

@bgoodri
Copy link
Contributor

bgoodri commented Aug 31, 2020

@makoshark I appreciate it (and all you've done for Debian over the years). I can put V8 into Suggests for the next rstan_2.21.x , but I can't get rstan in sync with upstream Stan 2.25+ in the foreseeable future without using javascript for the parser. As far as I can tell, the build dependencies for OCaml are much worse, especially on Windows where the makefiles have circular dependence with flexlink. So, I think we just have to help @jeroen get V8 to install everywhere.

@bgoodri
Copy link
Contributor

bgoodri commented Aug 31, 2020

I've put V8 into Suggests in 8da6f56 so closing this issue, but if anyone has solutions to the V8 installation problems, let's discuss them on jeroen/V8#94 .

@bgoodri bgoodri closed this as completed Aug 31, 2020
@SteveBronder
Copy link
Contributor

The only non-javascript solution I've seen online is that we could use something like ocamlcc to translate from Ocaml -> C, then since the user wouldn't have the ocaml headers we would need to run the preprocessor to inline the #include <ocaml/*> includes. Though this would be very difficult and I'm not really sure it would work

@bgoodri
Copy link
Contributor

bgoodri commented Aug 31, 2020 via email

@jeroen
Copy link
Contributor

jeroen commented Aug 31, 2020

I don't think there is any problem on Debian or Ubuntu or Fedora. The linked issue appears only on Gentoo because it doesn't have a suitable v8-devel package?

@makoshark
Copy link
Author

makoshark commented Aug 31, 2020

I've copied the text of my reply over to a new comment at jeroen/V8#94 (comment) and edited this reply so it's just a pointer since I think that the V8 issue is the right place for this conversation to be happening.

@jeroen
Copy link
Contributor

jeroen commented Sep 1, 2020

@makoshark this is getting really off-topic. A lot of R/python packages have system dependencies which you need to install with apt or yum if you're on Linux. Installing v8 on RHEL is as simple as yum install v8-devel.

If you or your sysadmin doesn't want to do this, I guess you need something like linuxbrew or anaconda to install these libs in your home dir, and try to make that work with R. These systems are built exactly for this use case.

Alternatively you need to build everything from source, but as you found out that is not always trivial, these days libraries are very advanced and require complex tooling to build.

Another route you could go is do everything in a docker container (if your sysadmin will let you run docker at least).

@riddell-stan
Copy link

riddell-stan commented Sep 1, 2020 via email

@gsgxnet
Copy link

gsgxnet commented Oct 22, 2020

For those that are in a similar situation, I've got a patched branch here that removes the dependency and the code that calls it and makes no other changes. You can install it with: install_github("makoshark/rstan", ref="develop", subdir="rstan/rstan") with the devtools library.

I understand that this is not a real long-term solution but it will at least allow you to install the current version on systems that make installing V8 difficult or impossible..

As of today, github states: "This branch is 2 commits ahead, 48 commits behind stan-dev:develop. " - I am not able to realize how relevant the 48 commits behind are. Do you still think it is reasonable to use your patched package?

Especially as the link jgabry gave states about v8:

Its a dependecy of rstan (to run the stanc3 compatibility check for now, but will be used for Stan-to-C++ in 2.23+).

@bgoodri
Copy link
Contributor

bgoodri commented Oct 22, 2020 via email

@gsgxnet
Copy link

gsgxnet commented Oct 22, 2020

But hopefully in a month or so, V8 is going to be a pretty hard requirement, so start trying to get your sysadmins to administer their systems ASAP.

The problem with SUSE is worse. If there were any v8 development library package I would have installed it already. But looks like that package is not available in the SUSE universe any more since some years. I made a post in the openSUSE forums already, https://forums.opensuse.org/showthread.php/546178-R-essential-package-rstan-can-not-be-installed-because-libv8-devel-is-unavailable but no reply there so far.

@bgoodri
Copy link
Contributor

bgoodri commented Oct 23, 2020 via email

@gsgxnet
Copy link

gsgxnet commented Oct 24, 2020

See: jeroen/V8#94 (comment)

Jan helped by supplying a static v8 for the V8 R package.

@jeroen
Copy link
Contributor

jeroen commented Oct 24, 2020

Awesome! You should try to get in touch with the OpenSuse folks to package this up, like for other linux distributions.

@jeroen
Copy link
Contributor

jeroen commented Oct 28, 2020

The V8 R package now has an option to automatically download a static libv8 library when installing on Linux. To test:

Sys.setenv(DOWNLOAD_STATIC_LIBV8 = 1)
install.packages("V8")

This should help users that are on a Linux distribution that does not provide libv8.

@bgoodri
Copy link
Contributor

bgoodri commented Oct 28, 2020

Seems to work. Thanks @jeroen

@UlvHare
Copy link

UlvHare commented Oct 28, 2020

Yes, it works! Now I have rstan on my Gentoo. Thanks, @jeroen !
But IMO it's not a good idea to be dependent on Chrome libraries. Never trust corporations.

@jeroen
Copy link
Contributor

jeroen commented Nov 4, 2020

This is on CRAN now. Hence as of V8 version 3.4.0 you can now also install V8 on any 64-bit Linux like this:

Sys.setenv(DOWNLOAD_STATIC_LIBV8 = 1)
install.packages("V8")

@UlvHare
Copy link

UlvHare commented Nov 5, 2020

Thank You very much, @jeroen !

@makoshark
Copy link
Author

This is fantastic. This works great.

I was able to get V8 to build from source following feedback from this (and several other) bugs but this is much easier and turns installation of this library on most HPC systems where users don't have room from a complicated and largely undocumented task into a very simple one. Thank you, @jeroen.

@jeroen
Copy link
Contributor

jeroen commented Nov 12, 2020

I've written a short blog post about this new feature: https://ropensci.org/technotes/2020/11/12/installing-v8/

@laurabalasso
Copy link

This is on CRAN now. Hence as of V8 version 3.4.0 you can now also install V8 on any 64-bit Linux like this:

Sys.setenv(DOWNLOAD_STATIC_LIBV8 = 1)
install.packages("V8")

I get the error

/usr/bin/ld: cannot find -lv8_monolith

am I missing something?

@andrjohns
Copy link
Contributor

Hi Laura, you'll need to open an issue for this on the V8 github: https://github.com/jeroen/V8/issues

@barracuda156
Copy link

For those that are in a similar situation, I've got a patched branch here that removes the dependency and the code that calls it and makes no other changes. You can install it with: install_github("makoshark/rstan", ref="develop", subdir="rstan/rstan") with the devtools library.

I understand that this is not a real long-term solution but it will at least allow you to install the current version on systems that make installing V8 difficult or impossible..

@makoshark Thank you for a patched version, I could not make V8 on PowerPC work. However building from your repo ended up in error:

Installing package into ‘/Users/svacchanda/Library/R/powerpc/4.1/library’
(as ‘lib’ is unspecified)
Warning in file(con, "r") :
  cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
* installing *source* package ‘rstan’ ...
** using staged installation
** libs
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c Module.cpp -o Module.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [Module.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c chains.cpp -o chains.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [chains.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c init.cpp -o init.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [init.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c misc.cpp -o misc.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [misc.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c pointer-tools.cpp -o pointer-tools.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [pointer-tools.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c sparse_extractors.cpp -o sparse_extractors.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [sparse_extractors.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan_fit_base.cpp -o stan_fit_base.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan_fit_base.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan_fit_rccp.cpp -o stan_fit_rccp.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan_fit_rccp.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stanc.cpp -o stanc.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stanc.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/ast_def.cpp -o stan/lang/ast_def.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/ast_def.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/bare_type_grammar_inst.cpp -o stan/lang/grammars/bare_type_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/bare_type_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/block_var_decls_grammar_inst.cpp -o stan/lang/grammars/block_var_decls_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/block_var_decls_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/expression07_grammar_inst.cpp -o stan/lang/grammars/expression07_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/expression07_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/expression_grammar_inst.cpp -o stan/lang/grammars/expression_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/expression_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/functions_grammar_inst.cpp -o stan/lang/grammars/functions_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/functions_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/indexes_grammar_inst.cpp -o stan/lang/grammars/indexes_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/indexes_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/local_var_decls_grammar_inst.cpp -o stan/lang/grammars/local_var_decls_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/local_var_decls_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/program_grammar_inst.cpp -o stan/lang/grammars/program_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/program_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/semantic_actions_def.cpp -o stan/lang/grammars/semantic_actions_def.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/semantic_actions_def.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/statement_2_grammar_inst.cpp -o stan/lang/grammars/statement_2_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/statement_2_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/statement_grammar_inst.cpp -o stan/lang/grammars/statement_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/statement_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/term_grammar_inst.cpp -o stan/lang/grammars/term_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/term_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/whitespace_grammar_inst.cpp -o stan/lang/grammars/whitespace_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/whitespace_grammar_inst.o] Error 127 (ignored)
-dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/Library/Frameworks/R.framework/Resources/libppc -L/opt/local/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/ -o rstan.so Module.o chains.o init.o misc.o pointer-tools.o sparse_extractors.o stan_fit_base.o stan_fit_rccp.o stanc.o stan/lang/ast_def.o stan/lang/grammars/bare_type_grammar_inst.o stan/lang/grammars/block_var_decls_grammar_inst.o stan/lang/grammars/expression07_grammar_inst.o stan/lang/grammars/expression_grammar_inst.o stan/lang/grammars/functions_grammar_inst.o stan/lang/grammars/indexes_grammar_inst.o stan/lang/grammars/local_var_decls_grammar_inst.o stan/lang/grammars/program_grammar_inst.o stan/lang/grammars/semantic_actions_def.o stan/lang/grammars/statement_2_grammar_inst.o stan/lang/grammars/statement_grammar_inst.o stan/lang/grammars/term_grammar_inst.o stan/lang/grammars/whitespace_grammar_inst.o -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
/bin/sh: -dynamiclib: command not found
make: *** [rstan.so] Error 127
ERROR: compilation failed for package ‘rstan’
* removing ‘/Users/svacchanda/Library/R/powerpc/4.1/library/rstan’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//RtmpjZwabD/file28167d4a38e0/rstan_2.21.2.tar.gz’ had non-zero exit status
>

Any advice will be greatly appreciated.

@bgoodri
Copy link
Contributor

bgoodri commented Nov 26, 2021

Error 127 means that it could not find make. I don't know whether things can be made to work on PowerPC, but they won't work with a make and I doubt they would work with GNU's make.

@barracuda156
Copy link

Error 127 means that it could not find make. I don't know whether things can be made to work on PowerPC, but they won't work with a make and I doubt they would work with GNU's make.

@bgoodri Thank you for reply. Should I try to specify a path somewhere? (For sure make on its own works, I have build many things from sources starting from MacPorts and Git to R itself.)

@bgoodri
Copy link
Contributor

bgoodri commented Nov 26, 2021 via email

@barracuda156
Copy link

@bgoodri Got solved after specifying compilers for CXX14 and CXX17 and a full path to Make in Makevars. Honestly not sure what worked, as I changed these at once. Another error showed up, I found a fix, Rstan installed finally, however model compilation still fails with libtbb error: https://discourse.mc-stan.org/t/override-dependency-on-v8-or-make-v8-build-on-powerpc-mac-r-4-1-2/25432/

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