rajanil / fastStructure

A variational framework for inferring population structure from SNP genotype data.
MIT License
133 stars 51 forks source link

"error: command 'gcc' failed with exit status 1"; building setup.py #75

Open quinn-ca opened 1 year ago

quinn-ca commented 1 year ago

I'm working in a conda virtual environment (remote linux server) where I've installed python 2.7. I followed the instructions for installing FastStructure, including:

  1. Installed dependencies (using cython 0.27.3)
  2. Installed FastStructure: git clone https://github.com/rajanil/fastStructure
  3. Added gcc to my .bashrc file

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/scarvey/miniconda3/envs/python2.7_venv/lib export CFLAGS="-I/home/scarvey/miniconda3/envs/python2.7_venv/include/gsl" export LDFLAGS="-L/home/scarvey/miniconda3/envs/python2.7_venv/lib"

  1. Ran: source ~/.bashrc
  2. Successfully (seemingly at least) ran python setup.py build_ext -f --inplace in the fastStructure directory
  3. cd into the vars directory and ran: python setup.py build_ext -f --inplace (tried with and without the -f flag)

Code ran until I encountered the error:

gcc -pthread -B /home/scarvey/miniconda3/envs/python2.7_venv/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/scarvey/miniconda3/envs/python2.7_venv/bin -fPIC -I/home/scarvey/miniconda3/envs/python2.7_venv/lib/python2.7/site-packages/numpy/core/include -I. -I/home/scarvey/miniconda3/envs/python2.7_venv/include/python2.7 -c C_allelefreq.c -o build/temp.linux-x86_64-2.7/C_allelefreq.o -O3
C_allelefreq.c:7:28: fatal error: gsl/gsl_sf_psi.h: No such file or directory
 #include <gsl/gsl_sf_psi.h>
                            ^
compilation terminated.
error: command 'gcc' failed with exit status 1

I confirmed the file 'gsl_sf_psi.h' is saved in the directory I added to my .bashrc file (export CFLAGS="-I/home/scarvey/miniconda3/envs/python2.7_venv/include/gsl"), so I'm not sure why it isn't finding this.

There are a lot of helpful resources for installing FastStructure and I seem to have exhausted the current tips for getting this to work and greatly appreciate any help!