smarco / BiWFA-paper

Bidirectional WFA (Paper)
Other
41 stars 3 forks source link

Make error #7

Closed XscapeCn closed 2 years ago

XscapeCn commented 2 years ago

Hello! I just clone the repository and try it but I have met a make error in 'example' folder. I have followed the instruction in README.md:

$> git clone https://github.com/smarco/BiWFA-paper
$> cd BiWFA-paper
$> make clean all

and I did:

$> cd example
$> make

the error is:

cc  -L../lib -I.. wfa_basic.c -o bin/wfa_basic -lwfa -lm
/usr/bin/ld: ../lib/libwfa.a(wavefront_compute_affine.o): in function `wavefront_compute_affine._omp_fn.0':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_affine.c:230: undefined reference to `omp_get_num_threads'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_affine.c:230: undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../lib/libwfa.a(wavefront_compute_affine.o): in function `wavefront_compute_affine':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_affine.c:227: undefined reference to `GOMP_parallel'
/usr/bin/ld: ../lib/libwfa.a(wavefront_compute_affine2p.o): in function `wavefront_compute_affine2p._omp_fn.0':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_affine2p.c:341: undefined reference to `omp_get_num_threads'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_affine2p.c:341: undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../lib/libwfa.a(wavefront_compute_affine2p.o): in function `wavefront_compute_affine2p':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_affine2p.c:338: undefined reference to `GOMP_parallel'
/usr/bin/ld: ../lib/libwfa.a(wavefront_compute_edit.o): in function `wavefront_compute_edit._omp_fn.0':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_edit.c:336: undefined reference to `omp_get_num_threads'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_edit.c:336: undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../lib/libwfa.a(wavefront_compute_edit.o): in function `wavefront_compute_edit':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_edit.c:333: undefined reference to `GOMP_parallel'
/usr/bin/ld: ../lib/libwfa.a(wavefront_compute_linear.o): in function `wavefront_compute_linear._omp_fn.0':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_linear.c:165: undefined reference to `omp_get_num_threads'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_linear.c:165: undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../lib/libwfa.a(wavefront_compute_linear.o): in function `wavefront_compute_linear':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_compute_linear.c:162: undefined reference to `GOMP_parallel'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_endsfree_check_termination':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:109: undefined reference to `GOMP_critical_start'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:109: undefined reference to `GOMP_critical_end'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_end2end._omp_fn.0':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:337: undefined reference to `omp_get_num_threads'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:337: undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_end2end_max._omp_fn.0':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:290: undefined reference to `omp_get_num_threads'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:290: undefined reference to `omp_get_thread_num'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:294: undefined reference to `GOMP_critical_start'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:294: undefined reference to `GOMP_critical_end'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_endsfree_check_termination':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:125: undefined reference to `GOMP_critical_start'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:125: undefined reference to `GOMP_critical_end'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_endsfree._omp_fn.0':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:383: undefined reference to `omp_get_num_threads'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:383: undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_endsfree_check_termination':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:125: undefined reference to `GOMP_critical_start'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:125: undefined reference to `GOMP_critical_end'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:109: undefined reference to `GOMP_critical_start'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_custom._omp_fn.0':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:430: undefined reference to `omp_get_num_threads'
/usr/bin/ld: /mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:430: undefined reference to `omp_get_thread_num'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_end2end_max':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:287: undefined reference to `GOMP_parallel'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_end2end':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:334: undefined reference to `GOMP_parallel'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_endsfree':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:380: undefined reference to `GOMP_parallel'
/usr/bin/ld: ../lib/libwfa.a(wavefront_extend.o): in function `wavefront_extend_custom':
/mnt/d/WSL/opt/BiWFA-paper/wavefront/wavefront_extend.c:427: undefined reference to `GOMP_parallel'
collect2: error: ld returned 1 exit status
make: *** [Makefile:16: examples_c] Error 1

Could you help me solve this issue? Thanks for your help!

jeizenga commented 2 years ago

Maybe you are missing OpenMP? Try sudo apt install libomp-dev and see if it compiles afterward.

XscapeCn commented 2 years ago

Sorry for not replying in time. That still doesn't seem to work and the error is same as before.

smarco commented 2 years ago

Can you let us know which compiler and version are you using?

XscapeCn commented 2 years ago

I am using gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

smarco commented 2 years ago

I would need to compiler version.

$> gcc --version

XscapeCn commented 2 years ago

yes, what I did is gcc --version.

$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
smarco commented 2 years ago

Ok, long-shot: I see on your log:

cc -L../lib -I.. wfa_basic.c -o bin/wfa_basic -lwfa -lm

Makes me think whether you are using gcc or another cc. Can you double-check that gcc is being called under cc?

Also, if it complains about the lack the OpenMP libraries, you could always add the -fopenmp to any command line you execute:

cc -L../lib -I.. wfa_basic.c -o bin/wfa_basic -lwfa -lm -fopenmp

In any case, I'm double checking on my side.

XscapeCn commented 2 years ago

ok, I solve this by adding -fopenmp to the command line. I really feel stupid..clearly I have a long way to go. Thank you very much for your help and I will close the issue.

smarco commented 2 years ago

Not at all. It is probably my fault. I will double-check that all the Makefile information is there and try to avoid this error in the future.

Let us know if you have any other problems or questions.

Cheers,