seq-lang / seq

A high-performance, Pythonic language for bioinformatics
https://seq-lang.org
Apache License 2.0
698 stars 50 forks source link

Compiling works with Seq 0.9.7 fails with Seq 0.9.10 and gives hidden symbol `pthread_atfork' #149

Closed jelber2 closed 4 years ago

jelber2 commented 4 years ago

Seq 0.9.7

gcc -L/home/jelber2/.seq/ -o fqcnt_py2_rfq_new_seq fqcnt_py2_rfq_new_seq.o -no-pie -lseqrt -lomp -lz
Success!

Seq 0.9.10

gcc -L/home/jelber2/sandbox/biofast-data-v1/seq-deploy/lib/seq/ \
-o fqcnt_py2_rfq_new_seq fqcnt_py2_rfq_new_seq.o -no-pie -lseqrt -lomp -lz
/usr/bin/ld: fqcnt_py2_rfq_new_seq: hidden symbol `pthread_atfork' in
/usr/lib/x86_64-linux-gnu/libc_nonshared.a(pthread_atfork.oS) is referenced by DSO
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

Tried adding -pthread as suggested by https://www.programmersought.com/article/85891956778/ (but no success)

System is Ubuntu 20.04.1 LTS

inumanag commented 4 years ago

Hi @jelber2

We are now shipping with our internal OpenMP library. Can you try linking to libomp.dylib/so from SEQ_PATH/lib/seq?

jelber2 commented 4 years ago

libomp.dylib/so does not appear to be in the directory seq-deploy/lib/seq?

$ LD_LIBRARY_PATH
/home/jelber2/sandbox/biofast-data-v1/seq-deploy/lib/seq:

$ echo $SEQ_PATH
/home/jelber2/sandbox/biofast-data-v1/seq-deploy/lib/seq/stdlib

$ echo $PATH
/home/jelber2/sandbox/biofast-data-v1/seq-deploy/bin:/home/jelber2/bin/minimap2:/opt/wine-stable/bin:/home/jelber2/miniconda2/condabin:/home/jelber2/.local/bin:/home/jelber2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

$ gcc -L/home/jelber2/sandbox/biofast-data-v1/seq-deploy/lib/seq/ -o fqcnt_py2_rfq_new_seq fqcnt_py2_rfq_new_seq.o -no-pie -lseqrt -lomp -lz
/usr/bin/ld: cannot find -lomp
collect2: error: ld returned 1 exit status
jelber2 commented 4 years ago

My apologies, I didn't use the install.sh script for version 0.9.10. Now it finds -lomp, but I still get

gcc -L/home/jelber2/.seq2/lib/seq/ -o fqcnt_py2_rfq_new_seq fqcnt_py2_rfq_new_seq.o -no-pie -lseqrt -lomp -lz
/usr/bin/ld: fqcnt_py2_rfq_new_seq: hidden symbol `pthread_atfork' in 
/usr/lib/x86_64-linux-gnu/libc_nonshared.a(pthread_atfork.oS) is referenced by DSO
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
jelber2 commented 4 years ago

Update

The following command worked

gcc -L/home/jelber2/.seq2/lib/seq/ -o fqcnt_py2_rfq_new_seq fqcnt_py2_rfq_new_seq.o -no-pie -lseqrt -lpthread -lomp