oracle / fastr

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

quadprog install package errors - incorrect looking f2c-wrapper invocation #143

Open mik3hall opened 4 years ago

mik3hall commented 4 years ago

Attempting to install the quadprog package. A dependency. I get the below. Notice the... -c -o solve.QP.compact.o solve.QP.compact.f This is out of order isn't it? Shouldn't it be... -c file.c -o file.o

R> install.packages("quadprog",quiet=FALSE,verbose=TRUE,keep_output=TRUE) Installing package into ‘/Users/mjh/Documents/R/fastr’ (as ‘lib’ is unspecified) system (cmd0): /Users/mjh/HalfPipe/HalfPipe_jpkg/outFastR/FastRGraalHPS.app/Contents/runtime/Contents/Home/languages/R/bin/R CMD INSTALL Content type 'application/octet-stream' length 33651 bytes (32 KB) foundpkgs: quadprog, /var/folders/dh/91wmrk0n6lzfmr4tjhjmcfp40000gn/T/Rtmpm5Skaa/downloaded_packages/quadprog_1.5-5.tar.gz files: /var/folders/dh/91wmrk0n6lzfmr4tjhjmcfp40000gn/T/Rtmpm5Skaa/downloaded_packages/quadprog_1.5-5.tar.gz

The downloaded source packages are in ‘/private/var/folders/dh/91wmrk0n6lzfmr4tjhjmcfp40000gn/T/Rtmpm5Skaa/downloaded_packages’ Warning message: In install.packages("quadprog", quiet = FALSE, verbose = TRUE, keep_output = TRUE) : installation of package ‘quadprog’ had non-zero exit status

steve-s commented 4 years ago

Hello,

yes this indeed looks like the f2c wrapper did not work properly. This was also reported here: #135. If you change FC in etc/Makeconf to point to just gfortran (without the f2c wrapper), then this will get compiled directly by gfortran. The downside is that, unless you change it back, FastR would not try compiling Fotran code with F2C anymore and you would potentially miss on being able to run the newly installed packages in the LLVM mode (--R.BackEnd=llvm) if they happen to contain Fortran code.

mik3hall commented 4 years ago

Hello, thanks for the reply.

I had seen #135 but not noticed that it also concerned f2c wrapper. However, the error seems different. #135 actually seems a compilation error. While here the invocation seems a bit off. I was thinking maybe the extra dotted levels - solve.QP.compact - are confusing some parsing somewhere. But so far looking around some have not figured out where that parsing might be done. Some of the invocation obviously comes from Makeconf but what adds on the -c -o solve.QP.compact.o solve.QP.compact.f bit? My preference would be to use FastR as intended. I can look at it some if I can figure out where to look. Although, not real familiar with this sort of code.

mik3hall commented 4 years ago

OK, I think I was sort of on the right track but the problem wasn't handling the multi-level name in f2c producing the "-c -o ..." but rather the handling of the extra dotted file extension in f2c-wrapper. I think here...

target_dir=$(dirname "$output_file") target_file=$(basename "$source_file")

target_file_no_ext=${target_file%%.*}

target_file_no_ext="${target_file%.*}"

Replacing the commented with the single % I googled for removing the extension seems to work.

installing to /Users/mjh/Documents/R/fastr/00LOCK-quadprog/00new/quadprog/libs R byte-compile and prepare package for lazy loading ** help * installing help indices building package indices testing if installed package can be loaded from temporary location checking absolute paths in shared objects and dynamic libraries testing if installed package can be loaded from final location testing if installed package keeps a record of temporary installation path

zslajchrt commented 4 years ago

Thanks for identifying the issue. I verified the wrong pattern was the crux of the problem.