PDA

View Full Version : Fpc4Nds on ubuntu 10.10



code_glitch
25-03-2011, 09:28 PM
Ah, hey legolas we appreciate your work, and I've read http://krachik.developpez.com/tutoriels/pascal/fpc4nds-setup/ and all the pages on the first few pages on google. No luck, so I tried them all again in virtual x86 xp with unity. Still no luck...:(

So, you wouldn't happen to have an up to date tutorial on how to set up and link an application for nds? I have no idea what versions of what to use, where to put them or anything so a good step by step would be nice 8) or if someone could post how they got theirs working with some files would be equally nice ;) because I am totally lost. Either it cant find nds9, system can't launch ppc-yadaya, arm-eabias failed or it had some random error making some .s file which still doesn't give me an nds ???

So all in all, really confused. Thanks for the help.;D

Legolas
26-03-2011, 04:05 PM
Uhm... Probably it's an issue related to different versions. Now I'm downloading and installing Ubuntu 10.10 in order to investigate. ;)

code_glitch
26-03-2011, 11:52 PM
Personally though, i do not think its ubuntu at fault since i get the same with 7 and xp. might be worth noting im runing x64 buntu? besides, i think its down to software versions mlre than anything since i heard certain versions of fpc4nds work with certain revs from devkit...

besides all that buntu 10.10 is simply outstandimg ;) i doubt yoh will want to go back, i hqd to move from win but ubuntu made painless so yay.

Legolas
27-03-2011, 03:14 PM
Yeah, I mean different fpc4nds and devkitARM versions. That guide refers to outdated packages, so the only way to make things working again is: (1) install the very latest devkitARM and (2) recompile fpc4nds from svn trunk. Step (1) should be trivial; step (2) is a bit more tricky. Telling long story short, there isn't a step-by-step guide about building fpc4nds on linux, but the one I wrote about building powerpc-wii (http://wiki.freepascal.org/Wii#Building_the_compiler) on Windows is pretty much the same thing, it just needs some obvious changes. About the x64 question, I don't know, sorry, but if there is a x64->arm crosscompiler, then it should work.

By the way, I'm thinking about building some snapshots (ftp://ftp.freepascal.org/fpc/snapshot/trunk/) and keeping them updated, because the different release timing between fpc and devkitARM. This way, when a new devkitARM version is released, I can update these snapshots, without waiting for a new fpc release.

code_glitch
27-03-2011, 04:50 PM
Cheers for that, then I think I will have to stick with my XP virtual machine and use that with the svn version as per your site's instructions unlike a lot of other results on google (haha). Just to clear this up, what does run on NDS library wise? I would assume OpenGl at the least right? I doubt sdl is a go, so event handling will have to be re-written but if gl does not work, whats go for GFX?

Oh, and a lite has 4mb ram right?

cheers,
code_glitch

Edit:
hum... Just tried out from SVN and as per this pages' instructions: http://itaprogaming.free.fr/index.php?x=p&pag=54 and all works well but it gives an error 127 for the units and libndsfpc which means the units folder is empty... ppcarm seems to work though. Any thoughts? This is on my XP Virtual Machine. double cheers.

Edit2:
Perhaps you could take everything from a point wherre it all works and put it into one package? That might work better for people since trying to hunt down versions is a bit of a pain... It seems as though the current devkitpro is r32 for ARM.

Legolas
29-03-2011, 07:51 PM
Here:

ftp://ftp.freepascal.org/fpc/snapshot/trunk/arm-nds/

I have uploaded the i386-linux package only, but a win32 version will follow soon.

I'll upload the very last fpc4nds version from now on at this address, every time it is needed to update it, e.g. in case of devkitARM updates, so it should be easier to get a fresh working copy.

Out of topic, I have made a small bash script to compile and make the i386-linux package. Because I'm not in linux at all, I can't find a way to copy only executable files from a directory to another. Any advice?

code_glitch
29-03-2011, 08:52 PM
you may have to use sudo to get root access so:



sudo cp -r source_directory destination_directory



should so. Giving fpc4nds a spin, but I get some access denied and segfaults. Trying to fix it atm.

Legolas
29-03-2011, 09:13 PM
Of course you will need to install devkitARM following this guide:

http://devkitpro.org/wiki/Getting_Started/devkitARM

then add the fpc4nds path to ~/.bashrc:

export PATH=/opt/fpc4nds/bin/arm-nds:$PATH

and reload it:

source ~/.bashrc

Add a file .fpc.cfg in your home directory:



#IFDEF nds
-Tnds
-XParm-eabi-
-Fu/opt/fpc4nds/units/$fpctarget
-Fu/opt/fpc4nds/units/$fpctarget/*
-Fu/opt/fpc4nds/units/$fpctarget/rtl
-Fu/opt/fpc4nds/units/$fpctarget/libndsfpc
-FD/opt/fpc4nds/bin/arm-nds
-Fl/opt/devkitPro/libnds/lib
#IFDEF __THUMB__
-Fl/opt/devkitPro/devkitARM/lib/gcc/arm-eabi/4.5.1/thumb
-Fl/opt/devkitPro/devkitARM/arm-eabi/lib/thumb
#ELSE
-Fl/opt/devkitPro/devkitARM/lib/gcc/arm-eabi/4.5.1
-Fl/opt/devkitPro/devkitARM/arm-eabi/lib
#ENDIF
#ENDIF ndsI forgot to add a readme in the package... :-[

BTW, this is for 32 bit (tested on Ubuntu 10.10)


About cp -r, I need to copy executable files only from a directory with mixed execs and .pas files. In windows I can do something like copy *.exe, but I can't find a suitable way to do the same thing in linux ???

code_glitch
29-03-2011, 09:27 PM
cp -r recursively copies files. you can always do:
[/code]
sudo cp -r *.* /opt/fpc4nds/
[/code]

which will copy ALL files in the current directory to /opt/fpc4nds...


About that .fpc.cfg - if you do that it compiles all your code to nds... I think I will set up a fpc4nds user and dump everything there ;)

Legolas
29-03-2011, 09:41 PM
That, or (just read here (http://www.freepascal.org/docs-html/user/usersu12.html#x35-420005.1.1)) you can ignore the default fpc.cfg and pass another cfg file to the compiler:

fpc -n @myconfigfile.cfg hello.pp

code_glitch
30-03-2011, 06:42 AM
sweet, I missed that one ;) lets get started... Shame I have to use gnome to code: my kde keeps crashing geany? I mean whaaaat?