User talk:Jluis

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (toolchain + distcc + shr = "Developer Workstation")
m
 
(3 intermediate revisions by one user not shown)
Line 19: Line 19:
 
Create a suitable hello.c to test compiler.
 
Create a suitable hello.c to test compiler.
 
  <nowiki>
 
  <nowiki>
cat > hello.c <EOF
+
cat > hello.c <<EOF
#include
+
#include <stdio.h>
 
int main(void) {
 
int main(void) {
 
printf("Hello world\n");
 
printf("Hello world\n");
Line 38: Line 38:
  
 
  <nowiki>
 
  <nowiki>
for i in libc6-dev binutils-symlinks gcov gcc-symlinks cpp make
+
for i in libc6-dev binutils-symlinks gcov gcc-symlinks cpp make \
python-distutils python-doctest python-dev;do opkg install $i;done
+
python-distutils python-doctest python-devel;do opkg install $i;done
 
  </nowiki>
 
  </nowiki>
  
Line 72: Line 72:
 
  </nowiki>
 
  </nowiki>
  
Completamos la configuración del neo:
+
Testing and finishing neo configuration
Si ejecutamos distcc --show-hosts vemos que nos ha instalado en neo en primer
+
lugar
+
root@om-gta02:~# distcc --show-hosts
+
192.168.0.202:3632/4
+
192.168.0.200:3632/8
+
  
editamos /etc/default/distcc para que no arranque distccd matamos el proceso
+
We test the available hosts with "distcc --show-hosts" it should respondo with 127.0.0.1
 +
 
 +
We edit /usr/local/etc/default/distcc to prevent distccd from loading at startup,  we kill its procces and test it works:
 +
<nowiki>
 
y comprobamos que funciona:
 
y comprobamos que funciona:
root@om-gta02:~# sed -i
+
svn checkout http://distcc.googlecode.com/svn/trunk/ distcc-read-onlyroot@om-gta02:~# killall distccd
s/^STARTDISTCC=\"true/STARTDISTCC=\"false/ /etc/default/distcc
+
root@om-gta02:~# killall distccd
+
 
root@om-gta02:~# distcc --show-hosts
 
root@om-gta02:~# distcc --show-hosts
 
192.168.0.200:3632/8c
 
192.168.0.200:3632/8c
Line 89: Line 85:
 
STARTDISTCC is set to false in /etc/default/distcc
 
STARTDISTCC is set to false in /etc/default/distcc
 
/usr/bin/distccd not starting
 
/usr/bin/distccd not starting
 
+
</nowiki>
 
Creamos los enlaces simbólicos para gcc y cc llamen a distcc:
 
Creamos los enlaces simbólicos para gcc y cc llamen a distcc:
 
root@om-gta02:~# mkdir /usr/local
 
root@om-gta02:~# mkdir /usr/local

Latest revision as of 15:31, 21 January 2010

Contents

[edit] toolchain + distcc + shr = "Developer Workstation"

Work in progress mixed language 

Tested with 20080808 shr-lite after opkg-cl update opkg-cl upgrade

[edit] On the PC:

Install the openmoko [toolchain [Toolchain]]

If we are going to use mascareded distcc we need to create simbolic links for the short nanes of the /usr/local/openmoko/arm/bin/arm-angstrom-linux-gnueabi-* executables.

Install distcc server and run it on a shell that has the toolchain on the path and if using mascaraded distcc the directory with the links, with:

distccd -a 192.168.0.202 --verbose --no-detach --daemon --log-stderr


[edit] On Neo:

Create a suitable hello.c to test compiler.

cat > hello.c <<EOF
#include <stdio.h>
int main(void) {
printf("Hello world\n");
return 0;
}
EOF
 

Create a suitable swapfile:

dd if=/dev/zero of=/swapfile bs=4k count=128k
mkswap /swapfile
swapon /swapfile
 

Install what is needed to compile distcc in a loop to lower the opkg's memory footprint.

for i in libc6-dev binutils-symlinks gcov gcc-symlinks cpp make \
python-distutils python-doctest python-devel;do opkg install $i;done
 

test the setup so far :

root@om-gta02:~# gcc -o hello hello.c
root@om-gta02:~# hello ;rm hello
Hello world
root@om-gta02:~#
 

We create a new user to no compile as root:

root@om-gta02 ~ $ adduser developer
Changing password for developer
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
Re-enter new password:
Password changed.
root@om-gta02 ~ $ su - developer
developer@om-gta02 ~ $
 

[edit] Compiling distcc distribution

Download distcc souce from http://distcc.googlecode.com/files/distcc-3.1.tar.gz and uncompress them and install distcc.

developer@om-gta02 ~ $ wget http://distcc.googlecode.com/files/distcc-3.1.tar.gz
developer@om-gta02 ~ $ zcat distcc-3.1.tar.gz |tar -vx;cd distcc-3.1;./configure;make ;make install
 

Testing and finishing neo configuration

We test the available hosts with "distcc --show-hosts" it should respondo with 127.0.0.1

We edit /usr/local/etc/default/distcc to prevent distccd from loading at startup, we kill its procces and test it works: y comprobamos que funciona: svn checkout http://distcc.googlecode.com/svn/trunk/ distcc-read-onlyroot@om-gta02:~# killall distccd root@om-gta02:~# distcc --show-hosts 192.168.0.200:3632/8c root@om-gta02:~# /etc/init.d/distcc start STARTDISTCC is set to false in /etc/default/distcc /usr/bin/distccd not starting Creamos los enlaces simbólicos para gcc y cc llamen a distcc: root@om-gta02:~# mkdir /usr/local root@om-gta02:~# mkdir /usr/local/bin root@om-gta02:~# ln -s /usr/bin/distcc /usr/local/bin/gcc root@om-gta02:~# ln -s /usr/bin/distcc /usr/local/bin/cc

Y probamos : root@om-gta02:~# rm hello root@om-gta02:~# DISTCC_VERBOSE=1 gcc -c hello.c -o hello #si no usamos -c compila en local distcc[8252] (dcc_trace_version) distcc 2.18.3 arm-angstrom-linux-gnueabi; built Aug 5 2008 03:45:13 distcc[8252] (dcc_recursion_safeguard) safeguard level=0 distcc[8252] (main) compiler name is "cc" .... distcc[8252] (dcc_parse_hosts) found tcp token "192.168.0.200:3632/8" distcc[8252] (dcc_lock_host) got cpu lock on 192.168.0.200:3632/8 slot 0 as fd3 .... distcc[8252] (dcc_connect_by_addr) started connecting to 192.168.0.200:3632 ..... distcc[8252] (dcc_compile_remote) client finished sending request to server distcc[8252] (dcc_note_state) note state 5, file "(NULL)", host "192.168.0.200" distcc[8252] 18057 bytes from hello.c compiled on 192.168.0.200 in 0.5536s, rate 32kB/s ...

Personal tools

toolchain + distcc + shr = "Developer Workstation"

Work in progress mixed language 

Tested with 20080808 shr-lite after opkg-cl update opkg-cl upgrade

On the PC:

Install the openmoko [toolchain [Toolchain]]

If we are going to use mascareded distcc we need to create simbolic links for the short nanes of the /usr/local/openmoko/arm/bin/arm-angstrom-linux-gnueabi-* executables.

Install distcc server and run it on a shell that has the toolchain on the path and if using mascaraded distcc the directory with the links, with:

distccd -a 192.168.0.202 --verbose --no-detach --daemon --log-stderr


On Neo:

Create a suitable hello.c to test compiler.

cat > hello.c <EOF
#include
int main(void) {
printf("Hello world\n");
return 0;
}
EOF
 

Create a suitable swapfile:

dd if=/dev/zero of=/swapfile bs=4k count=128k
mkswap /swapfile
swapon /swapfile
 

Install what is needed to compile distcc in a loop to lower the opkg's memory footprint.

for i in libc6-dev binutils-symlinks gcov gcc-symlinks cpp make
python-distutils python-doctest python-dev;do opkg install $i;done
 

test the setup so far :

root@om-gta02:~# gcc -o hello hello.c
root@om-gta02:~# hello ;rm hello
Hello world
root@om-gta02:~#
 

We create a new user to no compile as root:

root@om-gta02 ~ $ adduser developer
Changing password for developer
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
Re-enter new password:
Password changed.
root@om-gta02 ~ $ su - developer
developer@om-gta02 ~ $
 

Compiling distcc distribution

Download distcc souce from http://distcc.googlecode.com/files/distcc-3.1.tar.gz and uncompress them and install distcc.

developer@om-gta02 ~ $ wget http://distcc.googlecode.com/files/distcc-3.1.tar.gz
developer@om-gta02 ~ $ zcat distcc-3.1.tar.gz |tar -vx;cd distcc-3.1;./configure;make ;make install
 

Completamos la configuración del neo: Si ejecutamos distcc --show-hosts vemos que nos ha instalado en neo en primer lugar root@om-gta02:~# distcc --show-hosts 192.168.0.202:3632/4 192.168.0.200:3632/8

editamos /etc/default/distcc para que no arranque distccd matamos el proceso y comprobamos que funciona: root@om-gta02:~# sed -i s/^STARTDISTCC=\"true/STARTDISTCC=\"false/ /etc/default/distcc root@om-gta02:~# killall distccd root@om-gta02:~# distcc --show-hosts 192.168.0.200:3632/8c root@om-gta02:~# /etc/init.d/distcc start STARTDISTCC is set to false in /etc/default/distcc /usr/bin/distccd not starting

Creamos los enlaces simbólicos para gcc y cc llamen a distcc: root@om-gta02:~# mkdir /usr/local root@om-gta02:~# mkdir /usr/local/bin root@om-gta02:~# ln -s /usr/bin/distcc /usr/local/bin/gcc root@om-gta02:~# ln -s /usr/bin/distcc /usr/local/bin/cc

Y probamos : root@om-gta02:~# rm hello root@om-gta02:~# DISTCC_VERBOSE=1 gcc -c hello.c -o hello #si no usamos -c compila en local distcc[8252] (dcc_trace_version) distcc 2.18.3 arm-angstrom-linux-gnueabi; built Aug 5 2008 03:45:13 distcc[8252] (dcc_recursion_safeguard) safeguard level=0 distcc[8252] (main) compiler name is "cc" .... distcc[8252] (dcc_parse_hosts) found tcp token "192.168.0.200:3632/8" distcc[8252] (dcc_lock_host) got cpu lock on 192.168.0.200:3632/8 slot 0 as fd3 .... distcc[8252] (dcc_connect_by_addr) started connecting to 192.168.0.200:3632 ..... distcc[8252] (dcc_compile_remote) client finished sending request to server distcc[8252] (dcc_note_state) note state 5, file "(NULL)", host "192.168.0.200" distcc[8252] 18057 bytes from hello.c compiled on 192.168.0.200 in 0.5536s, rate 32kB/s ...