Difference between revisions of "Distcc with MSVC:CL Options"
(→Tutorial) |
(→Tutorial) |
||
Line 12: | Line 12: | ||
= Tutorial = | = Tutorial = | ||
This tutorial is a quick way to check if a cl option is supported in distcc. You will have to follow these steps. | This tutorial is a quick way to check if a cl option is supported in distcc. You will have to follow these steps. | ||
− | # create a | + | # open up cygwin so your in a bash shell, or the visual studio command prompt |
+ | # create a header file called sample.h | ||
+ | |||
<pre> | <pre> | ||
#include <stdio.h> | #include <stdio.h> | ||
+ | #define GUARD 0 | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | # create a c file called sample.c | ||
+ | |||
+ | <pre> | ||
+ | #include "sample.h" | ||
+ | #include <string.h> | ||
− | int main() { | + | int main(void) { |
− | + | return GUARD; | |
} | } | ||
+ | |||
</pre> | </pre> | ||
− | # preprocess the file. | + | |
− | # | + | # preprocess the file. '''cl /P sample.c''' |
− | # compile to object code. | + | # create a temperary foler '''mkdir temp''' |
+ | # move the file to temp '''mv sample.i temp/''' or '''move sample.i temp/''' | ||
+ | # rename the file to sample.c '''mv sample.i sample.c''' or '''rename sample.i sample.c''' | ||
+ | # compile to object code and add a command line option listed below. For example '''cl /Fosample.obj /c sample.c ''' ''/nologo'' | ||
+ | # If you get no object code, get an error, or more than ''sample.obj'' being created, please give either document on this page or if you feel really unsure, post in the discussion. When documenting please specify if your documentation comes from reading or doing. If reading is not from msdn please link to where you got your information. | ||
== Questionable Options == | == Questionable Options == |
Revision as of 17:47, 13 November 2006
CL Options
So you'd like to help with the Distcc With MSVC options.
Why CL Options Are Important
The way distcc works is that you send out source code to other machines (called slaves) for them to compile. This speeds up the compilation time. But how can the slave know how to compile this code that was sent to it? What happens is that distcc also sends the compile line to the slave. But it can't be the full line because:
- some options don't make sense for the compiler (e.g. options for the linker or the preprocessor).
- some options require things that are only applicable if the entire local code base is around
- some options require you to send multiple files back (e.g. sending back .obj and .pdb objects is unsupported).
Tutorial
This tutorial is a quick way to check if a cl option is supported in distcc. You will have to follow these steps.
- open up cygwin so your in a bash shell, or the visual studio command prompt
- create a header file called sample.h
#include <stdio.h> #define GUARD 0
- create a c file called sample.c
#include "sample.h" #include <string.h> int main(void) { return GUARD; }
- preprocess the file. cl /P sample.c
- create a temperary foler mkdir temp
- move the file to temp mv sample.i temp/ or move sample.i temp/
- rename the file to sample.c mv sample.i sample.c or rename sample.i sample.c
- compile to object code and add a command line option listed below. For example cl /Fosample.obj /c sample.c /nologo
- If you get no object code, get an error, or more than sample.obj being created, please give either document on this page or if you feel really unsure, post in the discussion. When documenting please specify if your documentation comes from reading or doing. If reading is not from msdn please link to where you got your information.
Questionable Options
MSDN has categorical listing of cl options.
- /arch
- /bigobj
- /clr
- /EH
- /favor
- /fp
- /G1
- /G2
- /Gd
- /Ge
- /GF
- /Gh
- /GH
- /GL
- /Gm
- /GR
- /Gr
- /Gs
- /GT
- /GX
- /Gy
- /Gz
- /MD
- /MDd
- /MT
- /MTd
- @
- lets you add a file with compiler options. This must be eliminated as the file can't be sent to the slave. (for reading)
- /?
- You'd think this would cause problems but distcc leaves it be... OK! (from reading)
- /analyze
- runs an analysis on the code and will bring up more warnings... This is ok, all it does is increase number of warning messages and may cause build to fail but the user did ask for it, so that's fine. (from reading).
- /c
- only compile, don't link. (from doing)
- /doc
- generate sone documentation in a xdc file. Killing this option since you can't get the file back from the slave.
- /errorReport
- /FC
- /H
- /HELP
- You'd think this would cause problems but distcc leaves it be... OK!
- /hotpatch
- /J
- /nologo
- /QIfist
- /QIPF_B
- /QIPF_C
- /QIPF_fr32
- /QIPF_noPIC
- /QIPF_restrict_plabels
- /showIncludes
- /Tc/TC
- /Tp/TP
- /V
- /W
- /w
- /Wall
- /WL
- /Zm