Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building can't find zlib and math functions on newer Ubuntu #15

Open
feltstykket opened this issue Apr 4, 2014 · 3 comments
Open

Building can't find zlib and math functions on newer Ubuntu #15

feltstykket opened this issue Apr 4, 2014 · 3 comments

Comments

@feltstykket
Copy link

Will send a PR

@emmaggie
Copy link

It does not seem like this issue was addressed yet. The build fails on Ubuntu Trusty (14.04.1-Ubuntu). This seems to be related to the issues reported by @feltstykket.
Error thrown (end):

In file included from src/util.c:8:0:
/usr/include/stdio.h:356:12: note: expected ‘struct FILE * restrict’ but argument is of type ‘gzFile’
 extern int fprintf (FILE *__restrict __stream,
            ^
gcc -Wall -pedantic -DVERSION=0.981 -std=gnu99 -c src/prob.c
gcc -Wall -pedantic -DVERSION=0.981 -std=gnu99 -lz -lm match.o scythe.o util.o prob.o -o scythe
scythe.o: In function `ks_getc':
scythe.c:(.text+0x18c): undefined reference to `gzread'
scythe.o: In function `ks_getuntil':
scythe.c:(.text+0x284): undefined reference to `gzread'
scythe.o: In function `main':
scythe.c:(.text+0xc54): undefined reference to `gzopen'
scythe.c:(.text+0xfaf): undefined reference to `gzclose'
scythe.c:(.text+0xfd6): undefined reference to `gzopen'
scythe.c:(.text+0x1490): undefined reference to `gzclose'
util.o: In function `ks_getc':
util.c:(.text+0x18c): undefined reference to `gzread'
util.o: In function `ks_getuntil':
util.c:(.text+0x284): undefined reference to `gzread'
prob.o: In function `qual_to_probs':
prob.c:(.text+0x115): undefined reference to `powf'
prob.c:(.text+0x183): undefined reference to `powf'
collect2: error: ld returned 1 exit status
make: *** [build] Error 1

Has this been addressed? Is there a solution somewhere?

@vsbuffalo
Copy link
Owner

Hi @emmaggie — the issue appears to be in linking zlib. Have other applications that need zlib compiled alright on your system? For example, can you compile https://github.com/lh3/seqtk?

We had a similar issue a while ago, but we solved it by moving the order of $(LDFLAGS) in the gcc call, and that should have fixed it.

@Omig12
Copy link

Omig12 commented Feb 25, 2016

Had the same issue while building sickle in Ubuntu 15.10 machine. Solved it the same way as @vsbuffalo.

In Makefile's build function:

Switch:

build: sliding.o trim_single.o trim_paired.o sickle.o print_record.o
    $(CC) $(CFLAGS) $(LDFLAGS) $(OPT) $? -o sickle $(LIBS)

To:

build: sliding.o trim_single.o trim_paired.o sickle.o print_record.o
    $(CC) $(CFLAGS) $(OPT) $? -o sickle $(LIBS) $(LDFLAGS)

Notice the order of the $(LDFLAGS) argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants