Tutorial: How to setup a ps2dev env in cygwin

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Sandman
Posts: 1
Joined: Sun Jul 10, 2005 1:02 am
Location: Chicago

login to cygwin

Post by Sandman »

how do i login to cygwin?
First MOD recently completed, dms4pro. had to go back in 3 times to clean up solder and pinched wires but its up and running. now i'm learning to do more than play backups.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

cory1492 wrote:
Thanhda wrote:
cory1492 wrote:Here is a small script based on ooPos script that will update&reinstall the PS2SDK to whatever is currently in the cvs, of course you need cvs and make installed in cygwin to use this script.

ps2sdkupdate.sh
just download it, put it in your cygwin dir and run it with "sh ps2sdkupdate.sh"
says error building, do i need to install the ps2dev sdk first into the home/ dir?
You need the ee/iop toolchain installed and the paths setup to them properly to have access to ee-gcc and iop-gcc or the SDK will not build. If you already do have such done, then let me know the specific error and I will see if I can figure out why its happening (although ooPo and Pixel are MUCH better at that sort of thing than I am)

lukasz has prebuilt binaries of the toolchain and on a new install with his it wasn't always the most recent release of the SDK - BUT he has since incorporated this idea, so see his website for his toolchain/sdk builder.

I use it to refresh/rebuild my SDK, cleaning up all the garbage first so everything is new (except the ports)

compound: if you are using cygwin you can also set cygwin only environment vars in your homedir's .bashrc or in /etc/bash.bashrc instead of cluttering you path in windows.

this is what the inside of my bash.bashrc file under cygwin looked like before I moved on to debian:

Code: Select all

# base-files version 3.2-1

# System-wide .bashrc file
## ps2dev env vars
export PS2DEV=/usr/local/ps2dev
export PS2SDK=$PS2DEV/ps2sdk
export PATH=$PATH:$PS2DEV/bin:$PS2DEV/ee/bin:$PS2DEV/iop/bin:$PS2DEV/dvp/bin:$PS2SDK/bin
That's great, thanks. Doing this for the PSP path settings solved a lot of my problems (y)
taz030485
Posts: 27
Joined: Thu May 27, 2004 3:37 pm

Post by taz030485 »

I just tried installing the toolchain and have a problem.

Install Cygwin = done.
Copy toolchain from svn = done.
chmod toolchain.sh = done.
download binutils, gcc, newlib = done.
build binutils = done.
build gcc = not done.

this is what is output on the screen

Code: Select all

make[2]: Entering directory `/tmp/ps2dev/gcc-3.2.2/build-ee/gcc/fixinc'
/bin/sh ../../../gcc/fixinc/genfixes machname.h
-uThe system cannot find the file specified.
make[2]: *** [machname.h] Error 1
make[2]: Leaving directory `/tmp/ps2dev/gcc-3.2.2/build-ee/gcc/fixinc'
make[1]: *** [fixinc.sh] Error 2
make[1]: Leaving directory `/tmp/ps2dev/gcc-3.2.2/build-ee/gcc'
make: *** [all-gcc] Error 2
ERROR BUILDING GCC (gcc-3.2.2 ee)
I have copied everything from the cygwin window if more info is needed.
EP
Posts: 39
Joined: Sat Nov 05, 2005 1:14 pm

Post by EP »

taz030485, this is the exact issue I'm having. I tried changing gcc versions for cygwin but had no luck.

A google search for "make[2]: *** [machname.h] Error 1" shows that this error is quite prevalent with gcc and other projects.
taz030485
Posts: 27
Joined: Thu May 27, 2004 3:37 pm

Post by taz030485 »

EP wrote:taz030485, this is the exact issue I'm having. I tried changing gcc versions for cygwin but had no luck.

A google search for "make[2]: *** [machname.h] Error 1" shows that this error is quite prevalent with gcc and other projects.
I don't think u can change the version as the patches are for 3.2.2.

Anyone out there know a solution?

Also are the binutils IOP and GCC IOP patches ment to be used? I can't see them anywhere in toolchain.sh, plus the versions in the name of it IOP patches are different, which aren't downloaded either.
EP
Posts: 39
Joined: Sat Nov 05, 2005 1:14 pm

Post by EP »

taz030485 wrote:I don't think u can change the version as the patches are for 3.2.2.
I had tried both cygwin packages for gcc: gcc-core-3.3.3-3 and gcc-core-3.4.4-1

Then I just stuck with "gcc version 3.3.3 (cygwin special)" and gave up trying to build the toolchain under Windows XP.

Edit:
According to a comment in fixlib.c "machname.h is created by black magic in the Makefile." Well I take it the magic isn't working hence the "-uThe system cannot find the file specified."
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

http://cygwin.lukasz.dk/cygwin-toolchain.sh is down :(
*when im installing cyg and i need to download svn gcc make wget
a) it stops at 17% or 21% left it for an hour and it times out
b)there is no svn in the extras download, either that or its not under prev or current
il even post a screen shot to prove it aint there
anyone any ideas or help?
User avatar
Orfax
Posts: 21
Joined: Thu Apr 08, 2004 3:41 pm
Location: Adelaide, Australia
Contact:

Post by Orfax »

Try using the one in the svn repository.

svn checkout svn://svn.ps2dev.org/ps2/trunk/ps2toolchain

and then run toolchain.sh

I tried cygwin-toolchain.sh as well but it didn't work for me (failed somewhere in the build process).


Not sure about cygwin, try it again, but with a different server. I use a local one and have never had problems. It may be the server you chose has gone down.

As for svn, select the subversion package in setup. Press the view button until it goes to "full" and scroll down to subversion.

There is also a windows svn "client" you could use. Google for tortoisesvn.
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

ok thanks ive downloaded everything you said apart from the toolchain into a folder on my desktop called cygwin(its not the actual cyg dir), what do i do next?
User avatar
Orfax
Posts: 21
Joined: Thu Apr 08, 2004 3:41 pm
Location: Adelaide, Australia
Contact:

Post by Orfax »

JorDy wrote:ok thanks ive downloaded everything you said apart from the toolchain into a folder on my desktop called cygwin(its not the actual cyg dir), what do i do next?
Cygwin setup gives you the option to download without installing (this is what you have probably done) or to install from either the internet or a folder on your PC. Start setup again and choose to install from your PC. Choose the folder where you put your downloaded and files and the folder you want cygwin to go to. Also make sure you select text file type to be binary. You may need to select your packages again, but the only ones available are the ones you selected before. And let it install. It should put an icon on your desktop. Double click that and you'll get a prompt. From there it should be like any Unix command line interface.
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

everything installed automaticly, but when i try to run the toolchain.sh it says:
gmake command not found line 68
patch not found line 80

but i cannot find gmake anywhere! ive tried GNUmake and not found it and whats the patch?
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

Please see the tutorial linked from in the first post in this thread, the cygwin script is no longer support by me
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

yes i know i have been following your one one the link, but i still need gmake(GNUmake)to get the file to build and i need to know what the 'patch' is on line 80
taz030485
Posts: 27
Joined: Thu May 27, 2004 3:37 pm

Post by taz030485 »

If you have 'make' installed you don't need 'gmake', and since it is asking for 'patch' I'd say u have 'make' or it wouldn't get past it.

'patch' is another one of the cygwin programs you need, re-run the cygwin download/installer, make sure you choose the same mirror you did the first time. In the top corner of the list of programs press the view button till it say 'full' beside it. Now scroll down the list and find the package called 'patch'. While in the list make sure you have 'wget' and 'svn' (look for subversion).
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

i got it installing the toolchain but i didnt have gmake
ive done
which gmake and it says not found but ive got make.

anyway it installed most things but said no and some directories wernt there! but as it ened it said
"ERROR BUILDING BINUTILS <binutils-2.14 ee>
is this a problem? i suspect it is
and for some odd reason in stead of setting up the directory in usr/ps2dev it set it up in tmp/ps2dev

**i took some screen shots of some of the compiling areas if anyone wants to check to see if theres anythink worng id be very greatfull
http://www.megaupload.com/?d=165PWCOI
User avatar
Orfax
Posts: 21
Joined: Thu Apr 08, 2004 3:41 pm
Location: Adelaide, Australia
Contact:

Post by Orfax »

JorDy,

It looks like you don't have all the ps2toolchain files. In particular you are missing the .patch files. Did you run the svn command I gave above. If you did it should have created a ps2toolchain directory with all the files you need to build. Run the ps2toolchain.sh script from that directory.

Interestingly the ps2toolchain.sh script is supposed to exit if it has a problem patching, but in your case it didn't. It looks like patch returns 0 if there is no input (ie no file). The script probably should be fixed to account for it. I would do it, but I'm still waiting to get write access to svn.

BTW don't worry about the /tmp/ps2dev stuff. Thats just a working directory where the various parts build. It will get cleaned up later. All your builds will get installed into /usr/local/ps2dev.

Also rather than taking screen shots of it building, redirect output to a file instead. It would have been smaller to upload that, and given better information.

Orfax
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

i couldnt get all the out put in at once i couldnt see it all (not on screen) but when you scrolled up it only went soo far.
i ran the svn link you gave me but it said that there was no such dir or file
xynuerz
Posts: 1
Joined: Sun Feb 19, 2006 11:15 pm

Post by xynuerz »

i have some problem on the toolchain, wen i start toolchain.sh it beginn to compile and path all thinks but after a time it crash an says that the gcc have an error.

if there any other way without mingw or cygwin to make it unter a debian or other linux distri.

i have the mandrake 10 but i dont know it will be work for the ps2sdk.

sorry for my bad english.
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

xynuerz wrote:i have some problem on the toolchain, wen i start toolchain.sh it beginn to compile and path all thinks but after a time it crash an says that the gcc have an error.

if there any other way without mingw or cygwin to make it unter a debian or other linux distri.

i have the mandrake 10 but i dont know it will be work for the ps2sdk.

sorry for my bad english.
The ps2dev tools work soooo much better in linux.

If you run some version of linux (or any *nix really) I'd personally recommend doing ps2 homebrew in linux instead of windows.

One thing to look out for, which could be your problem here, is that the toolchain will have issues compiling with GCC 3.4.x. Also, make sure you have plenty of hard drive space and your computer isn't overheating while building. Those are the most common problems of 'internal compiler errors' which I would guess is what you had happen?

EDIT: Oops, sorry... I had originally typed GCC 4.x, but it's GCC 3.4 and higher that have issues
Shoot Pixels Not People!
Makeshift Development
Apollo
Posts: 10
Joined: Sun Mar 05, 2006 3:19 am

Post by Apollo »

I was wondering how long ./toolchain.sh is supposed to take. I started it, but after half an hour I started to think something went wrong. How long should it take?
Apollo
Posts: 10
Joined: Sun Mar 05, 2006 3:19 am

Post by Apollo »

I've been running it for about 2 hours now and it is still not finished. It seems to be in some type of loop I think. Is this normal or has something gone wrong?
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

It depends largely on your hardware and internet speed, but running the toolchain script in cygwin can easily take a couple hours.
But if it sits for a couple hours with no output to the text console... then well, something is probably wrong.
Shoot Pixels Not People!
Makeshift Development
gamster
Posts: 10
Joined: Fri Mar 10, 2006 4:55 pm

Post by gamster »

Hi all, I'm new 2 this forum and this was the first post I read besides the rules.

I followed the guide in the first post and i ran into the following error.

makefile:20: /samples/Makefile.pref: No such file or directory
makefile:21: /samples/Makefile.eeglobal: No such file or directory
C:\cygwin\usr\local\ps2dev\bin\make.exe: *** No rule to make target '/samples/Makefile.eeglobal'. Stop.

If anyone can help it would be much appriciated. Thanx.
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

are those files there??
gamster
Posts: 10
Joined: Fri Mar 10, 2006 4:55 pm

Post by gamster »

yes
Amitj
Posts: 5
Joined: Tue Apr 11, 2006 3:22 pm

Post by Amitj »

Hello I am new here.
I used the tutorial here and i had a problam -

quote:
For compiling the PS2 toolchain, you need the following packages besides from the preselected packages.


gcc
make
wget
svn


Download and install them with setup.exe. In case Cygwin complains about other missing programs, just use setup.exe to download and install them.
---
But i dont get it, how do i getting to select these packages?
After that i runned the setup without it and runned cygwin but when i wrote in cygwin : svn checkout svn://svn...... it said not such a command svn.
i need a very quick reply for these 2 problams.
Thanks Amit
User avatar
Orfax
Posts: 21
Joined: Thu Apr 08, 2004 3:41 pm
Location: Adelaide, Australia
Contact:

Post by Orfax »

Amitj wrote:But i dont get it, how do i getting to select these packages?
After that i runned the setup without it and runned cygwin but when i wrote in cygwin : svn checkout svn://svn...... it said not such a command svn.
You don't have subversion installed. Run cygwin's setup again, when you get to the package selection screen, press the view button until you see "Full" next to it. Find the package names you want and press the New column for that package until you get a version number. And for svn, its called subversion.
Look deep into their eyes for what they have to say, Emotions take control of life everyday
Death (Nothing Is Everything)
Amitj
Posts: 5
Joined: Tue Apr 11, 2006 3:22 pm

Post by Amitj »

while cygwin creating the ps2dev toolchain i followed the instructions in the tutorial and downloaded the crismon editor. but i didnt understand in which language i can program my ps2 projects, and in whch format should i save it.
User avatar
Orfax
Posts: 21
Joined: Thu Apr 08, 2004 3:41 pm
Location: Adelaide, Australia
Contact:

Post by Orfax »

Amitj wrote:while cygwin creating the ps2dev toolchain i followed the instructions in the tutorial and downloaded the crismon editor. but i didnt understand in which language i can program my ps2 projects, and in whch format should i save it.
C / C++. If you are not familiar with C, then I suggest you learn the language first before attempting to program for the PS2. Also it would help if you are familar with Unix environments to ease the learning process.
Look deep into their eyes for what they have to say, Emotions take control of life everyday
Death (Nothing Is Everything)
frcol
Posts: 20
Joined: Wed Aug 02, 2006 7:46 am
Location: Brazil

Post by frcol »

Do you know why am I having problem with the mkdir -p $PS2SDK?

$ mkdir -p $PS2SDK
mkdir: missing operand
Try `mkdir --help' for more information.
Post Reply