OK, I think I have followed the instructions carefully and "something" is working, but not all the way. Hopefully we are close.
I launch the distcc daemon on the host. I have to set it to run in the background, which is not mentioned in the instructions.
^Z
[1]+ Stopped distccd --verbose --no-detach --daemon --allow 192.168.7.2 --log-level debug --log-file ~/distccd.log
gary@audio-workstation:~$ bg
[1]+ distccd --verbose --no-detach --daemon --allow 192.168.7.2 --log-level debug --log-file ~/distccd.log &
Then I checked to see if it's running. Looks like it launches 7 processes (!).
gary@audio-workstation:~$ ps ax | grep distcc
19094 pts/2 SN 0:00 distccd --verbose --no-detach --daemon --allow 192.168.7.2 --log-level debug --log-file /home/gary/distccd.log
19095 pts/2 SN 0:00 distccd --verbose --no-detach --daemon --allow 192.168.7.2 --log-level debug --log-file /home/gary/distccd.log
19096 pts/2 SN 0:00 distccd --verbose --no-detach --daemon --allow 192.168.7.2 --log-level debug --log-file /home/gary/distccd.log
19097 pts/2 SN 0:00 distccd --verbose --no-detach --daemon --allow 192.168.7.2 --log-level debug --log-file /home/gary/distccd.log
19098 pts/2 SN 0:00 distccd --verbose --no-detach --daemon --allow 192.168.7.2 --log-level debug --log-file /home/gary/distccd.log
19099 pts/2 SN 0:00 distccd --verbose --no-detach --daemon --allow 192.168.7.2 --log-level debug --log-file /home/gary/distccd.log
19100 pts/2 SN 0:00 distccd --verbose --no-detach --daemon --allow 192.168.7.2 --log-level debug --log-file /home/gary/distccd.log
19106 pts/2 S+ 0:00 grep --color=auto distcc
gary@audio-workstation:~$
Next I try to compile the test program on the bela. That works ok.
root@bela:~/Bela/resources/network# distcc-clang udp-client.c
root@bela:~/Bela/resources/network# ls -l a.out
-rwxr-xr-x 1 root root 8672 May 28 18:49 a.out
root@bela:~/Bela/resources/network# ./a.out
Usage: server port
root@bela:~/Bela/resources/network#
At present (before compiling) the distccd.log contains:
gary@audio-workstation:~$ tail -f ~/distccd.log
distccd[19094] (dcc_standalone_server) allowing up to 6 active jobs
distccd[19094] (dcc_standalone_server) not detaching
distccd[19094] (dcc_new_pgrp) already a process group leader
distccd[19094] (dcc_log_daemon_started) preforking daemon started (3.3.2 x86_64-pc-linux-gnu, built May 26 2019 14:11:45)
distccd[19094] (dcc_create_kids) up to 1 children
distccd[19094] (dcc_create_kids) up to 2 children
distccd[19094] (dcc_create_kids) up to 3 children
distccd[19094] (dcc_create_kids) up to 4 children
distccd[19094] (dcc_create_kids) up to 5 children
distccd[19094] (dcc_create_kids) up to 6 children
Now I will add -c to try to use the distcc server.
Log from host now has this additional info:
distccd[19100] (dcc_check_client) connection from 192.168.7.2:59098
distccd[19100] (check_address_inet) match client 0x207a8c0, value 0x207a8c0, mask 0xffffffff
distccd[19100] (dcc_r_token_int) got DIST00000001
distccd[19100] (dcc_r_token_int) got ARGC00000005
distccd[19100] (dcc_r_argv) reading 5 arguments from job submission
distccd[19100] (dcc_r_token_int) got ARGV0000000d
distccd[19100] (dcc_r_token_string) got 'clang-3.9-arm'
distccd[19100] (dcc_r_argv) argv[0] = "clang-3.9-arm"
distccd[19100] (dcc_r_token_int) got ARGV00000002
distccd[19100] (dcc_r_token_string) got '-c'
distccd[19100] (dcc_r_argv) argv[1] = "-c"
distccd[19100] (dcc_r_token_int) got ARGV0000000c
distccd[19100] (dcc_r_token_string) got 'udp-client.c'
distccd[19100] (dcc_r_argv) argv[2] = "udp-client.c"
distccd[19100] (dcc_r_token_int) got ARGV00000002
distccd[19100] (dcc_r_token_string) got '-o'
distccd[19100] (dcc_r_argv) argv[3] = "-o"
distccd[19100] (dcc_r_token_int) got ARGV0000000c
distccd[19100] (dcc_r_token_string) got 'udp-client.o'
distccd[19100] (dcc_r_argv) argv[4] = "udp-client.o"
distccd[19100] (dcc_r_argv) got arguments: clang-3.9-arm -c udp-client.c -o udp-client.o
distccd[19100] (dcc_scan_args) scanning arguments: clang-3.9-arm -c udp-client.c -o udp-client.o
distccd[19100] (dcc_scan_args) found input file "udp-client.c"
distccd[19100] (dcc_scan_args) found object/output file "udp-client.o"
distccd[19100] compile from udp-client.c to udp-client.o
distccd[19100] (dcc_run_job) output file udp-client.o
distccd[19100] (dcc_input_tmpnam) input file udp-client.c
distccd[19100] (dcc_r_token_int) got DOTI00016dac
distccd[19100] (dcc_r_file) received 93612 bytes to file /tmp/distccd_941a833e.i
distccd[19100] (dcc_r_file_timed) 93612 bytes received in 0.011030s, rate 8288kB/s
distccd[19100] (dcc_set_input) changed input from "udp-client.c" to "/tmp/distccd_941a833e.i"
distccd[19100] (dcc_set_input) command after: clang-3.9-arm -c /tmp/distccd_941a833e.i -o udp-client.o
distccd[19100] (dcc_set_output) changed output from "udp-client.o" to "/tmp/distccd_9466833e.o"
distccd[19100] (dcc_set_output) command after: clang-3.9-arm -c /tmp/distccd_941a833e.i -o /tmp/distccd_9466833e.o
distccd[19100] (dcc_check_compiler_masq) /usr/local/bin/clang-3.9-arm is not a symlink
distccd[19100] (dcc_check_compiler_whitelist) CRITICAL! no /usr/local/lib/distcc
distccd[19100] (dcc_cleanup_tempfiles_inner) deleted 5 temporary files
distccd[19100] (dcc_job_summary) client: 192.168.7.2:59098 OTHER exit:0 sig:0 core:0 ret:0 time:229ms
gary@audio-workstation:~$ ls -al /usr/local/lib
total 11844
drwxr-xr-x 4 root root 4096 May 26 13:56 .
drwxr-xr-x 10 root root 4096 Feb 9 16:12 ..
-rw-r--r-- 1 root root 11346736 May 26 09:55 ios-libsndfile.a
-rw-r--r-- 1 root root 760668 May 26 09:55 libOSCFaust.a
drwxrwsr-x 4 root staff 4096 May 26 13:57 python2.7
drwxrwsr-x 3 root staff 4096 Feb 9 16:12 python3.6
gary@audio-workstation:~$
On Bela, I see:
root@bela:~/Bela/resources/network# distcc-clang -c udp-client.c
distcc[14931] (dcc_readx) ERROR: unexpected eof on fd5
distcc[14931] (dcc_r_token_int) ERROR: read failed while waiting for token "DONE"
distcc[14931] (dcc_r_result_header) ERROR: server provided no answer. Is the server configured to allow access from your IP address? Does the server have the compiler installed? Is the server configured to access the compiler?
distcc[14931] (dcc_build_somewhere) Warning: failed to distribute and fallbacks are disabled
root@bela:~/Bela/resources/network#
root@bela:~/Bela/resources/network# ls -al /tmp/distcc
total 8
drwxr-xr-x 2 root root 4096 May 28 18:55 .
drwxrwxrwt 9 root root 4096 May 28 18:57 ..
root@bela:~/Bela/resources/network#
Just to be sure, I ran the watch statements. Have to put those in the background too.
root@bela:~/Bela/resources/network# ps ax | grep watch
10 ? S 0:01 [watchdog/0]
14935 pts/1 T 0:00 watch -n 0.4 bash -c ps aux | grep clang-3.9-arm
15004 pts/1 T 0:00 watch -n 0.4 bash -c ps aux | grep clang++-3.9-arm
15103 pts/1 S+ 0:00 grep --color=auto watch
root@bela:~/Bela/resources/network#
Setup details:
Ubuntu 18.04 host:
gary@audio-workstation:~$ cat /usr/local/bin/clang-3.9-arm
#!/bin/bash
/usr/bin/clang-3.9 -target armv7l-unknown-linux-gnueabihf --sysroot ~/arm $@
gary@audio-workstation:~$
gary@audio-workstation:~$ cat /usr/local/bin/clang++-3.9-arm
#!/bin/bash
/usr/bin/clang++ -target armv71-unknown-linux-gnueabihf --sysroot ~/arm $0
gary@audio-workstation:~$
Please note if you are following along, this is where I made my big mistake.
The final parameter in both scripts above needs to be $@ (meaning the entire list of parameters sent to the script) rather than $0 (the name of the script itself). The difference was very hard to see on my Macbook Air (both because the screen/font is very small, and because there is a slash through the zero in the default font).
Bela:
root@bela:~# ls -l /usr/local/bin/clang*
-rwxr-xr-x 1 root root 45 May 26 20:53 /usr/local/bin/clang++-3.9-arm
-rwxr-xr-x 1 root root 25 May 26 20:52 /usr/local/bin/clang-3.9-arm
root@bela:~# ls -l /usr/local/bin/dist*
-rwxr-xr-x 1 root root 253 May 26 20:54 /usr/local/bin/distcc-clang
-rwxr-xr-x 1 root root 255 May 26 20:55 /usr/local/bin/distcc-clang++
root@bela:~# cat /usr/local/bin/clang*
#!/bin/bash
clang++-3.9 $@ -stdlib=libstdc++
#!/bin/bash
clang-3.9 $@
root@bela:~#
root@bela:~# cat /usr/local/bin/distcc-clang
#!/bin/bash
export DISTCC_HOSTS=192.168.7.1
export DISTCC_VERBOSE=0
export DISTCC_FALLBACK=0 # does not seem to apply to the version of distcc in use
export DISTCC_BACKOFF_PERIOD=0
export TMPDIR=/tmp/distcc
mkdir -p /tmp/distcc
distcc clang-3.9-arm $@
root@bela:~#
root@bela:~# cat /usr/local/bin/distcc-clang++
#!/bin/bash
export DISTCC_HOSTS=192.168.7.1
export DISTCC_VERBOSE=0
export DISTCC_FALLBACK=0 # does not seem to apply to the version of distcc in use
export DISTCC_BACKOFF_PERIOD=0
export TMPDIR=/tmp/distcc
mkdir -p /tmp/distcc
distcc clang++-3.9-arm $@
root@bela:~#