Export Path?? I have no Idea how to set it up. Please help

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

Moderators: cheriff, Herben

Post Reply
underagedrinker
Posts: 6
Joined: Sun Jul 04, 2004 12:25 am

Export Path?? I have no Idea how to set it up. Please help

Post by underagedrinker »

Hi,
I have Linux installed. I got the new toolchain.sh file in /root. I went to the terminal and typed "sh toolchian.sh" I'm always logged on as root. The files downloaded and everything went fine till i got to
"../configure: line 2209: cc: command not found"
*** The command 'cc -0 conftest -g conftest.c' failed.
I am new to linux and I know that this has to do with me setting the enviotnment variables wrong. I tried the export path, and this is what I can't configure correctly. I opened the file "toochain.sh" and I typed the exact thing that was in that file before I ran it.
export PS2DEV="/usr/local/ps2dev"
export PS2SDK="$PS2DEV/ps2sdk"
export CVSROOT=":pserver:[email protected]:/home/ps2cvs"
export PATH="$PATH:$PS2DEV/bin:$PS2DEV/ee/bin:$PS2DEV/iop/bin:$PS2DEV/dvp/bin:$PS2SDK/bin"

I do not know how to set export path, if some one could explain it to me. I searched the forums and it said to put the export path in your profile. I am not sure how to do this. I'm new to this, and i want to set this up so i can code in c++. If someone can help, i'd appriciate it. thank you. I also went to /etc/ folder and opened the file "profile" and i added the code there at the bottom of the document, and that did not solve my problem.
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post by blackdroid »

First of all it seems that you dont have a compiler installed on your linux box.
You need to fix that first.

Exporting a variable is easy, you have already done it, ie from the prompt
export VARIABLE=something

now all you need to do is add the specific variables to your .bash_profile in your home dir.
Kung VU
dnc
Posts: 7
Joined: Thu May 27, 2004 6:26 pm

Post by dnc »

It's not wise to use the root account for things other than configurations and applications installation.

You could build the toolchain with a normal user, better yet, you should do this as a normal user and only use root for the install phase (you only need root if you want to install somewhere on the system directory, and if you're using some packaged distribution, it's still not wise =), anyway your problem seems related to the missing cc not the command path.

If you need to modify the user profile, go in your home dir and modify the .profile or .bash_profile or .bash_rc (this if you use bash as shell, i think this is a fair guess), and remember, every time you make a change you need to relogin (the scripts are executed when logging)...

To summarize,

1st rule: use root the less you can (man group, man addgroup)

2st rule: don't mess with your system, put stuff in your home dir or in /usr/local (this way you don't break your rmp and dpkg)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

To summarize: if you are not logged in as root, you cannot do anything below the home directory level other than read and sometimes execute. The script needs to be able to write to the directory it's in.

I did nearly the same thing you did in setting up the PS2Dev software, but what I did after getting Linux installed the way I like was to make a src directory in my home directory. In that directory, I made a ps2dev directory and copied the script there. So the script was in

/home/jlfenton/src/ps2dev/

I have full rights to that directory, so the script was free to read/write/execute there. It then did it's thing just fine. Depending on your group rights, you might need to run the script in root mode for it to be able to make directories or write inside the /usr/local/ directory where the binary files and includes are installed when it reaches the "make install" part of the script.
underagedrinker
Posts: 6
Joined: Sun Jul 04, 2004 12:25 am

K, it installed.

Post by underagedrinker »

I didn't realize that I needed the compiler installed. LOL. I went to system settings, and packages and installed the dev kit. Also I added a user. "adduser developer" then "passwd developer" and typed the password. I cut all the files from /root that i downloaded into /home/developer/ and then relogged back in with developer user. Then in terminal I typed "su" and the root password to give me administrator rights. Then "sh toolchain.sh" and it kept installing past my error. Yes!! I'm running on a 300mhz, so it took 3 hours to compile. There are also 3 patchets below the file toolchain.sh, how do I run those?
I'm not sure if I need to add the user to any group as DNC had mentioned to lookup "man group" up in linux. Everything is installed in /usr/local/. It looks as if everything installed and went OK.
Thankx blackdroid and dnc for the help, but I will probably come up on some problems soon. thankx again.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

3 hours?!?! Good Lord! I think my Opteron took a couple minutes to compile it. :D

Oh well, now that that's done, compiling the individual programs shouldn't be anywhere near as long.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Don't feel bad. My main development machine takes a few hours to compile the toolchain, and I've done it a few times already.
underagedrinker
Posts: 6
Joined: Sun Jul 04, 2004 12:25 am

no profile file

Post by underagedrinker »

K, I do not have a Profile file in my home directory /home/developer/ There is no files there. Only the ones that toolchain downloaded. Do i just make my own?
I tried 2 compile the stars Demo. I extracted the files into a folder, and then went to the termianl and just went inside the folder and i typed "make" and this is the error I got.
"cc1: unrecognized option '-fnonnull-objects'
/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/../../../../ee/bin/as: unrecognized option '-mcpu=r5900'
make: *** [main.o] Error 1
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Re: no profile file

Post by Drakonite »

underagedrinker wrote:K, I do not have a Profile file in my home directory /home/developer/ There is no files there. Only the ones that toolchain downloaded. Do i just make my own?
/etc/profile <-- system wide profile file

~/.bashrc <--- user specific profile file (~/ is shorthand for /home/<currentusernamehere>/)

~/.bash_profile <--- user specific profile file, but only sourced by login shells


There is a slim chance I have .bashrc and .bash_profile mixed up.
Shoot Pixels Not People!
Makeshift Development
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post by blackdroid »

ls -la should show a bunch of .<filename> files
otherwise just create a .profile ( small letters ) with the export lines in it.
Kung VU
dnc
Posts: 7
Joined: Thu May 27, 2004 6:26 pm

Re: no profile file

Post by dnc »

Drakonite wrote:
underagedrinker wrote:K, I do not have a Profile file in my home directory /home/developer/ There is no files there. Only the ones that toolchain downloaded. Do i just make my own?
/etc/profile <-- system wide profile file

~/.bashrc <--- user specific profile file (~/ is shorthand for /home/<currentusernamehere>/)

~/.bash_profile <--- user specific profile file, but only sourced by login shells


There is a slim chance I have .bashrc and .bash_profile mixed up.
FWIK, ~/.bash_profile is only executed by bash on login shell, .bashrc every time a bash is invoked, so you should be correct. =)

You can use echo to check your environment variables, for example "echo $PATH".
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

ooPo wrote:Don't feel bad. My main development machine takes a few hours to compile the toolchain, and I've done it a few times already.
http://ccache.samba.org/
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Sounds like a nifty idea, but... caches are for flushing, aren't they?
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Yes, once you've sufficiently dirtied them.
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Re: no profile file

Post by blackdroid »

underagedrinker wrote: I tried 2 compile the stars Demo. I extracted the files into a folder, and then went to the termianl and just went inside the folder and i typed "make" and this is the error I got.
"cc1: unrecognized option '-fnonnull-objects'
/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/../../../../ee/bin/as: unrecognized option '-mcpu=r5900'
make: *** [main.o] Error 1
change -mcpu to -march, the Makefile for starsim is old.
Kung VU
underagedrinker
Posts: 6
Joined: Sun Jul 04, 2004 12:25 am

thx for the help

Post by underagedrinker »

"cc1: unrecognized option '-fnonnull-objects'
This error still comes up.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Have you tried removing it?
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post by blackdroid »

as I said, the Makefile for starsim is old and was made in the days of gcc-2.9 and alot of options from 2.9 to 3.x has changed or been removed completely, you just have to exercise your brain.
Kung VU
underagedrinker
Posts: 6
Joined: Sun Jul 04, 2004 12:25 am

Post by underagedrinker »

This is hard. I keep messing with the makefile, and i keep getting errors, and once I make one error disappear, another one shows up. Is there anyplace where they teach you to make the makefiles? I read the tutorial#1 on the tutorials section, but there isn't a lot about how to make the makefiles. I also googled, but it wasn't to direct.

The Demo that was included with it compiled correctly, and it worked when i loaded it on my ps2. I also tried to compile a couple of other sources, but it's just one error after another, but I will keep trying to get them to work. Also is there a good place to look up the error so that I can kind of fix it in the code. thx4dHelp.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Both the manuals for GNU make and GNU GCC are online. GCC at least is at gcc.gnu.org, I'm not sure where make's home page is, but you can start at www.gnu.org.
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post by blackdroid »

ive found this documentation to be of good use in the past, http://www.student.cs.uwaterloo.ca/~isg ... e_toc.html
I know it says gmake 3.70, it still is applicable anyway.
Kung VU
underagedrinker
Posts: 6
Joined: Sun Jul 04, 2004 12:25 am

K, i know somewhat about the makefile now

Post by underagedrinker »

I took the tutorial2b, and i added paddle support for it, I had problems compiling. Later on I figured it out that in the makefile, the LIBS order was messed up. So i reordered it a couple of times, and it compiled fine. Now i'm trying to add CD support and i have to add like 6 libs so it can work. I do not know what the rule is for ordering it. Can somebody explain this to me, thx. These are the libs I need to add.

LIBS1 = $(PS2DEV)/ps2sdk/ee/lib/libpad.a
LIBS2 = $(PS2DEV)/ps2sdk/ee/lib/libkernel.a
LIBS3 = $(PS2DEV)/ps2sdk/ee/lib/libsyscall.a
LIBS4 = $(PS2DEV)/ee/ee/lib/libm.a
LIBS5 = $(PS2DEV)/ee/ee/lib/libc.a
LIBS6 = $(PS2DEV)/ee/lib/libcdvd.a

when i have it in this order, the least amount of error comes up.
Post Reply