The charmc program, located in ``charm/bin'', standardizes compiling and linking procedures among various machines and operating systems. ``charmc'' is a general-purpose tool for compiling and linking, not only restricted to CHARM++ programs.
Charmc can perform the following tasks. The (simplified) syntax for each of these modes is shown. Caution: in reality, one almost always has to add some command-line options in addition to the simplified syntax shown below. The options are described next.
Charmc automatically figures out where the charm lib and include directories are -- at no point do you have to configure this information. However, the code that finds the lib and include directories can be confused if you remove charmc from its normal directory, or rearrange the directory tree. Thus, the files in the charm/bin, charm/include, and charm/lib directories must be left where they are relative to each other.
The following command-line options are available to users of charmc:
Output file name. Note: charmc only ever produces one output file at a time. Because of this, you cannot compile multiple source files at once, unless you then link or archive them into a single output-file. If exactly one source-file is specified, then an output file will be selected by default using the obvious rule (eg, if the input file if pgm.c, the output file is pgm.o). If multiple input files are specified, you must manually specify the name of the output file, which must be a library or executable.
Ignored. There for compatibility with cc.
Defines preprocessor variables from the command line at compile time.
Add a directory to the search path for preprocessor include files.
Causes compiled files to include debugging information.
Add a directory to the search path for libraries selected by the -l command.
Specifies libraries to link in.
Causes files to be compiled with maximum optimization.
If this follows -O on the command line, it turns optimization back off. This is just a convenience for simple-minded makefiles.
Enable architecture-specific production-mode features. For instance, use available hardware features more aggressively. It's probably a bad idea to build some objects with this, and others without.
Strip the executable of debugging symbols. Only meaningful when producing an executable.
All commands executed by charmc are echoed to stdout.
Indicates that we're compiling sequential code. On parallel machines with front ends, this option also means that the code is for the front end. This option is only valid with C and C++ files.
Some environments provide more than one C compiler (cc and gcc, for example). Usually, charmc prefers the less buggy of the two. This option causes charmc to switch to the most aggressive compiler, regardless of whether it's buggy or not.
Some environments provide more than one C compiler (cc and gcc, for example). Usually, charmc prefers the less buggy of the two, but not always. This option causes charmc to switch to the most reliable compiler, regardless of whether it produces slow code or not.
When linking with charmc, one must specify the ``language''. This is just a way to help charmc include the right libraries. Pick the ``language'' according to this table:
When linking any CONVERSE program (including any CHARM++ or sdag program), one must include a seed load-balancing library. There are currently three to choose from: rand, test, and neighbor are supported. Default is -balance rand.
When linking with neighbor seed load balancer, one can also specify a virtual tolpogy for constructing neighbors during run-time using +LBTopo topo, where topo can be one of (a) ring, (b) mesh2d, (c) mesh3d and (d) graph. The default is mesh2d.
Selects the desired degree of tracing for CHARM++ programs. See the CHARM++ manual and the PROJECTIONS manuals for more information. Currently supported modes are none, summary, and projections. Default is -tracemode none.
Forces the specified C++ compiler to be used.
Forces the specified C compiler to be used.
Creates a copy of the output file in copy-file.
Options passed to the C pre-processor.
Use this option only when compiling programs that do not include C++ modules. Forces charmc to use the specified linker.
Use this option only when compiling programs that include C++ modules. Forces charmc to use the specified linker.
Options passed to the linker for -language charm++.
Options passed to the linker for -language converse.
Options passes to the linker when linking .o files.
April 10, 2012
Charm Homepage