Thanks for your tip, but I still have some difficulties. When I proceed as you described, the code will be compiled, but the output file will be written to root directory. So, I have to change the directory for compilation. I thought that something like

$ROOTCMD cd /home/cluster/clustersoft
$ROOTCMD gcc /home/cluster/clustersoft/test.c

resp.

$ROOTCMD cd /home/cluster/clustersoft
$ROOTCMD gcc test.c

should work, but obviously, it does not :(  Any help is apreciated.
Dominik


Michael Tautschnig wrote:
[...]

    1    #!/bin/bash
2 3 $ROOTCMD cp -R /media/mirror/clustersoft /home/cluster 4 $ROOTCMD chmod -R 777 /home/cluster/clustersoft
    5    $target/usr/bin/gcc $target/home/cluster/clustersoft/test.c

From previous runs I learned that I have to put the keyword "$target" infront of the gcc command and in front of the file I would like to compile (test.c). But know, fai complains that the file stdio.h (this is file which I include in test.c) can not be found. Obviously, I should also add the keyword "$target" infront of any filename I call within the source-code, but this would not make any sense ...

[...]

Ok, just one seeming misconception: $target is not a keyword, but a simple
environment variable (ah, and you should be using $FAI_ROOT, IMHO); but the
solution should be pretty simple: State line 5 as

$ROOTCMD gcc /home/cluster/clustersoft/test.c

as $ROOTCMD expands to "chroot $FAI_ROOT", which is what you need: a chroot.

Best,
Michael



--
Dominik Bänninger
Oetlingerstrasse 45
CH 4057 Basel

Tel.: +41 61 381 54 13
Mob.: +41 79 600 51 75

Antwort per Email an