User talk:Jluis

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(toolchain + distcc + shr = "Developer Workstation")
 
m
Line 1: Line 1:
 
== toolchain + distcc + shr = "Developer Workstation" ==
 
== toolchain + distcc + shr = "Developer Workstation" ==
  
 +
'''''Work in progress mixed language'''
 +
''
 
Tested with 20080808 shr-lite after opkg-cl update  opkg-cl upgrade
 
Tested with 20080808 shr-lite after opkg-cl update  opkg-cl upgrade
  
On the PC:
+
=== On the PC: ===
  
Install the openmoko toolchain [Toolchain]
+
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.
 
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:
 +
<nowiki>distccd -a 192.168.0.202 --verbose --no-detach --daemon --log-stderr</nowiki>
  
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:
 
<nowiki>
 
distccd -a 192.168.0.202 --verbose --no-detach --daemon --log-stderr
 
</nowiki>
 
  
 
+
=== On Neo: ===
 
+
On Neo:
+
  
 
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
Line 28: Line 26:
 
}
 
}
 
EOF
 
EOF
</nowiki>
+
</nowiki>
  
 
Create a suitable swapfile:
 
Create a suitable swapfile:
<nowiki>
+
<nowiki>
 
dd if=/dev/zero of=/swapfile bs=4k count=128k
 
dd if=/dev/zero of=/swapfile bs=4k count=128k
 
mkswap /swapfile
 
mkswap /swapfile
 
swapon /swapfile
 
swapon /swapfile
</nowiki>
+
</nowiki>
  
 
Install what is needed to compile distcc in a loop to lower the opkg's memory footprint.
 
Install what is needed to compile distcc in a loop to lower the opkg's memory footprint.
  
<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-dev;do opkg install $i;done
</nowiki>
+
</nowiki>
  
 
test the setup so far :
 
test the setup so far :
<nowiki>
+
<nowiki>
 
root@om-gta02:~# gcc -o hello hello.c
 
root@om-gta02:~# gcc -o hello hello.c
 
root@om-gta02:~# hello ;rm hello
 
root@om-gta02:~# hello ;rm hello
 
Hello world
 
Hello world
 
root@om-gta02:~#
 
root@om-gta02:~#
</nowiki>
+
</nowiki>
  
 
We create a new user to no compile as root:
 
We create a new user to no compile as root:
<nowiki>
+
<nowiki>
 
root@om-gta02 ~ $ adduser developer
 
root@om-gta02 ~ $ adduser developer
 
Changing password for developer
 
Changing password for developer
Line 63: Line 61:
 
root@om-gta02 ~ $ su - developer
 
root@om-gta02 ~ $ su - developer
 
developer@om-gta02 ~ $
 
developer@om-gta02 ~ $
</nowiki>
+
</nowiki>
  
 
Download distcc souce with wget from  http://distcc.googlecode.com/files/distcc-3.1.tar.gz
 
Download distcc souce with wget from  http://distcc.googlecode.com/files/distcc-3.1.tar.gz
 
and uncompress them and install distcc.
 
and uncompress them and install distcc.
<nowiki>
+
<nowiki>
zdeveloper@om-gta02 ~ $ cat distcc-3.1.tar.gz |tar -vx;cd distcc-3.1;./configure;make ;make install
+
developer@om-gta02 ~ $ zcat distcc-3.1.tar.gz |tar -vx;cd distcc-3.1;./configure;make ;make install
</nowiki>
+
</nowiki>
  
 
Completamos la configuración del neo:
 
Completamos la configuración del neo:

Revision as of 14:19, 16 September 2009

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 ~ $
 

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

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 ...

Personal tools

toolchain + distcc + shr = "Developer Workstation"

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 ~ $

Download distcc souce with wget from http://distcc.googlecode.com/files/distcc-3.1.tar.gz and uncompress them and install distcc. zdeveloper@om-gta02 ~ $ cat 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 ...