close

Вход

Забыли?

вход по аккаунту

?

How to compile faster - DESY

код для вставки
How to compile faster
в—Џ
IceRec trunk takes about 40 minutes to compile
в—Џ
too long to do clean builds regularly
в—Џ
make can do several builds in parallel
в—Џ
... but just on the same machine
в—Џ
What to do with several unused desktop
machines?
Distribute compilation!
Robert Franke, 28.06.2006
Desy Zeuthen
Basics compilation steps
something.cxx
Preprocess (include .h files,
evaluate defines, ifdefs etc.)
gcc -E
Preprocessed file
This can be done somewhere else!
Compile (produce machine
dependent assembler code)
gcc -c
something.o
Link (Link with target machine
specific libraries)
gcc <objectfiles> -o project.o
project.o
Robert Franke, 28.06.2006
Desy Zeuthen
The distributed compiler: distcc
в—Џ
distcc.samba.org
в—Џ
Workflow:
–
–
–
–
в—Џ
Preprocess locally
Send to other machines over ssh (server-client possible)
Compile there, send back
Link locally
Tedious command line work:
–
>makeВ В­j3В GXX="distccВ /usr/bin/gcc"В CC="distccВ /usr/bin/gcc"В DISTCC_HOSTS="localhost/1В @nereide4/1:/afs/ifh.de/user/r/rfranke/public/tools/bin/distccdВ @dryade18/1:/afs/ifh.de/user/r/rfranke/public/tools/bin/distccd"В DISTCCD_PATH=$PATH
Robert Franke, 28.06.2006
Desy Zeuthen
Solution: dmake
в—Џ
Wrapperscript around distcc
в—Џ
Uses first gcc binary in your $PATH
в—Џ
в—Џ
Manages available compilation hosts and number
of parallel makes
Simple usage:
–
>dmake
INFO:В ThereВ isВ 7В remoteВ distcchostsВ availableВ inВ total
INFO:В YouВ requestedВ 3В makesВ inВ parallel
INFO:В GoingВ toВ compileВ onВ theВ followingВ machines:
INFO:В localhost
INFO:В nereide4
INFO:В dryade18
INFO:В RunningВ onВ gccВ 3.2.3
в—Џ
Multitude of useful options
Robert Franke, 28.06.2006
Desy Zeuthen
How to use it
в—Џ
Include
/afs/ifh.de/user/r/rfranke/public/tools/bin
in your $PATH
в—Џ
Read the help page
–
>Usage:dmakeВ [В­hВ В­В­help]В [В­vВ В­В­verbose]В [В­a]В [В­s]В [В­lВ n]В [В­jВ n]В [В­qВ В­В­quiet]В [makeВ­options]
В­h/В­В­help:В PrintВ outВ thisВ help
В­v/В­В­verbose:В PrintВ outВ makeВ commandВ (mainlyВ forВ debugging)
В­aВ :В PrintВ allВ availableВ hostsВ andВ exit
В­sВ :В OnlyВ simulate,В don'tВ executeВ make,В impliesВ verbose
В­j:В NumberВ ofВ parallelВ makesВ (defaultВ 3)
В­l:В NumberВ ofВ localВ makesВ (defaultВ 1)
В­q/В­В­quiet:В doВ notВ printВ allВ theВ niceВ information
Robert Franke, 28.06.2006
Desy Zeuthen
What do you gain
в—Џ
Example: dataclasses project
–
–
–
–
–
1 host: 4:50 min
2 hosts: 3:00 min
3 hosts: 2:08 min
4 hosts: 1:51 min
5 hosts: 1:38 min
в—Џ
Limiting factor: linking, rootcint
в—Џ
Not all hosts are equally fast
в—Џ
Monitor with distccmon-gnome
Robert Franke, 28.06.2006
Desy Zeuthen
Ideas and Future Improvements
в—Џ
Fix bugs?
в—Џ
Open for suggestions, new features!
в—Џ
Get more hosts
–
–
Wanted: satyr and dryade generation
Phase out nereide generation
в—Џ
Cross compilation for MacOS X hosts!!!!!?
в—Џ
Use compiler cache ccache
–
Do a clean IceRec build in 3 minutes!
Robert Franke, 28.06.2006
Desy Zeuthen
Документ
Категория
Без категории
Просмотров
1
Размер файла
153 Кб
Теги
1/--страниц
Пожаловаться на содержимое документа