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

[pgenlib] pip install fails with v0.81.2

aryarm opened this issue · comments

Steps to reproduce

conda create -y -n pgenlib-pip 'conda-forge::pip'
conda activate pgenlib-pip
pip install Pgenlib

Installing directly from the Github repository also fails with the same error:

pip install git+https://github.com/chrchang/plink-ng.git#subdirectory=2.0/Python

Error log

Click me

Collecting Pgenlib
Downloading Pgenlib-0.81.2.tar.gz (385 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 385.2/385.2 kB 1.7 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: Pgenlib
Building wheel for Pgenlib (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for Pgenlib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_ext
building 'pgenlib' extension
creating build
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/src
creating build/temp.linux-x86_64-cpython-310/src/pgenlib
creating build/temp.linux-x86_64-cpython-310/src/plink2
creating build/temp.linux-x86_64-cpython-310/src/plink2/include
gcc -pthread -B pgenlib-pip/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem pgenlib-pip/include -fPIC -O2 -isystem pgenlib-pip/include -fPIC -Isrc/pgenlib -I/tmp/pip-build-env-w3a9ljgm/overlay/lib/python3.10/site-packages/numpy/core/include -Ipgenlib-pip/include/python3.10 -c src/pgenlib/pgenlib.cpp -o build/temp.linux-x86_64-cpython-310/src/pgenlib/pgenlib.o -std=c++98 -Wno-unused-function -Wno-macro-redefined
error: command 'gcc' failed: No such file or directory
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for Pgenlib
Failed to build Pgenlib
ERROR: Could not build wheels for Pgenlib, which is required to install pyproject.toml-based projects

Additional info

I haven't had a chance to try to install gcc to try to see if that helps.
I haven't had this error when installing pgenlib before.
I also noticed that PyPI doesn't have any wheels listed for pgenlib. Uploading wheels might help.

This does not fail on my Linux test machine.

While I may upload a wheel at some point, you should install gcc for now.

Ok, sounds good.

Installing gcc seems to help a bit, but then I run into another error. Is there another package I should install? Here's what I'm doing

conda create -y -n haptools-plink -c conda-forge pip gcc
conda activate pgenlib-pip
pip install Pgenlib

Here's the error log:

Click me

Building wheels for collected packages: Pgenlib
Building wheel for Pgenlib (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for Pgenlib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
running bdist_wheel
running build
running build_ext
building 'pgenlib' extension
creating build
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/src
creating build/temp.linux-x86_64-cpython-310/src/pgenlib
creating build/temp.linux-x86_64-cpython-310/src/plink2
creating build/temp.linux-x86_64-cpython-310/src/plink2/include
/home/amassarat/miniconda3/envs/haptools-plink/bin/x86_64-conda-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/amassarat/miniconda3/envs/haptools-plink/include -fPIC -O2 -isystem /home/amassarat/miniconda3/envs/haptools-plink/include -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/amassarat/miniconda3/envs/haptools-plink/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/amassarat/miniconda3/envs/haptools-plink/include -fPIC -Isrc/pgenlib -I/tmp/pip-build-env-ysr5ka01/overlay/lib/python3.10/site-packages/numpy/core/include -I/home/amassarat/miniconda3/envs/haptools-plink/include/python3.10 -c src/pgenlib/pgenlib.cpp -o build/temp.linux-x86_64-cpython-310/src/pgenlib/pgenlib.o -std=c++98 -Wno-unused-function -Wno-macro-redefined
x86_64-conda-linux-gnu-cc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
compilation terminated.
error: command '/home/amassarat/miniconda3/envs/haptools-plink/bin/x86_64-conda-linux-gnu-cc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel

I've so far tried this on two different Linux machines. I'll try some more soon. Notably, it did not fail in our CI.

On Ubuntu, the "build-essential" package should cover any other requirements. This may be a bit different on other distributions and operating systems.

Ok, installing the build-essential package worked!

Our team has been using pgenlib within a software tool that we plan to publish soon. (And we've been very happy with the PGEN format! We developed a library to load and write VCFs and PLINK2 PSAM+PVAR+PGEN files into a common python data structure, and our own benchmarks demonstrate that PLINK2 is an order of magnitude faster for the type of data we'd like to load.) So in the future, it would be helpful to have wheels. In the meantime, we'll just tell users to install build-essential if they have any trouble.

By the way, is there a specific way we should cite pgenlib or should we simply cite PLINK2 as a whole? Thanks again for making such a great tool!

thanks for releasing v0.81.3!

is there any chance you can upload pre-compiled wheels for it, too? I'd be happy to help create a github action to do this automatically for you, if you'd like

Manylinux wheels are now available for 0.82.1.

great, thank you so much!