Package installation in jupyter notebook
Hi-
I am working with a notebook in Terra using the R kernel. I am attempting to install some packages but am running into some issues that I do not know how to fix without root permissions. Below is an example of the code that I am using and the resulting error:
> install.packages("minqa")
Installing package into ‘/home/jupyter-user/.rpackages’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/minqa_1.2.4.tar.gz'
Content type 'application/x-gzip' length 53548 bytes (52 KB)
==================================================
downloaded 52 KB
* installing *source* package ‘minqa’ ...
** package ‘minqa’ successfully unpacked and MD5 sums checked
** libs
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c altmov.f -o altmov.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c bigden.f -o bigden.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c biglag.f -o biglag.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c bobyqa.f -o bobyqa.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c bobyqb.f -o bobyqb.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c lagmax.f -o lagmax.o
g++ -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c minqa.cpp -o minqa.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c newuoa.f -o newuoa.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c newuob.f -o newuob.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c prelim.f -o prelim.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c rescue.f -o rescue.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c trsapp.f -o trsapp.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c trsbox.f -o trsbox.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c trstep.f -o trstep.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c uobyqa.f -o uobyqa.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c uobyqb.f -o uobyqb.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c update.f -o update.o
gfortran -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.5.2=. -fstack-protector-strong -c updatebobyqa.f -o updatebobyqa.o
g++ -shared -L/usr/lib/R/lib -Wl,-z,relro -o minqa.so altmov.o bigden.o biglag.o bobyqa.o bobyqb.o lagmax.o minqa.o newuoa.onewuob.o prelim.o rescue.o trsapp.o trsbox.o trstep.o uobyqa.o uobyqb.o update.o updatebobyqa.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:6: recipe for target 'minqa.so' failed
make: *** [minqa.so] Error 1
ERROR: compilation failed for package ‘minqa’
* removing ‘/home/jupyter-user/.rpackages/minqa’
The downloaded source packages are in
‘/tmp/Rtmp4id4Ub/downloaded_packages’
Warning message:
In install.packages("minqa") :
installation of package ‘minqa’ had non-zero exit status
Any ideas on how to get around this would be great! Thanks!
-Tim
Comments
2 comments
Hello Tim,
Have you tried to install this package using a user start up script before? This option allows users to install packages that are not already installed in the root of Notebooks at the start of the cluster generation.
The start up script is a bash script in which you can state which packages you want to install. Using this script will allow you to successfully install packages without root permissions.
This bucket contains our publicly available examples of user scripts that you are more than welcome to use. You will need to make your own copy in a public google bucket if you make changes and insert the path to the file (required to be public) in the Notebook Runtime modal:
The screenshot shows that you need to select "Custom" profile and add the gs:// path to the "Startup script" field.
Hope this helps! Let us know if we can help you any further.
Great. Thanks!
Please sign in to leave a comment.