chrchang / plink-ng

A comprehensive update to the PLINK association analysis toolset. Beta testing of the first new version (1.90), focused on speed and memory efficiency improvements, is finishing up. Development is now focused on building out support for multiallelic, phased, and dosage data in PLINK 2.0.

Home Page:https://www.cog-genomics.org/plink/2.0/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERROR: compilation failed for package 'pgenlibr'

xug3 opened this issue · comments

Hi Chrchang, I tried to install pgenlibr package, but met the following error:
make: *** No rule to make target 'include/plink2_base.o', needed by 'pgenlibr.dll'. Stop.
ERROR: compilation failed for package 'pgenlibr'

By the way, I used window 11 system with 4.2.1 R and ran:
devtools::install_github('chrchang/plink-ng', subdir='2.0/pgenlibr')

My understanding is that devtools does not handle symbolic links properly on Windows 10-11. You should be able to work around the issue by cloning the repository and replacing the relevant symbolic links with brute-force copies of those directories.

Thank you so much for your reply. I am confused about "replacing the relevant symbolic links with brute-force copies of those directories." So I tried the following three ways:

  1. I tried ran:
    devtools::install_github('https://github.com/chrchang/plink-ng.git', subdir='2.0/pgenlibr')
  2. I tried to download the repository as plink-ng-master.zip and save this zip file in local, then ran:
    devtools::install_local(path='C:\plink-ng-master.zip',subdir="2.0\pgenlibr",type="source")
  3. I also tried another laptop with window system.

But all of them give me same error report.
I may misunderstand your replying, could you please give me an example of coding?
Anyway, I really appreciate your response.

You should first install git, and clone the repository with "git clone https://github.com/chrchang/plink-ng.git".

Depending on how you configured git, devtools::install_local(path='C:\pgenlibr\path\in\cloned\repo',type="source") might be enough at this point. If it is not, look at the 8 folder-with-right-arrow icons under https://github.com/chrchang/plink-ng/tree/master/2.0/pgenlibr/src (for "include", "libdeflate", etc.). Delete the corresponding files in your local pgenlibr directory, and replace them with the original contents of those files/directories.

Thank you for your instructions. I tried to use git to clone the repository and ran:
devtools::install_local(path="C:\plink-ng\2.0\pgenlibr",type="source")

I still got exactly the same error. I also tried replace the 8 folders and still got the same error.
I attached the full report for your reference:

checking for file 'C:\Users\AppData\Local\Temp\RtmpgpBKnH\file28a41664714c\pgenlibr/DESCRIPTION' ...
✔ checking for file 'C:\Users\AppData\Local\Temp\RtmpgpBKnH\file28a41664714c\pgenlibr/DESCRIPTION'
─ preparing 'pgenlibr':
checking DESCRIPTION meta-information ...
✔ checking DESCRIPTION meta-information
─ cleaning src
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building 'pgenlibr_0.3.2.tar.gz'

Installing package into ‘C:/Users/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)

  • installing source package 'pgenlibr' ...
    ** using staged installation
    ** libs
    make: *** No rule to make target 'include/plink2_base.o', needed by 'pgenlibr.dll'. Stop.
    ERROR: compilation failed for package 'pgenlibr'
  • removing 'C:/Users/AppData/Local/R/win-library/4.2/pgenlibr'
    Warning message:
    In i.p(...) :
    installation of package ‘C:/Users/AppData/Local/Temp/RtmpgpBKnH/file28a421805423/pgenlibr_0.3.2.tar.gz’ had non-zero exit status

The instructions I gave worked for my Windows 10 test machine.

As a practical matter, I am finally taking care of a CRAN submission for pgenlibr this weekend, so if you are unable to correctly replace e.g. the include/ subdirectory that's the root of your error, you are probably best off waiting.

Thank you for your reply! I will wait for the CRAN version.
Really appreciate for your help! Feel free to close this issue.

I will wait until the CRAN version is actually available to you before closing...

pgenlibr is now on CRAN. I still had problems today running install.packages('pgenlibr') on Windows, but hopefully that problem will solve itself over the next few days as the CRAN servers start offering precompiled binaries, and in the meantime the installation strategy at https://stackoverflow.com/posts/26275897/revisions did work for me on Windows.