Rosemeis / pcangsd

Framework for analyzing low depth NGS data in heterogeneous populations using PCA.
GNU General Public License v3.0
47 stars 11 forks source link

python pcangsd.py -h fail with ImportError: /home/ec2-user/pcangsd2/pcangsd/reader.cpython-37m-x86_64-linux-gnu.so: undefined symbol: omp_get_thread_num error #27

Closed Callithrix-omics closed 4 years ago

Callithrix-omics commented 4 years ago

I am installing pcangsd on an amazon linux ec2 image. after running pip dependencies command and setup.py I get the above error when trying to run pcangsd.py.

any suggestions?

thank you Joanna

Callithrix-omics commented 4 years ago

here is the full error message (env) [pcangsd]$ python pcangsd.py -h Traceback (most recent call last): File "pcangsd.py", line 16, in import reader ImportError: /home/ec2-user/pcangsd2/pcangsd/reader.cpython-37m-x86_64-linux-gnu.so: undefined symbol: omp_get_thread_num

Rosemeis commented 4 years ago

Hi Joanna,

It seems that something is going wrong with OpenMP (multi-threading). That means that it might be the compiler used to setup PCAngsd.

https://stackoverflow.com/questions/58066500/gcc-with-openmp-support-for-amazon-linux

Here is a similar issue.

Best, Jonas

jonaszierer commented 4 years ago

Hi both,

I tried with gcc6.4.0 and get "undefined symbol: GOMP_barrier", which I assume is the same problem? Any suggestions howto solve this?

thanks! Jonas

Rosemeis commented 4 years ago

Hi, Yeah, even though gcc 6.4 should have OpenMP instructions, then it seems that it is not linked properly. How are you installing it, and is it also on a Amazon Linux image?

One thing could be to make your own Anaconda environment for Python, then it should take care of all dependencies of its compiler and shared libraries.

Best, Jonas

jonaszierer commented 4 years ago

puh that was a hard one. There is a bug in setup.py. for the reader module extra_link_args=['-fopenmp'], is missing.

Rosemeis commented 4 years ago

Yes that is true! Thank you catching that! :-)

/Jonas