smarco/BiWFA-paper

Make error

Closed this issue · 9 comments

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!

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

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

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

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

I would need to compiler version.

$> gcc --version

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.

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.

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.

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,