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

compile error #9

Open
GuangchuangYu opened this issue Sep 10, 2014 · 6 comments
Open

compile error #9

GuangchuangYu opened this issue Sep 10, 2014 · 6 comments

Comments

@GuangchuangYu
Copy link

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.

@jstjohn
Copy link
Owner

jstjohn commented Sep 10, 2014

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.

@GuangchuangYu
Copy link
Author

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
Copy link
Author

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.

@jstjohn
Copy link
Owner

jstjohn commented Sep 11, 2014

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.

@GuangchuangYu
Copy link
Author

do you have any hint?

@jregalad
Copy link

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 $@

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

3 participants