[Clam-devel] distributed compiler

Pau Arumi parumi at iua.upf.edu
Fri Mar 30 10:45:34 PDT 2007


interesting indeed.
but i think i'd prefere a more high-level scons option and easier 
to document.
what about a unique option like this?
scons use_distcc_hosts="host1 host2"
and scons --help would explain what it does.

pau


En/na Hernán Ordiales ha escrit:
> i don't know if is of your interest, but i had patched the SConstruct
> file to have the option of build with distcc (a distributed compiler)
> 
> It doesn't affect normal compile. It's defined on "clam.conf" file in
> a very simple way...
> 
> for example, if you have at this file:
> 
> CXX = 'g++'
> DISTCC_HOSTS = ''
> 
> (or even without any of those env vars)
> 
> you will compile normally as now...
> 
> 
> but, if you have something like:
> 
> CXX = 'distcc g++'
> DISTCC_HOSTS = 'host1 host2 host3 host4'
> 
> you'll compiling with distcc instead, with the host's (or ip numbers)
> defined on "DISTCC_HOSTS" env var.
> 
> And of course, you have to configure and setup well distcc in all host's 
> first
> 
> If you want, some time ago i made a short article in my blog[1] about
> how to setup and work with distcc (i'm sorry is in spanish, but if you
> speak english you can go to the distcc web[2] for the almost the same
> or i think you can find easily a good article about it and of course
> you can ask me about it if you want too :P)
> 
> ah, one more thing, while compiling you also can have a little fun
> with distccmon-gnome app, a distcc graphical monitor... :o)
> 
> I also recommend install ccache[3] too to improve the whole process
> 
> [1] http://h.ordia.com.ar/blog/index.php?entry=entry070206-155912
> [2] http://distcc.samba.org/
> [3] http://ccache.samba.org/
> 
> cheers,
> 
> 
> ------------------------------------------------------------------------
> 
> Index: CLAM/scons/libs/SConstruct
> ===================================================================
> --- CLAM/scons/libs/SConstruct	(revisión: 9886)
> +++ CLAM/scons/libs/SConstruct	(copia de trabajo)
> @@ -3,6 +3,7 @@
>  import os
>  import shelve
>  import copy
> +import string
>  # tools for build configuration
>  from buildtools.custom_builders import * 
>  from buildtools.tool_checks import *
> @@ -181,6 +182,8 @@
>  	opts = Options('clam.conf')
>  	
>  	# global options
> +	opts.Add( 'CXX', 'C++ compiler', env['CXX'])
> +	opts.Add( 'DISTCC_HOSTS', 'distcc hosts', env['ENV']['DISTCC_HOSTS'])
>  	opts.Add( PathOption( 'prefix', 'Install location for CLAM', '/usr/local'))
>  	opts.Add( PathOption( 'install_prefix', 'Install location when packaging (just for .deb creation)', '.'))
>  	if sys.platform == 'win32' : #!= 'linux2' :
> @@ -304,6 +307,8 @@
>  
>  setup_build_options( clam_env )
>  
> +clam_env['ENV']['DISTCC_HOSTS'] = clam_env['DISTCC_HOSTS']
> +SetOption('num_jobs', len(string.split(clam_env['ENV']['DISTCC_HOSTS'])))
>  clam_env.Append( CPPFLAGS = '' )
>  
>  sys.path.append('../sconstools')
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Clam-devel mailing list
> Clam-devel at llistes.projectes.lafarga.org
> https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel





More information about the clam-devel mailing list