SimSeq icon indicating copy to clipboard operation
SimSeq copied to clipboard

compile error

Open GuangchuangYu opened this issue 11 years ago • 6 comments
trafficstars

I compile the getErrorProfile.c and it throwed the following error:

gcc -I../ThirdParty/kent/inc -I../inc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DMACHTYPE_x86_64 -lm getErrorProfile.o ../ThirdParty/kent/lib/common.o ../ThirdParty/kent/lib/dlist.o ../ThirdParty/kent/lib/bPlusTree.o ../ThirdParty/kent/lib/dystring.o ../ThirdParty/kent/lib/linefile.o ../ThirdParty/kent/lib/nib.o ../ThirdParty/kent/lib/sqlNum.o ../ThirdParty/kent/lib/base64.o ../ThirdParty/kent/lib/dnaLoad.o ../ThirdParty/kent/lib/errabort.o ../ThirdParty/kent/lib/hash.o ../ThirdParty/kent/lib/localmem.o ../ThirdParty/kent/lib/obscure.o ../ThirdParty/kent/lib/twoBit.o ../ThirdParty/kent/lib/bits.o ../ThirdParty/kent/lib/dnaseq.o ../ThirdParty/kent/lib/fa.o ../ThirdParty/kent/lib/https.o ../ThirdParty/kent/lib/mime.o ../ThirdParty/kent/lib/options.o ../ThirdParty/kent/lib/udc.o ../ThirdParty/kent/lib/cheapcgi.o ../ThirdParty/kent/lib/dnautil.o ../lib/fastq.o ../ThirdParty/kent/lib/internet.o ../ThirdParty/kent/lib/net.o ../ThirdParty/kent/lib/pipeline.o ../ThirdParty/kent/lib/verbose.o ../ThirdParty/kent/lib/memalloc.o ../ThirdParty/kent/lib/osunix.o ../ThirdParty/kent/lib/portimpl.o ../ThirdParty/kent/lib/htmshell.o ../ThirdParty/kent/lib/filePath.o ../ThirdParty/kent/lib/log.o ../ThirdParty/kent/lib/servpws.o ../ThirdParty/kent/lib/servmsII.o ../ThirdParty/kent/lib/servCrunx.o ../ThirdParty/kent/lib/servBrcMcw.o ../ThirdParty/kent/lib/wildcmp.o ../ThirdParty/kent/lib/servcis.o ../ThirdParty/kent/lib/intExp.o ../ThirdParty/kent/lib/servcl.o ../ThirdParty/kent/lib/kxTok.o -o getErrorProfile
../lib/fastq.o: In function `doubleToPhred':
fastq.c:(.text+0x642): undefined reference to `log10'
../lib/fastq.o: In function `phredToDouble':
fastq.c:(.text+0x6d5): undefined reference to `pow'
collect2: error: ld returned 1 exit status
make: *** [getErrorProfile] Error 1

I have /usr/include/math.h header file in my system.

GuangchuangYu avatar Sep 10 '14 08:09 GuangchuangYu

what OS/gcc version are you using? I just tried on my mac, and the default gcc which goes to clang does not work, however I have gcc-mp-4.8 installed through macports and that works.

jstjohn avatar Sep 10 '14 16:09 jstjohn

Distributor ID: Ubuntu Description: Ubuntu 14.04 LTS Release: 14.04 Codename: trusty

$ gcc --version gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 Copyright (C) 2013 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.

GuangchuangYu avatar Sep 11 '14 01:09 GuangchuangYu

ygc@SPH:cUtils$ cat test.c 
#include<math.h>
#include<stdio.h>
void main() {
    double x=pow(2.5, 3);
    printf("%f\n%f\n", x, log10(5));
}
ygc@SPH:cUtils$ gcc test.c
ygc@SPH:cUtils$ ./a.out 
15.625000
0.698970

I test the log10 and pow function, it works fine in my system.

GuangchuangYu avatar Sep 11 '14 02:09 GuangchuangYu

Maybe the gcc arguments in the makefile are screwing things up somehow for your system? On Sep 10, 2014, at 7:57 PM, Guangchuang Yu [email protected] wrote:

ygc@SPH:cUtils$ cat test.c #include #include void main() { double x=pow(2.5, 3); printf("%f\n%f\n", x, log10(5)); } ygc@SPH:cUtils$ gcc test.c ygc@SPH:cUtils$ ./a.out 15.625000 0.698970

I test the log10 and pow function, it works fine in my system.

— Reply to this email directly or view it on GitHub.

jstjohn avatar Sep 11 '14 15:09 jstjohn

do you have any hint?

GuangchuangYu avatar Sep 12 '14 03:09 GuangchuangYu

Hi, I ran into the same error, I don't know if you have already solved it.

In your make file you have the following lines:

getErrorProfile: $(ERRORPROFILEO) $(LIBOBJECTS) $(CC) $(COPTS) $(LDFLAGS) $(ERRORPROFILEO) $(LIBOBJECTS) -o $@

faSize: $(LIBOBJECTS) $(FASIZEO) $(CC) $(COPTS) $(LDFLAGS) $(FASIZEO) $(LIBOBJECTS) -o $@

You have to move the $(LDFLAGS) variable just before the -o option. Somehow the linking doesn't work. Hope it solves your problem.

getErrorProfile: $(ERRORPROFILEO) $(LIBOBJECTS) $(CC) $(COPTS) $(ERRORPROFILEO) $(LIBOBJECTS) $(LDFLAGS) -o $@

faSize: $(LIBOBJECTS) $(FASIZEO) $(CC) $(COPTS) $(FASIZEO) $(LIBOBJECTS) $(LDFLAGS) -o $@

jregalad avatar Nov 24 '14 16:11 jregalad