View Full Version : Additional R packages in kickstart post script

8th January 2012, 09:09 PM
I've successfully modified the xfce spin to include R and some other analysis software, now I am trying to install some of the packages from CRAN that aren't packaged for Fedora. To do this I am using the %post section of the kickstart file.

The first part copies the tarballs into a directory in the installation root.

# use the nochroot environment to copy files to the install file-system
%post --nochroot

cp $TARPATH/pwr_1.1.1.tar.gz $TAR_INSTALL
cp $TARPATH/AlgDesign_1.1-7.tar.gz $TAR_INSTALL


Then I use the R CMD INSTALL method to install the libraries (pwr and AlgDesign).

# use the chroot'd post environment to build/install the sources

R CMD INSTALL pwr_1.1.1.tar.gz
R CMD INSTALL AlgDesign_1.1-7.tar.gz


The first one (pwr) works just fine, but the second one (AlgDesign) fails. I think pwr is a pure R library, so it doesn't require any compilation, but AlgDesign requires a compile step. Here's the error message:

* installing *source* package 'AlgDesign' ...
** package 'AlgDesign' successfully unpacked and MD5 sums checked
** libs
gcc -m32 -std=gnu99 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -c FederovOpt.c -o FederovOpt.o
gcc: error trying to exec 'cc1': execvp: No such file or directory
make: *** [FederovOpt.o] Error 1
ERROR: compilation failed for package 'AlgDesign'
* removing '/usr/lib/R/library/AlgDesign'
ignoring %post failure (code 1)

I googled "gcc: error trying to exec 'cc1': execvp: No such file or directory," and some threads mentioned that cc1 is provided by the cpp package. I double-checked the livecd-creator output, and I've got cpp installed successfully.

Any ideas on how to fix this? Do I need to set some path variables for gcc to work in the %post or %post --nochroot sections of the kickstart?

8th January 2012, 09:34 PM
I'm not sure that it will - I think it is partially installed, and until the first reboot after this will it actually be available. Things have to get committed (and the library cache rebuilt) before it will actually work.

NOTE: I could be wrong on this though.