IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 2 replies
  • Latest Post - ‏2011-02-12T09:13:25Z by JaeHyukKwak
JaeHyukKwak
JaeHyukKwak
2 Posts

Pinned topic spu-gdb says dont know how to run. Try help target

‏2011-02-11T08:13:27Z |
Hi all.

I just installed YellowDog and CellSDK-Devel-Fedora-3.1.0.0.0.

I made a very simple C program starting with "main" function.
The code is from a book, "Programming the cell processor", page 57.

I ran it by this command-line.
wrice127@localhost mycell$ spu-gdb spu_sieve -q
(gdb) break main
Breakpoint 1 at 0x178: file spu_sleve.c, line 9.
(gdb) run
Starting program: /home/wrice127/mycell/spu_sieve
Don't know how to run. Try "help target".
(gdb)
I have no idea what to do about "target".
If I run it, it seems to work...
wrice127@localhost mycell$ ls -l
-rwxrwxr-x 1 wrice127 wrice127 284571 2월 11 01:07 spu_sieve
-rw-rw-r-- 1 wrice127 wrice127 398 2월 11 01:06 spu_sieve.c
wrice127@localhost mycell$ ./spu_sieve
Prime numbers less than 250: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241

Here is the source code:
wrice127@localhost mycell$ cat spu_sieve.c
#include <stdio.h>

#define N 250

int main()
{
int i,j;
unsigned int num_array N + 1 ;
num_array[0] = num_array[1] = 1;

for( i = 2; i*i <= N; i++)
{
if( num_array[i] == 0 )
{
for( j=i*i; j <= N; j+= i )
num_array[j] = 1;
}
}

printf("Prime numbers less than %u: ", N );
for( i=2; i<=N; i++)
{
if(num_array[i] != 1 )
printf("%u ", i );
}
printf("\n");

return 0;
}
Thanks for answers in advance.

-Jay
Updated on 2011-02-12T09:13:25Z at 2011-02-12T09:13:25Z by JaeHyukKwak
  • jadamcze
    jadamcze
    219 Posts

    Re: spu-gdb says dont know how to run. Try help target

    ‏2011-02-11T10:47:04Z  
    iirc, you should be using plain gdb - it has support for SPU programs.
  • JaeHyukKwak
    JaeHyukKwak
    2 Posts

    Re: spu-gdb says dont know how to run. Try help target

    ‏2011-02-12T09:13:25Z  
    • jadamcze
    • ‏2011-02-11T10:47:04Z
    iirc, you should be using plain gdb - it has support for SPU programs.
    Thanks!! I will try just gdb.

    *PS: BTW, I am using PS3...