The new-style psptoolchain script.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

PeterM
Posts: 125
Joined: Sat Dec 31, 2005 7:25 pm
Location: Edinburgh, UK
Contact:

Post by PeterM »

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.
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

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... :(((
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Well, I'm fairly sure we didn't take it out. Talk to GNU about why it is missing.
User avatar
Cubeikon
Posts: 13
Joined: Mon Aug 01, 2005 6:39 am

Post by Cubeikon »

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:
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:
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 ?
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

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).
(+[__]%)
User avatar
Cubeikon
Posts: 13
Joined: Mon Aug 01, 2005 6:39 am

Post by Cubeikon »

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:
"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
/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 ?
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

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#Co ... _utilities
(Sorry this line ending thing did cross my mind in my previous post but I didn't say anything).
(+[__]%)
User avatar
Cubeikon
Posts: 13
Joined: Mon Aug 01, 2005 6:39 am

Post by Cubeikon »

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#Co ... _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 ?
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

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.
(+[__]%)
User avatar
Cubeikon
Posts: 13
Joined: Mon Aug 01, 2005 6:39 am

Post by Cubeikon »

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:
"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 ?
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

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.
(+[__]%)
User avatar
Cubeikon
Posts: 13
Joined: Mon Aug 01, 2005 6:39 am

Post by Cubeikon »

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 ?
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

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!
User avatar
Cubeikon
Posts: 13
Joined: Mon Aug 01, 2005 6:39 am

Post by Cubeikon »

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 ?
e_boris
Posts: 25
Joined: Sat May 19, 2007 2:45 pm

Post by e_boris »

I'm installing version 20070626

but fails like:

Code: Select all

rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
svn&#58; Unknown hostname 'svn.pspdev.org'
../scripts/003-pspsdk-stage1.sh&#58; Failed.
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

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

Jim
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Its actually been fixed for a while. :)
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

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

Jim

Code: Select all

$ svn di
Index&#58; 003-pspsdk-stage1.sh
===================================================================
--- 003-pspsdk-stage1.sh        &#40;revision 2316&#41;
+++ 003-pspsdk-stage1.sh        &#40;working copy&#41;
@@ -3,7 +3,7 @@

  ## Download the source code.
  if test ! -d "pspsdk"; then
-  svn checkout svn&#58;//svn.pspdev.org/psp/trunk/pspsdk || &#123; exit 1; &#125;
+  svn checkout svn&#58;//svn.ps2dev.org/psp/trunk/pspsdk || &#123; exit 1; &#125;
  else
   svn update pspsdk || &#123; exit 1; &#125;
  fi
Index&#58; 006-pspsdk-stage2.sh
===================================================================
--- 006-pspsdk-stage2.sh        &#40;revision 2316&#41;
+++ 006-pspsdk-stage2.sh        &#40;working copy&#41;
@@ -3,7 +3,7 @@

  ## Download the source code.
  if test ! -d "pspsdk"; then
-  svn checkout svn&#58;//svn.pspdev.org/psp/trunk/pspsdk || &#123; exit 1; &#125;
+  svn checkout svn&#58;//svn.ps2dev.org/psp/trunk/pspsdk || &#123; exit 1; &#125;
  else
   svn update pspsdk || &#123; exit 1; &#125;
  fi
Index&#58; 009-psplinkusb.sh
===================================================================
--- 009-psplinkusb.sh   &#40;revision 2316&#41;
+++ 009-psplinkusb.sh   &#40;working copy&#41;
@@ -3,7 +3,7 @@

  ## Download the source code.
  if test ! -d "psplinkusb"; then
-  svn checkout svn&#58;//svn.pspdev.org/psp/trunk/psplinkusb || &#123; exit 1; &#125;
+  svn checkout svn&#58;//svn.ps2dev.org/psp/trunk/psplinkusb || &#123; exit 1; &#125;
  else
   svn update psplinkusb || &#123; exit 1; &#125;
  fi
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Fine then. Mock my failing memory as I age! :)
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Either URL should work just fine...

Code: Select all

$ svn info svn&#58;//svn.pspdev.org/psp/
Path&#58; psp
URL&#58; svn&#58;//svn.pspdev.org/psp
Repository Root&#58; svn&#58;//svn.pspdev.org/psp
Repository UUID&#58; fd6133d2-eef9-0310-a487-e40d4489b40b
Revision&#58; 2317
Node Kind&#58; directory
Last Changed Author&#58; jimshaw
Last Changed Rev&#58; 2317
Last Changed Date&#58; 2007-09-21 18&#58;02&#58;54 -0400 &#40;Fri, 21 Sep 2007&#41;
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

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
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

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.
sl862
Posts: 3
Joined: Sat Oct 06, 2007 10:53 pm
Location: China(PRC)

Post by sl862 »

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:
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:
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.
&#20102;&#21364;&#21531;&#29579;&#22825;&#19979;&#20107;&#65292;&#36194;&#24471;&#36523;&#21069;&#36523;&#21518;&#21517;&#65292;&#21487;&#24604;&#30333;&#21457;&#29983;&#65281;
dalivaktuk
Posts: 4
Joined: Thu Oct 04, 2007 12:59 pm

oopo

Post by dalivaktuk »

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.
sl862
Posts: 3
Joined: Sat Oct 06, 2007 10:53 pm
Location: China(PRC)

Post by sl862 »

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)
&#20102;&#21364;&#21531;&#29579;&#22825;&#19979;&#20107;&#65292;&#36194;&#24471;&#36523;&#21069;&#36523;&#21518;&#21517;&#65292;&#21487;&#24604;&#30333;&#21457;&#29983;&#65281;
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

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.
CpuWhiz
Posts: 42
Joined: Mon Jun 04, 2007 1:30 am

Post by CpuWhiz »

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).
sl862
Posts: 3
Joined: Sat Oct 06, 2007 10:53 pm
Location: China(PRC)

Post by sl862 »

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!
&#20102;&#21364;&#21531;&#29579;&#22825;&#19979;&#20107;&#65292;&#36194;&#24471;&#36523;&#21069;&#36523;&#21518;&#21517;&#65292;&#21487;&#24604;&#30333;&#21457;&#29983;&#65281;
Post Reply