forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SPU compilation stand-alone program troubles

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Linux Development
View previous topic :: View next topic  
Author Message
exbutterfly



Joined: 12 May 2008
Posts: 3

PostPosted: Mon May 12, 2008 10:52 pm    Post subject: SPU compilation stand-alone program troubles Reply with quote

Hi,

I have some troubles in order to compile a simple stand-alone program for SPU.
I work on Yellow Dog Linux YDL 6.0 for PS3. All compilators are installed and updated.

This is the code of the "Hello World" program I would to test if the installation is complete :
Code:
#include <stdio.h>

int main()
{
    printf("Hello World !");
    return 0;
}


I type in the command-line : spu-gcc -o test test.c

And I have the following message :
Quote:
/usr/lib/gcc/spu/4.1.1/../../../../spu/bin/ld: skipping incompatible /usr/lib/gcc/spu/4.1.1/../../../../spu/lib/libc.a when searching for -lc
/usr/lib/gcc/spu/4.1.1/../../../../spu/bin/ld: skipping incompatible /usr/spu/bin/../lib/libc.a when searching for -lc
/usr/lib/gcc/spu/4.1.1/../../../../spu/bin/ld: skipping incompatible /usr/spu/lib/libc.a when searching for -lc
/usr/lib/gcc/spu/4.1.1/../../../../spu/bin/ld: cannot find -lc
collect2: ld returned 1 exit status


Any suggestions ?

Thanks for your help
Back to top
View user's profile Send private message
Radamantis



Joined: 14 Apr 2008
Posts: 4
Location: Caserta - Italy

PostPosted: Tue May 13, 2008 8:24 am    Post subject: Reply with quote

Hi exbutterfly...

Looking at the source everything seems fine... maybe it's a problem with environment variables...
_________________
Radamantis, the greatest caution
Back to top
View user's profile Send private message Visit poster's website
exbutterfly



Joined: 12 May 2008
Posts: 3

PostPosted: Tue May 13, 2008 11:48 am    Post subject: Reply with quote

Hi Radamantis.

Thanks for your answer.

Can you tell me the normal minimal content of environment variables LD_LIBRARY_PATH or others variables implied in the linking.

Maybe, it is an error in the config file of ld ?
Back to top
View user's profile Send private message
Radamantis



Joined: 14 Apr 2008
Posts: 4
Location: Caserta - Italy

PostPosted: Tue May 13, 2008 6:02 pm    Post subject: Reply with quote

Have you included in your $PATH the directory /opt/cell/sdk/usr/include ?
_________________
Radamantis, the greatest caution
Back to top
View user's profile Send private message Visit poster's website
exbutterfly



Joined: 12 May 2008
Posts: 3

PostPosted: Tue May 13, 2008 8:36 pm    Post subject: Reply with quote

I think i found the origin of the problem. But I have no solution.

In the installation of the RPM package elfspe with yum, an error had occured :
Code:
/usr/bin/elfspe-register: line 6: /proc/sys/fs/binfmt_misc/register: No such file or directory
error: %post(elfspe2-2.2.0-91.ppc) scriptlet failed, exit status 1


It makes sense that this error disturbe the linking.

If someone have any suggestions
Back to top
View user's profile Send private message
_Razorblade_



Joined: 14 May 2008
Posts: 1

PostPosted: Wed May 14, 2008 6:54 am    Post subject: Reply with quote

I don't know why elspe2 requires this, but if "/proc/sys/binfmt_misc/register" is the problem, then it's your kernel not supporting "Misc" exec format (as in "Executable file formats -> Kernel support for MISC binaries").

Do you use a stock kernel from YDL or a self-compiled one?
Back to top
View user's profile Send private message
leonhong



Joined: 09 Jan 2008
Posts: 10

PostPosted: Wed Jun 18, 2008 5:14 pm    Post subject: Re: SPU compilation stand-alone program troubles Reply with quote

Dear exbutterfly:

According to the IBM guidelines, all spe programs must be spawned by ppe kernel threads. Many preparations (locate spe, loading text and data to LS, start execution, arrange communications, stop execution, etc) should be done before you can use the spe. If you are trying to code stand-alone spu programs, maybe you can try CTK projects.

Best regards
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Linux Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group