Download Parallel Object Programming C++ User and Standard

Transcript
Compiling and Running
29
executable files (integer.obj). By convention these executable files have the
extension .obj.
POP-C++ provides the command popcc to compile POP-C++ source code. To compile the
main program we use the following command:
popcc -o main integer.ph integer.cc main.cc
It has to be noticed that we have to explicitly compile the declaration of the parallel class
(the file integer.ph) when in C++ we usually do not compile the declaration files (.h
files). This is a specificity of the POP-C++ compiling process.
4.2.2 Compiling the object code
Use popcc with option -object to generate the object code:
popcc -object -o integer.obj integer.ph integer.cc
Again we have to to explicitly compile the declaration of the parallel class .
One also can generate relocatable code files (.o files) that can be linked using a C++
compiler. As in the normal C++ compiling process, this is done using the -c option
(compile only) along with the popcc command. It has to be noted that all options available
with the used C++ compiler are also available with the popcc compiler as these options are
directly transmitted to the C++ compiler which will generate the final executable files (see
section 4.1).
4.2.3 Running
To execute a POP-C++ application we need to generate the object map file which contains
the list of all compiled parallel classes used by the application. For each parallel class we
have to indicate for which architecture the compilation has been done and the location of the
executable file (.obj file).
With POP-C++ it is possible to get this information by executing the object executable file
with the option -listlong.
Example for the Integer parallel class:
./integer.obj -listlong
This will display the following information:
Integer i686-pc-Linux /home/myuser/popc/test/integer/integer.obj
To generate the object map file we simply redirect the output to the object map file:
./integer.obj -listlong > obj.map
The object map file must contain all mappings between object names, platforms and the
executable files locations.
We can now run the program using the command popcrun: