Hello Nilay, Thank you very much for your response. Please see this? Here is another program but same message. Those program from benchmarks2 that means multiprogram. What is happening here? back trace is below: cubic.c lmssim.txt duff loop3 hise@ubuntu:~/Work$ arm-linux-gnueabi-gcc cubic.c -o cubic -static /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/lib/../lib/crt1.o: In function `_start': (.text+0x30): undefined reference to `main' /tmp/ccFsS665.o: In function `SolveCubic': cubic.c:(.text+0x126): undefined reference to `sqrt' cubic.c:(.text+0x13a): undefined reference to `acos' cubic.c:(.text+0x146): undefined reference to `sqrt' cubic.c:(.text+0x166): undefined reference to `cos' cubic.c:(.text+0x192): undefined reference to `sqrt' cubic.c:(.text+0x1ba): undefined reference to `cos' cubic.c:(.text+0x1e4): undefined reference to `sqrt' cubic.c:(.text+0x20c): undefined reference to `cos' cubic.c:(.text+0x23a): undefined reference to `sqrt' cubic.c:(.text+0x258): undefined reference to `pow' collect2: ld returned 1 exit status hise@ubuntu:~/Work$ Program code: /* +++Date last modified: 05-Jul-1997 */ /* ** CUBIC.C - Solve a cubic polynomial ** public domain by Ross Cottrell */ #include <math.h> #include <stdlib.h> #include "snipmath.h" void SolveCubic(double a, double b, double c, double d, int *solutions, double *x) { long double a1 = b/a, a2 = c/a, a3 = d/a; long double Q = (a1*a1 - 3.0*a2)/9.0; long double R = (2.0*a1*a1*a1 - 9.0*a1*a2 + 27.0*a3)/54.0; double R2_Q3 = R*R - Q*Q*Q; double theta; if (R2_Q3 <= 0) { *solutions = 3; theta = acos(R/sqrt(Q*Q*Q)); x[0] = -2.0*sqrt(Q)*cos(theta/3.0) - a1/3.0; x[1] = -2.0*sqrt(Q)*cos((theta+2.0*PI)/3.0) - a1/3.0; x[2] = -2.0*sqrt(Q)*cos((theta+4.0*PI)/3.0) - a1/3.0; } else { *solutions = 1; x[0] = pow(sqrt(R2_Q3)+fabs(R), 1/3.0); x[0] += Q/x[0]; x[0] *= (R < 0.0) ? 1 : -1; x[0] -= a1/3.0; } } #ifdef TEST int main(void) { double a1 = 1.0, b1 = -10.5, c1 = 32.0, d1 = -30.0; double a2 = 1.0, b2 = -4.5, c2 = 17.0, d2 = -30.0; double x[3]; int solutions; SolveCubic(a1, b1, c1, d1, &solutions, x); /* should get 3 solutions: 2, 6 & 2.5 */ SolveCubic(a2, b2, c2, d2, &solutions, x); /* should get 1 solution: 2.5 */ return 0; } #endif /* TEST */ with best regards ------ Musharaf --- On Wed, 10/3/12, Nilay Vaish <ni...@cs.wisc.edu> wrote: From: Nilay Vaish <ni...@cs.wisc.edu> Subject: Re: [gem5-users] Did not run benchmark on gem5 To: "Musharaf Hussain" <ssmushara...@yahoo.com> Cc: gem5-users@gem5.org Date: Wednesday, October 3, 2012, 8:06 AM On Wed, 3 Oct 2012, Musharaf Hussain wrote: > Hi All, > I want to run the benchmark program on gem5. But got the below messages. Can > anyone help me here. > > hise@ubuntu:~/Work$ arm-linux-gnueabi-gcc rad2deg.c -o rad2deg -static > /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/lib/../lib/crt1.o: > In function `_start': > (.text+0x30): undefined reference to `main' > collect2: ld returned 1 exit status > Do you have a main function in the program rad2deg.c? -- Nilay
_______________________________________________ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users