oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
626 stars 64 forks source link

Build problem in Docker (on Debian) #11

Closed nuest closed 6 years ago

nuest commented 7 years ago

I'm trying to build FastR from source, see https://github.com/nuest/fastr-docker and the Dockerfile.

I get an error building GNU R, see https://github.com/nuest/fastr-docker/issues/1

Can you guys point me to some potential issues?

lukasstadler commented 7 years ago

the FastR build, at the moment, does a full GNU R build because it reuses some of the artifacts that are generated during that build. that means that we have some dependencies on native libraries (see https://github.com/graalvm/fastr#pre-requisites). if you can retrieve the com.oracle.truffle.r.native/gnur/R-3.3.2/gnur_configure.log file from the failed docker image, that'll give you more concrete information as to what the problem is.

nuest commented 7 years ago

Thanks for the pointer. The problem was a missing F77 compiler:

root@4f3ca9619954:/tmp/fastr# cat  com.oracle.truffle.r.native/gnur/R-3.3.2/gnur_configure.log
checking build system type... x86_64-pc-linux-gnu

[...]

configure: error: No F77 compiler found

So I re-checked your documentation link and installed gfortran, libpcre3-dev, and the various compression libs in -dev versions: https://github.com/nuest/fastr-docker/commit/4596a283859ae64596eae3135c84eccc32baa3fe

Now I have some make logs to go through and fix, will post updates here:

Click to expand ``` [...] making signrank.d from signrank.c make[5]: execvp: /bin/bash: Timer expired ../../Makeconf:120: recipe for target 'imax2.d' failed make[5]: *** [imax2.d] Error 127 make[5]: *** Waiting for unfinished jobs.... /bin/bash: /usr/bin/gcc: Timer expired : error trying to exec '/usr/lib/gcc/x86_64-linux-gnu/7/cc1': execv: Timer expired gcc: error trying to exec '/usr/lib/gcc/x86_64-linux-gnu/7/cc1': execv: Timer expired /bin/bash: /usr/bin/gcc: Timer expired qnt.c:20:10: fatal error: nmath.h: Timer expired #include "nmath.h" ^~~~~~~~~ compilation terminated. In file included from qunif.c:25:0: nmath.h:40:10: fatal error: /usr/include/math.h: Timer expired #include ^~~~~~~~ ../../Makeconf:120: recipe for target 'punif.d' failed make[5]: *** [punif.d] Error 127 compilation terminated. ../../Makeconf:120: recipe for target 'fround.d' failed make[5]: *** [fround.d] Error 126 ../../Makeconf:120: recipe for target 'pf.d' failed make[5]: *** [pf.d] Error 126 ../../Makeconf:120: recipe for target 'pnorm.d' failed make[5]: *** [pnorm.d] Error 126 ../../Makeconf:120: recipe for target 'qnt.d' failed make[5]: *** [qnt.d] Error 1 ../../Makeconf:120: recipe for target 'fsign.d' failed make[5]: *** [fsign.d] Error 1 ../../Makeconf:120: recipe for target 'qgeom.d' failed make[5]: *** [qgeom.d] Error 1 ../../Makeconf:120: recipe for target 'qunif.d' failed make[5]: *** [qunif.d] Error 1 make[5]: Leaving directory '/tmp/fastr/com.oracle.truffle.r.native/gnur/R-3.3.2/src/nmath' Makefile:28: recipe for target 'R' failed make[4]: *** [R] Error 1 make[4]: Leaving directory '/tmp/fastr/com.oracle.truffle.r.native/gnur/R-3.3.2/src' Makefile:60: recipe for target 'R' failed make[3]: *** [R] Error 1 make[3]: Leaving directory '/tmp/fastr/com.oracle.truffle.r.native/gnur/R-3.3.2' ```
nuest commented 6 years ago

Since a full GNU R build is required, looking at the Rocker Dockerfiles might help.

nuest commented 6 years ago

The Docker build works now, automated on GitHub:

Docker Automated build Docker Build Status

Feedback by fastr developers would be highly appreciated. If welcome, I'd be happty to contribute a blog post or wiki page about how you could use this image. The most prominent use case I can think of is "regular R" users trying out their code with fastr

steve-s commented 6 years ago

Hi Daniel,

thank you for putting this together! We'll probably add a link from our README.

One idea: if you also run mx build in graal/compiler directory and then run FastR with mx --dynamicimports graal/compiler R, then FastR will run with Graal compiler, i.e. long running computations should run much faster. You can verify that by running mx --dynamicimport graal/compiler --J "@-Dgraal.TraceTruffleCompilation=true" R and some loop like for (i in 1:10000) unique(1:i), logs of compilation activity should be printed in the console.

nuest commented 6 years ago

Thanks! That worked quickly, I do see the logging messages.

I will push this change it would be cool to have some kind of benchmark, I'm happy about any pointers if you have already a short comparison script.

Do you mind helping me out and explain the difference between mx R and running /fastr/bin/R ?

steve-s commented 6 years ago

do you mind helping me out and explain the difference between mx R and running /fastr/bin/R

mx R directly runs java (and FastR in it), while ./bin/R is launcher script taken from GNU R almost as is and it preprocessed options before running java & FastR. With ./bin/R you can do for example, ./bin/R CMD INSTALL mypackage, which you can't do with mx R, but at the same time with mx you get all the mx support, like adding java arguments via --J @'args' and starting with debugger via -d etc.

it would be cool to have some kind of benchmark

There is one in the documentation [1] and another here [2], there are some micro benchmarks available in older Purdue FastR repo [3] that we moved out of this FastR repo since then.

[1] http://www.graalvm.org/docs/reference-manual/languages/r/#high-performance [2] https://github.com/graalvm/examples/tree/master/fastr_scalar [3] https://github.com/allr/purdue-fastr/tree/master/test/r

nuest commented 6 years ago

Thanks for the links!

I updated the README with the minimal example, a proper comparison based on the containers is very easy to do but will have to wait until someone asks for it :-)

image