ERROR: compilation failed for package lsei

Dear all,

I am encountering some issues to start a shinyapp which need the "npsurv" package and more specifically "lsei" dependency. I am working on MacOS.

Here is the error message I got:

install.packages("npsurv")
also installing the dependency ‘lsei’
There are binary versions available but the source versions are later:
binary source needs_compilation
lsei 1.2-0 1.2-0.1 TRUE
npsurv 0.4-0 0.4-0.1 FALSE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
installing the source packages ‘lsei’, ‘npsurv’

trying URL 'https://cran.rstudio.com/src/contrib/lsei_1.2-0.1.tar.gz'
Content type 'application/x-gzip' length 34682 bytes (33 KB)

downloaded 33 KB

trying URL 'https://cran.rstudio.com/src/contrib/npsurv_0.4-0.1.tar.gz'
Content type 'application/x-gzip' length 29175 bytes (28 KB)

downloaded 28 KB

  • installing source package ‘lsei’ ...
    ** package ‘lsei’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c init.c -o init.o
    gfortran -mmacosx-version-min=10.13 -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c lsei.f -o lsei.o
    *ake: gfortran: No such file or directory
    make: *** [lsei.o] Error 1
    ERROR: compilation failed for package ‘lsei’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/lsei’
    Warning in install.packages :
    installation of package ‘lsei’ had non-zero exit status
    ERROR: dependency ‘lsei’ is not available for package ‘npsurv’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/npsurv’
    Warning in install.packages :
    installation of package ‘npsurv’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T/RtmpwlqTAv/downloaded_packages’

R and RStudio are both updated at the latest version, I updated all the packages too. I really don't know what to do. I would be very grateful if someone can help me.

Thank you very much.
Best.

The easiest solution would be to answer "no" to this question, you would get a precompiled binary version that is a little older but much easier to install.
If you need to install the latest version from source, then you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

Hi, thank you for your reply.

Blockquote

Do you want to install from sources the package which needs compilation?

Blockquote

I tried answer "no"as you suggested, but it seems that the newest version is required as I still fail to install my package:

  • installing source package ‘HumanLiver’ ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    sh: line 1: 2530 Killed: 9 R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T//RtmpqMypU9/file9db73156f06'
    ERROR: lazy loading failed for package ‘HumanLiver’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/HumanLiver’
    Error: Failed to install 'HumanLiver' from GitHub:
    (converted from warning) installation of package ‘/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T//RtmpYN9OjK/file8ece1c1732/HumanLiver_1.5.0.tar.gz’ had non-zero exit status

Do you maybe know a way I can make this compilation work?

Thank you.

Sorry but that error message is telling me nothing, Aren't you omitting something?

Hi, sorry here is the complete code I did with the error message:

library(devtools)
Loading required package: usethis
devtools::install_github("BaderLab/HumanLiver")
Downloading GitHub repo BaderLab/HumanLiver@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: ps (1.3.2 -> 1.3.3 ) [CRAN]
5: lsei (1.2-0 -> 1.2-0.1) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
3
✓ checking for file ‘/private/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T/RtmpgQdFfA/remotesbbd2a1e9ca1/BaderLab-HumanLiver-39c873b/DESCRIPTION’ ...
─ preparing ‘HumanLiver’:
✓ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
NB: this package now depends on R (>= 3.5.0)
WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: ‘HumanLiver/inst/liver/HumanLiver.RData’
─ building ‘HumanLiver_1.5.0.tar.gz’

  • installing source package ‘HumanLiver’ ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    sh: line 1: 3085 Killed: 9 R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T//Rtmpie9mbp/filec06653d2759'
    ERROR: lazy loading failed for package ‘HumanLiver’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/HumanLiver’
    installation of package ‘/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T//RtmpgQdFfA/filebbd3fbd23a1/HumanLiver_1.5.0.tar.gz’ had non-zero exit status

This is what happens when I choose the option 3 for update. As you can see I can choose to update all packages (1), CRAN only (2), None (3), ps (4) or lsei (5). I tried all options but nothing seems to work, I believe it is because I fail to update "lsei" (option 5). When I try option 5 here is what I get:

devtools::install_github("BaderLab/HumanLiver")
Downloading GitHub repo BaderLab/HumanLiver@master
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: ps (1.3.2 -> 1.3.3 ) [CRAN]
5: lsei (1.2-0 -> 1.2-0.1) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
5
lsei (1.2-0 -> 1.2-0.1) [CRAN]
Installing 1 packages: lsei

There is a binary version available but the source version is later:

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) no
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/lsei_1.2-0.tgz'
Content type 'application/x-gzip' length 80866 bytes (78 KB)

downloaded 78 KB

The downloaded binary packages are in
/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T//RtmpgQdFfA/downloaded_packages
✓ checking for file ‘/private/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T/RtmpgQdFfA/remotesbbd629bf07/BaderLab-HumanLiver-39c873b/DESCRIPTION’ ...
─ preparing ‘HumanLiver’:
✓ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
NB: this package now depends on R (>= 3.5.0)
WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: ‘HumanLiver/inst/liver/HumanLiver.RData’
─ building ‘HumanLiver_1.5.0.tar.gz’

  • installing source package ‘HumanLiver’ ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    sh: line 1: 3131 Killed: 9 R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T//Rtmp9JxezF/filec341c5f6c7c'
    ERROR: lazy loading failed for package ‘HumanLiver’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/HumanLiver’
    installation of package ‘/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T//RtmpgQdFfA/filebbd20944d53/HumanLiver_1.5.0.tar.gz’ had non-zero exit status

So again I have the choice between Yes and No for the compilation of "lsei", if I choose no my next command fails because the installation of the package I need from github seems to need the updated "lsei". And if I choose Yes, I have the folowwing message:

installing source package ‘lsei’ ...
** package ‘lsei’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c init.c -o init.o
gfortran -mmacosx-version-min=10.13 -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c lsei.f -o lsei.o
*ake: gfortran: No such file or directory
make: *** [lsei.o] Error 1
ERROR: compilation failed for package ‘lsei’
removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/lsei’
Warning in install.packages :
installation of package ‘lsei’ had non-zero exit status
ERROR: dependency ‘lsei’ is not available for package ‘npsurv’
removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/npsurv’
Warning in install.packages :
installation of package ‘npsurv’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T/RtmpwlqTAv/downloaded_packages’

As I apparently needed to install the latest version of "lsei" I installed Xcode as you suggested which solved this issue, thank you for that. However I still cannot download the package for the shiny app from GitHub:

> devtools::install_github("BaderLab/HumanLiver")
Downloading GitHub repo BaderLab/HumanLiver@master
✓  checking for file ‘/private/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T/Rtmpi7X49L/remotes3696ef82f24/BaderLab-HumanLiver-39c873b/DESCRIPTION’ ...
─  preparing ‘HumanLiver’:
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
     NB: this package now depends on R (>= 3.5.0)
     WARNING: Added dependency on R >= 3.5.0 because serialized objects in  serialize/load version 3 cannot be read in older versions of R.  File(s) containing such objects:  ‘HumanLiver/inst/liver/HumanLiver.RData’
─  building ‘HumanLiver_1.5.0.tar.gz’
   
* installing *source* package ‘HumanLiver’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
sh: line 1:  1546 Killed: 9               R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T//RtmpgRYhU6/file60352474a7'
ERROR: lazy loading failed for package ‘HumanLiver’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/HumanLiver’
installation of package ‘/var/folders/yn/tbw3r2xn0m94qrwvh1h16mnw0000gn/T//Rtmpi7X49L/file36967df1d66/HumanLiver_1.5.0.tar.gz’ had non-zero exit status

I am not sure what to do about this error.
ERROR: lazy loading failed for package ‘HumanLiver’

Sorry, I don't have a clue of what is going on. The github issue you have filed is your best shot and BTW if you cross-post like in this case you should link to the other post.

Thank you anyway. Let's hope I get an answer.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.