relipmoc / skewer

MIT License
95 stars 17 forks source link

Compilation issues #7

Open StuntsPT opened 9 years ago

StuntsPT commented 9 years ago

I'm trying to compile from git on anUbuntu 12.04 machine and failing. Here is what I get after "make":

g++ -c -O2 src/main.cpp -o src/main.o
g++ -c -O2 src/parameter.cpp -o src/parameter.o
src/parameter.cpp: In member function ‘int cParameter::GetOpt(int, char**, char*)’:
src/parameter.cpp:855:53: warning: format not a string literal and no format arguments [-Wformat-security]
g++ -c -O2 src/matrix.cpp -o src/matrix.o
g++ -c -O2 src/fastq.cpp -o src/fastq.o
src/fastq.cpp: In function ‘int64 gzsize(const char*)’:
src/fastq.cpp:211:27: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
g++ -pthread -lrt src/main.o src/parameter.o src/matrix.o src/fastq.o -o skewer
src/main.o: In function `main':
main.cpp:(.text.startup+0x2e3): undefined reference to `clock_gettime'
main.cpp:(.text.startup+0x563): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make: *** [skewer] Error 1

On an ubuntu 14.04 machine I am getting this (but I do get a binary):

g++ -c -O2 src/main.cpp -o src/main.o
g++ -c -O2 src/parameter.cpp -o src/parameter.o
src/parameter.cpp: In member function ‘int cParameter::GetOpt(int, char**, char*)’:
src/parameter.cpp:855:53: warning: format not a string literal and no format arguments [-Wformat-security]
    sprintf(trimmed + (end - basename) + 1, pDecorate);
                                                     ^
g++ -c -O2 src/matrix.cpp -o src/matrix.o
g++ -c -O2 src/fastq.cpp -o src/fastq.o
src/fastq.cpp: In function ‘int64 gzsize(const char*)’:
src/fastq.cpp:211:27: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
    fread(buffer, 1, 4, fp);
                           ^
g++ -pthread -lrt src/main.o src/parameter.o src/matrix.o src/fastq.o -o skewer

On my Archlinux machine, fully up-to-date I get no errors and a working binary:

g++ -c -O2 src/main.cpp -o src/main.o
g++ -c -O2 src/parameter.cpp -o src/parameter.o
g++ -c -O2 src/matrix.cpp -o src/matrix.o
g++ -c -O2 src/fastq.cpp -o src/fastq.o
g++ -pthread -lrt src/main.o src/parameter.o src/matrix.o src/fastq.o -o skewer

Could this be an issue with older versions of GCC? Thanks.

wltrimbl commented 9 years ago

the sprintf error above looks like it was fixed with c61bb90eeb558d

StuntsPT commented 9 years ago

I'm still getting an error on Ubuntu 12.04:

g++ -c -O2 src/main.cpp -o src/main.o
g++ -c -O2 src/parameter.cpp -o src/parameter.o
g++ -c -O2 src/matrix.cpp -o src/matrix.o
g++ -c -O2 src/fastq.cpp -o src/fastq.o
src/fastq.cpp: In function ‘int64 gzsize(const char*)’:
src/fastq.cpp:211:27: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
g++ -pthread -lrt src/main.o src/parameter.o src/matrix.o src/fastq.o -o skewer
src/fastq.o: In function `versatile_gettime(timespec*)':
fastq.cpp:(.text+0xaf9): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make: *** [skewer] Error 1

This did not solve it...

But at least it's throwing one less error on Ubuntu 14.04

g++ -c -O2 src/main.cpp -o src/main.o
g++ -c -O2 src/parameter.cpp -o src/parameter.o
g++ -c -O2 src/matrix.cpp -o src/matrix.o
g++ -c -O2 src/fastq.cpp -o src/fastq.o
src/fastq.cpp: In function ‘int64 gzsize(const char*)’:
src/fastq.cpp:211:27: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
    fread(buffer, 1, 4, fp);
                           ^
g++ -pthread -lrt src/main.o src/parameter.o src/matrix.o src/fastq.o -o skewer

So I suppose it's moving in the right direction...