Cashmere: Building Cashmere Applications


Cashmere applications must be compiled with a special compiler, csm_cc, that duplicates all writes to shared memory. You must link your application with either the regular cashmere library (libcsm.a) or the debug version of the cashmere library (libcsmd.a). Your source code should include the csm.h header file. Cashmere applications can be written in either C or C++.

The following command will compile and link the Cashmere application ``ufft'' with the regular Cashmere library.

csm_cc -o ufft ufft.cpp -lcsm
Csm_cc will use the GNU C/C++ compiler with an additional write-duplication pass to compile and link the application. It links the application with the libraries libimc.a and libmach.a in addition libraries linked by gcc. To link with the debug version of the cashmere library, use the -lcsmd command line option.


If you want to compile without automatic write duplications, you must include the /u/cashmere/include directory in preprocessor pass and the /u/cashmere/lib directory in the link pass. You must also manually link the three libraries: libcsm.a, libimc.a and libmach.a. For example:

gcc -I/u/cashmere/include -c ufft_man.cpp
  
gcc -L/u/cashmere/lib -o ufft_man ufft_man.cpp \
-lm -lcsm -limc -lmach
In addition, you must manually duplicate all writes to shared memory. There Cashmere library exports a function ``csm_duplicate_writes'' that will duplicate write a block of memory.