gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Compiling with devkitARM r21 under linux

#147341 - tempest - Wed Dec 19, 2007 12:34 am

Hello, tonight I've decided to give devkitARM r21 a shot under my Linux box (Ubuntu 7.10 - Gutsy); being accustomed to Windows' "let-me-do-all-the-work" installer I'm having some troubles to setup the toolchain.

This has been my progress so far:

Downloaded files:
Code:
devkitARM_r21-linux.tar.bz2
libfat-src-20070127.tar.bz2
libnds-src-20071023.tar.bz2
nds-examples-20071023.tar.bz2

Added these lines in my ~/.bashrc:
Code:
export DEVKITPRO=~/devkitPRO
export DEVKITARM=$DEVKITPRO/devkitARM

Installation:
Code:
cd ~
mkdir devkitPRO
cd devkitPRO
tar xvjf devkitARM_r21-linux.tar.bz2
mkdir libnds
cd libnds
tar xvjf libnds-src-20071023.tar.bz2


At this point I can build libnds just by typing make in the libnds directory. Fine, so I try the same with libfat; in this post wintermute suggests to create a libfat directory inside libnds directory, so here I go:

Code:
mkdir libfat
tar xvjf libfat-src-20070127.tar.bz2


But this time make -C nds doesn't work as well:
Code:
io_scsd_s.s
arm-eabi-gcc -MMD -MP -MF /home/tempest/devkitPRO/libnds/libfat/nds/release/io_scsd_s.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c /home/tempest/devkitPRO/libnds/libfat/nds/../source/disc_io/io_scsd_s.s -o io_scsd_s.o
mkdir /home/tempest/devkitPRO/libnds/libfat/nds/release/../nds/lib
mkdir: cannot create directory `/home/tempest/devkitPRO/libnds/libfat/nds/release/../nds/lib': No such file or directory
make[1]: *** [/home/tempest/devkitPRO/libnds/libfat/nds/release/../nds/lib] Error 1
make: *** [release] Error 2
make: Leaving directory `/home/tempest/devkitPRO/libnds/libfat/nds'


The error is on mkdir invocation; one could work around it using "mkdir -p" instead of plain mkdir, but maybe I have a flaw in my directory structure?

Thanks in advance for any suggestion!

#147380 - melw - Wed Dec 19, 2007 11:53 am

I think you're overusing the directories here, skip the libfat directory and install everything straight into the libnds directory. A normal installation has just devkitPRO/libnds/lib/ and devkitPRO/libnds/include directories, former with needed lib (.a) files and the latter with all header (.h) files. When building the libraries from source, you don't need to extract the source in the same directory either. In fact to keep the installation nice and clean I'd recommend to extract the sources elsewhere.

(I have actually never installed devkitARM on Linux, but this is how it looks on my living room Mac - should be essentially all the same.)

#147381 - moshii - Wed Dec 19, 2007 12:26 pm

melw wrote:
I think you're overusing the directories here, skip the libfat directory and install everything straight into the libnds directory.)


Without proper packages is probably best not to mix the contents of the binary tarballs.. from a system maintenance point of view. My setup works with each library in a specific directory, and I believe the template makefiles are actually designed to handle that.....

One thing I have found is that the makefiles or some of the tools don't handle symlinks and builds will fail if your working directory has a symlink somewhere in it's path.

#147479 - wintermute - Fri Dec 21, 2007 10:54 am

tempest wrote:

At this point I can build libnds just by typing make in the libnds directory. Fine, so I try the same with libfat; in this post wintermute suggests to create a libfat directory inside libnds directory, so here I go:


You misunderstood the post. The installer places the binaries for DS libraries in the libnds folder, not in a subdirectory.

Most, if not all of the source distributions have an install target which installs the libraries and headers in the appropriate place. While you can put the source and the binaries for libnds in the same folder I'd really recommend that you keep the source folder separate & run make install from there.

Quote:

But this time make -C nds doesn't work as well:
mkdir /home/tempest/devkitPRO/libnds/libfat/nds/release/../nds/lib
mkdir: cannot create directory


This one is a bit weird, running make directly in the nds or gba subdirectories will cause this but it's actually a flaw in the way TOPDIR is created if it doesn't exist. It shouldn't happen when running from the root directory.

I've corrected this in CVS but you won't currently be able to build libfat from there since it requires devkitARM r22 which hasn't been released and the full patchset for that isn't yet in CVS. You could probably try copying over the makefiles from CVS and see if that helps any.

Your other option is to try the experimental linux installer instead. See http://forums.devkitpro.org/viewtopic.php?f=25&t=10 for details.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog


Last edited by wintermute on Fri Dec 21, 2007 7:54 pm; edited 1 time in total

#147499 - moshii - Fri Dec 21, 2007 7:28 pm

wintermute wrote:

Your other option is to try the experimental linux installer instead. See http://forums.devkitpro.org/viewtopic.php?f=25&t=10 for details.


Solves a problem that doesn't exist to be honest... and a quick scan of the code seems to suggest that it doesn't even check if the platform it going to unpack i386 binaries on is even i386 compatible. Ouch

#147502 - wintermute - Fri Dec 21, 2007 7:53 pm

moshii wrote:
wintermute wrote:

Your other option is to try the experimental linux installer instead. See http://forums.devkitpro.org/viewtopic.php?f=25&t=10 for details.


Solves a problem that doesn't exist to be honest... and a quick scan of the code seems to suggest that it doesn't even check if the platform it going to unpack i386 binaries on is even i386 compatible. Ouch


1. You'd be surprised how many people running linux appear to be completely incapable of setting up devkitARM properly.

2. I used the term experimental for a reason.

3. Nobody said you *had* to use it.

4. If you think it's broken then supply a patch.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#147559 - moshii - Sun Dec 23, 2007 5:31 am

wintermute wrote:

4. If you think it's broken then supply a patch.


10 minutes, a can of coke... and checkinstall; I might read the checkinstall man page later and setup the correct dependencies so that libnds depends on the correct version of dka etc. Maybe.

http://debian.cardboardbox.org.uk/debkitpro/

Code:
sumomo:/home/daniel/Desktop/debkitpro/libnds-20071023# dpkg -i libnds_20071023-1_amd64.deb
(Reading database ... 125257 files and directories currently installed.)
Preparing to replace libnds 20071023-1 (using libnds_20071023-1_amd64.deb) ...
Unpacking replacement libnds ...
Setting up libnds (20071023-1) ...
sumomo:/home/daniel/Desktop/debkitpro/libnds-20071023# dpkg -r libnds
(Reading database ... 125257 files and directories currently installed.)
Removing libnds ...
sumomo:/home/daniel/Desktop/debkitpro/libnds-20071023# ls /usr/local/debkitpro/
devkitarm  dswifi  libfat
sumomo:/home/daniel/Desktop/debkitpro/libnds-20071023#