Page 1 of 1

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

Posted: Wed Jul 14, 2004 4:16 pm
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.

Posted: Wed Jul 14, 2004 8:30 pm
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.

Posted: Wed Jul 14, 2004 8:31 pm
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)

Posted: Thu Jul 15, 2004 7:44 am
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.

K, it installed.

Posted: Thu Jul 15, 2004 8:16 am
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.

Posted: Thu Jul 15, 2004 1:15 pm
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.

Posted: Thu Jul 15, 2004 1:24 pm
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.

no profile file

Posted: Thu Jul 15, 2004 3:52 pm
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

Re: no profile file

Posted: Thu Jul 15, 2004 7:45 pm
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.

Posted: Thu Jul 15, 2004 7:47 pm
by blackdroid
ls -la should show a bunch of .<filename> files
otherwise just create a .profile ( small letters ) with the export lines in it.

Re: no profile file

Posted: Thu Jul 15, 2004 8:18 pm
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".

Posted: Fri Jul 16, 2004 2:43 am
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/

Posted: Fri Jul 16, 2004 7:13 am
by ooPo
Sounds like a nifty idea, but... caches are for flushing, aren't they?

Posted: Fri Jul 16, 2004 7:52 am
by mrbrown
Yes, once you've sufficiently dirtied them.

Re: no profile file

Posted: Fri Jul 16, 2004 8:36 am
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.

thx for the help

Posted: Fri Jul 16, 2004 9:21 am
by underagedrinker
"cc1: unrecognized option '-fnonnull-objects'
This error still comes up.

Posted: Fri Jul 16, 2004 9:32 am
by ooPo
Have you tried removing it?

Posted: Fri Jul 16, 2004 9:37 am
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.

Posted: Mon Jul 19, 2004 12:25 pm
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.

Posted: Tue Jul 20, 2004 2:52 am
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.

Posted: Tue Jul 20, 2004 4:20 am
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.

K, i know somewhat about the makefile now

Posted: Wed Jul 21, 2004 3:30 am
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.