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 

The new-style psptoolchain script.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
PeterM



Joined: 31 Dec 2005
Posts: 125
Location: Edinburgh, UK

PostPosted: Fri Aug 10, 2007 2:49 am    Post subject: Reply with quote

Or allocate from the stack using a char array or alloca(), and align a pointer inside there yourself.
_________________
http://aaiiee.wordpress.com/

I can no longer do any homebrew PSP development nor discuss PSP specific topics.
Back to top
View user's profile Send private message Visit poster's website
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri Aug 10, 2007 4:13 am    Post subject: Reply with quote

the way i use this option in my sources is safe. Using any other trick give me ugly code (source or binary). hey I added the necessary code to handle it, why does it disappear ?

EDIT:

it seems there is some big changes in gcc/config/mips files... :(((
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri Aug 10, 2007 5:53 am    Post subject: Reply with quote

Well, I'm fairly sure we didn't take it out. Talk to GNU about why it is missing.
Back to top
View user's profile Send private message Visit poster's website
Cubeikon



Joined: 01 Aug 2005
Posts: 13

PostPosted: Thu Sep 20, 2007 4:29 am    Post subject: Reply with quote

hey guys,

I've never done anything like this and have no clue of what I'm actually doing right now, so dont be too harsh on me for not being able to figure this out. ;) I followed a (I guess not up to date) guide that told me the components I had to install to have the pspsdk working in the end. I selected the ones that are mentioned in the pspsdk-20070626 readme as well..

I'm under windows, cygwin.

After installing cygwin I wanted to get the sdk up and running, so what I did was try to execute the script 'toolchain.sh'.

Thats what I get:
Quote:
ls: cannot access /usr/lib/libncurses.* No such file or directory
...
...


I double checked that I had ncurses selected in the cygwin installation process and reinstalled it just to make sure.

The only thing that I did NOT do was the following:
Quote:
2) Add the following to your login script:

export PSPDEV=/usr/local/pspdev
export PATH=$PATH:$PSPDEV/bin


I entered those 2 commands before trying to install the script, because I dont really know where else to put them. Where can I find the 'login script'?!

I'd totally appreciate somebody helping me out on this.

cheers,
cube
_________________
...bla ?
Back to top
View user's profile Send private message
Smong



Joined: 04 Sep 2007
Posts: 82

PostPosted: Thu Sep 20, 2007 4:37 am    Post subject: Reply with quote

For the login script go to C:\cygwin\home\<windows username> and look for a file called ".bashrc", just add the commands to the end.

For ncurses I intalled libncurses-devel, libncurses7 and libncurses8 (I'm not sure if you need them all but it can't hurt, my cygwin folder is only 650mb, but you need more like 1gb free space when compiling).
_________________
(+[__]%)
Back to top
View user's profile Send private message
Cubeikon



Joined: 01 Aug 2005
Posts: 13

PostPosted: Thu Sep 20, 2007 5:06 am    Post subject: Reply with quote

Smong wrote:
For the login script go to C:\cygwin\home\<windows username> and look for a file called ".bashrc", just add the commands to the end.

For ncurses I intalled libncurses-devel, libncurses7 and libncurses8 (I'm not sure if you need them all but it can't hurt, my cygwin folder is only 650mb, but you need more like 1gb free space when compiling).


Alright, thanks a lot! After adding those two lines to the login script I get like 20 of these when firing up the Cygwin shell:

Quote:
"bash: $'\r' : command not found"


I'll go ahead and download the other libncurses components you mentionend meanwhile..

edit: Whoow crap! I just put the 2 commands in .bash_profile as well, just to see if it makes any difference. Doing so added another error message

Quote:
/home/chris/.bash_profile: line 41 syntax error: unexpected end of file


I removed it right away and saved the file to what it looked like beforehand. The error is still there though. O.o

thanks again,
cube
_________________
...bla ?
Back to top
View user's profile Send private message
Smong



Joined: 04 Sep 2007
Posts: 82

PostPosted: Thu Sep 20, 2007 5:22 am    Post subject: Reply with quote

The new problem is probably due to line endings. You can either open the files in a compatible editor and choose to save them with "unix line endings" or if you don't want to download anything have a look here:
http://en.wikipedia.org/wiki/Newline#Conversion_utilities
(Sorry this line ending thing did cross my mind in my previous post but I didn't say anything).
_________________
(+[__]%)
Back to top
View user's profile Send private message
Cubeikon



Joined: 01 Aug 2005
Posts: 13

PostPosted: Thu Sep 20, 2007 5:31 am    Post subject: Reply with quote

Smong wrote:
The new problem is probably due to line endings. You can either open the files in a compatible editor and choose to save them with "unix line endings" or if you don't want to download anything have a look here:
http://en.wikipedia.org/wiki/Newline#Conversion_utilities
(Sorry this line ending thing did cross my mind in my previous post but I didn't say anything).


kay, thanks. I tried fixing the .bash_profile using the MS-DOS EDIT method mentioned @wikipedia. Didnt change anything, I still get the error message that theres the unexpected end of the file in line 42. :-/

Thats so weird. I just cut&pasted both .bash_profile & .bashrc to another folder and ran the cygwin installation process again hoping it would recreate both files...I guess its not doing that either.

cheers,
cube
_________________
...bla ?
Back to top
View user's profile Send private message
Smong



Joined: 04 Sep 2007
Posts: 82

PostPosted: Thu Sep 20, 2007 6:12 am    Post subject: Reply with quote

At the top of my .bashrc it helpfully says the default copy can be found in /etc/defaults/etc/skel (C:\cygwin\etc\skel), try copying that over to your home dir, then see if you get any errors when starting the cygwin shell before editing the files. Alternatively as a drastic measure you could reinstall the "base-files" package from setup.exe.
_________________
(+[__]%)
Back to top
View user's profile Send private message
Cubeikon



Joined: 01 Aug 2005
Posts: 13

PostPosted: Thu Sep 20, 2007 6:19 am    Post subject: Reply with quote

Smong wrote:
At the top of my .bashrc it helpfully says the default copy can be found in /etc/defaults/etc/skel (C:\cygwin\etc\skel), try copying that over to your home dir, then see if you get any errors when starting the cygwin shell before editing the files. Alternatively as a drastic measure you could reinstall the "base-files" package from setup.exe.


Awesome! Replacing the .bash_profile and .bashrc that way did work. :)
I added the two commands from the pspsdk readme to .bashrc again, now I'm stuck with this again:

Quote:
"bash: $'\r' : command not found"


http://www.bildrian.de/n/b/b6baa56b242fc0ee.jpg

I'm out of here for today. Its 10:30 over here in Frankfurt, GER and I should not be messing around with this right now if I dont wanna end up being a complete wreck tomorrow. Need the beauty sleep, right. ;)

thanks so much!
cube
_________________
...bla ?
Back to top
View user's profile Send private message
Smong



Joined: 04 Sep 2007
Posts: 82

PostPosted: Thu Sep 20, 2007 6:52 am    Post subject: Reply with quote

When you install cygwin with setup.exe you may need to choose the unix line endings option instead of dos line endings. setup.exe is supposed to cache it's downloads so reinstalling everything shouldn't be too painful... :( I am feeling bad because even though I'm trying to help it seems to be getting worse.
_________________
(+[__]%)
Back to top
View user's profile Send private message
Cubeikon



Joined: 01 Aug 2005
Posts: 13

PostPosted: Thu Sep 20, 2007 7:30 am    Post subject: Reply with quote

Smong wrote:
When you install cygwin with setup.exe you may need to choose the unix line endings option instead of dos line endings. setup.exe is supposed to cache it's downloads so reinstalling everything shouldn't be too painful... :( I am feeling bad because even though I'm trying to help it seems to be getting worse.


Oops, just jumped out of the shower and had a quick look back here. You got me further, didnt you. Wouldve never figured the login script out myself.

Unix / binary is the way I installed it already.

good night, well I guess afternoon for you. ;)
- cube
_________________
...bla ?
Back to top
View user's profile Send private message
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Thu Sep 20, 2007 4:07 pm    Post subject: Reply with quote

Cubeikon: I have had similar problems with line endings too under cygwin, I have just used an alternate shell ("ash ./toolchain.sh") as a workaround.
--------------
Just noting a couple deficiencies when installing the toolchain fresh under linux today (not sure if anyone else has come across these as of yet) - I figured it was my cygwin that was going odd when trying to make psplinkusb, but...

{additional requirement checks?}
To get psplink bit done (currently step 9 failed without them) libusb-dev and G++ were required.

To actually compile psplinkusb from svn, I had to manually copy pspsysclib.h from the downloaded svn files into /usr/local/pspdev/psp/sdk/include (still not sure why, but my cygwin build updated about a month ago does not have this file in the include dir either?)

Great script ooPo!
Back to top
View user's profile Send private message
Cubeikon



Joined: 01 Aug 2005
Posts: 13

PostPosted: Thu Sep 20, 2007 9:30 pm    Post subject: Reply with quote

cory1492 wrote:
Cubeikon: I have had similar problems with line endings too under cygwin, I have just used an alternate shell ("ash ./toolchain.sh") as a workaround.


can you point me in the right direction on this one please? Tried entering "ash ./toolchain.sh", but it says "bash : ash ./toolchain.sh: No such file or directory".

I'd really appreciate it..

cheers,
cube
_________________
...bla ?
Back to top
View user's profile Send private message
e_boris



Joined: 19 May 2007
Posts: 25

PostPosted: Fri Sep 21, 2007 2:53 pm    Post subject: Reply with quote

I'm installing version 20070626

but fails like:
Code:
rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
svn: Unknown hostname 'svn.pspdev.org'
../scripts/003-pspsdk-stage1.sh: Failed.
Back to top
View user's profile Send private message MSN Messenger
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Fri Sep 21, 2007 6:33 pm    Post subject: Reply with quote

It should be svn.ps2dev.org. Several of the other scripts have the same problem. Easily fixed.

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri Sep 21, 2007 9:47 pm    Post subject: Reply with quote

Its actually been fixed for a while. :)
Back to top
View user's profile Send private message Visit poster's website
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Sat Sep 22, 2007 8:04 am    Post subject: Reply with quote

You fixed it in the library building script, but it's still wrong in the toochain script. I've commited a fix :)

Jim
Code:

$ svn di
Index: 003-pspsdk-stage1.sh
===================================================================
--- 003-pspsdk-stage1.sh        (revision 2316)
+++ 003-pspsdk-stage1.sh        (working copy)
@@ -3,7 +3,7 @@

  ## Download the source code.
  if test ! -d "pspsdk"; then
-  svn checkout svn://svn.pspdev.org/psp/trunk/pspsdk || { exit 1; }
+  svn checkout svn://svn.ps2dev.org/psp/trunk/pspsdk || { exit 1; }
  else
   svn update pspsdk || { exit 1; }
  fi
Index: 006-pspsdk-stage2.sh
===================================================================
--- 006-pspsdk-stage2.sh        (revision 2316)
+++ 006-pspsdk-stage2.sh        (working copy)
@@ -3,7 +3,7 @@

  ## Download the source code.
  if test ! -d "pspsdk"; then
-  svn checkout svn://svn.pspdev.org/psp/trunk/pspsdk || { exit 1; }
+  svn checkout svn://svn.ps2dev.org/psp/trunk/pspsdk || { exit 1; }
  else
   svn update pspsdk || { exit 1; }
  fi
Index: 009-psplinkusb.sh
===================================================================
--- 009-psplinkusb.sh   (revision 2316)
+++ 009-psplinkusb.sh   (working copy)
@@ -3,7 +3,7 @@

  ## Download the source code.
  if test ! -d "psplinkusb"; then
-  svn checkout svn://svn.pspdev.org/psp/trunk/psplinkusb || { exit 1; }
+  svn checkout svn://svn.ps2dev.org/psp/trunk/psplinkusb || { exit 1; }
  else
   svn update psplinkusb || { exit 1; }
  fi

_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Sun Sep 23, 2007 4:48 am    Post subject: Reply with quote

Fine then. Mock my failing memory as I age! :)
Back to top
View user's profile Send private message Visit poster's website
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sun Sep 23, 2007 5:02 am    Post subject: Reply with quote

Either URL should work just fine...
Code:

$ svn info svn://svn.pspdev.org/psp/
Path: psp
URL: svn://svn.pspdev.org/psp
Repository Root: svn://svn.pspdev.org/psp
Repository UUID: fd6133d2-eef9-0310-a487-e40d4489b40b
Revision: 2317
Node Kind: directory
Last Changed Author: jimshaw
Last Changed Rev: 2317
Last Changed Date: 2007-09-21 18:02:54 -0400 (Fri, 21 Sep 2007)
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Sun Sep 23, 2007 11:29 am    Post subject: Reply with quote

It works for me too, and obviously for lots of other people else someone would have noticed sooner :)
But e_boris isn't the first person I've seen post that svn.pspdev.org isn't working for them.

On a similar note, today
http://forums.ps2dev.org is working
http://svn.ps2dev.org is working
http://www.ps2dev.org/ isn't working - has been down for about 3 days
That happens periodically. Is this something we know about?

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Sun Sep 23, 2007 4:00 pm    Post subject: Reply with quote

Cubeikon wrote:
can you point me in the right direction on this one please? Tried entering "ash ./toolchain.sh", but it says "bash : ash ./toolchain.sh: No such file or directory".
You need to use the cygwin installer to install ash before you have ash in there. Cygwin puts in bash, but not ash; for whatever reason using ash from bash to run the script has worked for me in the past when bash complained of (as I was told here) line endings. I'm not sure where the problem lies on some cygwin installs, but one of the programs seems to not respect the line ending setting of the installer occasionally.
Back to top
View user's profile Send private message
sl862



Joined: 06 Oct 2007
Posts: 3
Location: China(PRC)

PostPosted: Sun Oct 07, 2007 2:09 am    Post subject: Reply with quote

Cubeikon wrote:
hey guys,

I've never done anything like this and have no clue of what I'm actually doing right now, so dont be too harsh on me for not being able to figure this out. ;) I followed a (I guess not up to date) guide that told me the components I had to install to have the pspsdk working in the end. I selected the ones that are mentioned in the pspsdk-20070626 readme as well..

I'm under windows, cygwin.

After installing cygwin I wanted to get the sdk up and running, so what I did was try to execute the script 'toolchain.sh'.

Thats what I get:
Quote:
ls: cannot access /usr/lib/libncurses.* No such file or directory
...
...


I double checked that I had ncurses selected in the cygwin installation process and reinstalled it just to make sure.

The only thing that I did NOT do was the following:
Quote:
2) Add the following to your login script:

export PSPDEV=/usr/local/pspdev
export PATH=$PATH:$PSPDEV/bin


I entered those 2 commands before trying to install the script, because I dont really know where else to put them. Where can I find the 'login script'?!

I'd totally appreciate somebody helping me out on this.

cheers,
cube


You might forget to select some packages,such as:
libncurses-devel,libncurses7 and libncurese8.
I experienced the same problem as yours,but after selected packages list below every thing goes well.

Please forgive me my poor english, it is not my mother-language.
_________________
了却君王天下事,赢得身前身后名,可怜白发生!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
dalivaktuk



Joined: 04 Oct 2007
Posts: 4

PostPosted: Sun Oct 07, 2007 9:59 am    Post subject: oopo Reply with quote

for some reason I have installed cygwin fine, and wget, but it cannot login as anonymous. Which is why I have to download the files myself and do the scripts by hand.
Back to top
View user's profile Send private message Send e-mail
sl862



Joined: 06 Oct 2007
Posts: 3
Location: China(PRC)

PostPosted: Mon Oct 08, 2007 3:06 am    Post subject: Reply with quote

How long does it takes your computer to compile and install the whole PSP cross-compiler environment(using the psptoolchain)?
My laptop was running approximately 27 hours to complete the task.
(The configuration of my laptop: Acer Aspire 5500Z, 1.8G Centrio ,768MB DDR, Windows XP Home Edition with cygwin installed)
Most of the time it is doing "Checking <something...>"
Can anyone tell me some solutions to make the speed up?

Thanks in advanced,

Swordfish(sl862)
_________________
了却君王天下事,赢得身前身后名,可怜白发生!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Oct 08, 2007 3:44 am    Post subject: Reply with quote

sl862 wrote:
How long does it takes your computer to compile and install the whole PSP cross-compiler environment(using the psptoolchain)?
My laptop was running approximately 27 hours to complete the task.
(The configuration of my laptop: Acer Aspire 5500Z, 1.8G Centrio ,768MB DDR, Windows XP Home Edition with cygwin installed)
Most of the time it is doing "Checking <something...>"
Can anyone tell me some solutions to make the speed up?

Thanks in advanced,

Swordfish(sl862)


HOLY CR@P!! My 1GHz C7 laptop (about the same speed as a 700MHz P3) takes maybe 2 hours to compile the toolchain. My guess is you had a really bad internet connection as the toolchain downloads the files it needs unless those files are already in the directory. The solution is to keep the files needed where it downloaded them the first time so that it doesn't have to download them again.
Back to top
View user's profile Send private message AIM Address
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Mon Oct 08, 2007 9:18 am    Post subject: Reply with quote

Compiling the psptoolchain from scratch takes about 12 minutes on my development machine, a dual-core 2.4Ghz AMD processor with 2GB of ram.

I've found that cygwin takes much much longer, hours even. A 27 hour compile time isn't surprising, especially given that you have only 768MB of ram.
Back to top
View user's profile Send private message Visit poster's website
CpuWhiz



Joined: 04 Jun 2007
Posts: 42

PostPosted: Mon Oct 08, 2007 10:44 am    Post subject: Reply with quote

I don't know if the amount of ram is that big of a difference as I have even less ram then sl862 (512MB) and my compile time is around (if not less) then J.F.'s compile time - up to 2hrs. I have a theory: my Linux system uses available system memory as a disk cache. Linux and Unix systems mostly consist of a lot of small utilities that are chained together to do all the complex tasks. When you compile a application you have a configure script and Makefile that are calling a lot of small programs to do various things ranging from getting the current working directory to modifying text. On a *nix system this is not a issue because of the disk cache - it can just pull the program from memory instead of the hard drive every time it needs to re-run it. Reading it from memory would take a lot less time. These small apps could add up to a big delay.

I notice that when I compile my apps and their dependencies under Windows with MINGW and MSYS that configure scripts and such take a lot longer then on Linux. This could be related, I don't know. I could be totally talking out my ass, this could be minor slowdowns, Windows could have a disk cache too, I could be totally off. I'm taking a stab in the dark. If you want to argue my theory, feel free.

There is one thing you could try. I know my *nix scripts run faster on a native Linux system then on Windows - on the same computer, compiling the same thing. What you could try doing is loading a minimal Linux (like Debian or Ubuntu w/o the GUI) into something like QEMU or VMWare Player 2.0 (you could even connect your PSP directly to the virtual system, though that is a little silly and could be a pain to get working) and do all your compiling from there. Then share out the virtual Linux drive via samba (not the other way as you will mess up your file permissions in Linux) and mount the share inside the host Windows system. This way you still have access to all the files but you are compiling them in a native Linux system. I know visualization can be slower then the real thing, but it might go faster then what you have quoted. I think it's worth a try. Also I wouldn't set the virtual machine to anything over 256mb as you would starve your Windows system (could create swapping problems) and if you just use it for compiling PSP stuff at a console (no GUI), then it shouldn't need more then 256mb much less that much (IMO).
Back to top
View user's profile Send private message
sl862



Joined: 06 Oct 2007
Posts: 3
Location: China(PRC)

PostPosted: Tue Oct 09, 2007 12:10 pm    Post subject: Reply with quote

I have found the reason of long time excuting the toolchain. it is due to the anti-virus software. When i close the anti-virus,the time to excuting the toolchain reduce to about 2 hours. Thank you all the same!
_________________
了却君王天下事,赢得身前身后名,可怜白发生!
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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