ruanjue / smartdenovo

Ultra-fast de novo assembler using long noisy reads
GNU General Public License v3.0
127 stars 29 forks source link

Compiation failed on "undefined reference to `cut_biedge_strgraph2'" #22

Closed yoann-dufresne closed 5 years ago

yoann-dufresne commented 5 years ago

Hi,

I just tried to download and compile smartdenovo using your command lines:

git clone https://github.com/ruanjue/smartdenovo.git  
cd smartdenovo  
make  

but the compilation endend on:

/tmp/ccBHOwYi.o: In function `merge_bubbles_strgraph':
wtlay.c:(.text+0x984d): undefined reference to `cut_biedge_strgraph2'
wtlay.c:(.text+0x9861): undefined reference to `cut_biedge_strgraph2'
wtlay.c:(.text+0x992d): undefined reference to `cut_biedge_strgraph2'
wtlay.c:(.text+0x994a): undefined reference to `cut_biedge_strgraph2'
collect2: error: ld returned 1 exit status
Makefile:48: recipe for target 'wtlay' failed
make: *** [wtlay] Error 1
make: *** Waiting for unfinished jobs....

Do you have any idea of what could resolve this issue ?
(I am running on an ubuntu 18.04 up to date)

Yo

ruanjue commented 5 years ago

https://github.com/ruanjue/smartdenovo/blob/5cc1356bffb87197b0fb9b835cfe1adc5a764dc6/wtlay.h#L516 Have a try to remove the word inline. Or try to add static ahead.

yoann-dufresne commented 5 years ago

It works with this modification.

But I don't understand why this code doesn't work with the inline keyword...

ruanjue commented 5 years ago

I have no idea, maybe compilers diffs.

yoann-dufresne commented 5 years ago

I just found that: https://stackoverflow.com/questions/19068705/undefined-reference-when-calling-inline-function

Do you have a significant time improvement with this inlined function ?
Maybe you should consider to change the inline to static for all users ?

Thanks for the solution Yo

ruanjue commented 5 years ago

Thanks Yo, I used static inline, but user reported floods of compile errors. Then I changed to inline.

Best, Jue

WhaleKlng commented 3 years ago

I tried, and I did add static!